WO2025066059A1 - Data maintenance method and device for database - Google Patents
Data maintenance method and device for database Download PDFInfo
- Publication number
- WO2025066059A1 WO2025066059A1 PCT/CN2024/083496 CN2024083496W WO2025066059A1 WO 2025066059 A1 WO2025066059 A1 WO 2025066059A1 CN 2024083496 W CN2024083496 W CN 2024083496W WO 2025066059 A1 WO2025066059 A1 WO 2025066059A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- time
- database
- subtask
- rows
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
- G06F9/524—Deadlock detection or avoidance
Definitions
- the present invention relates to the technical field of database management, and in particular to a data maintenance method and device for a process control system database.
- the process control system is a management system that connects the upper and lower levels in the steel industry. It obtains master data from the upper-level manufacturing execution system, calculates production setting values, and sends them to the lower-level basic automation system for execution. During the production process, the process control system obtains the measured process data of the lower-level basic automation system, forms production results, and sends them to the upper-level manufacturing execution system.
- a process control system is a system that involves data exchange, management, and display. It includes master data tables, performance data tables, production real-time process data tables, log tables, process parameter configuration tables, process parameter history tables, and so on. When the data in these tables increases, it may affect the query and writing efficiency of the program. Generally, real-time data needs to be saved for at least half a year, and material master data and performance data need to be saved for at least two years.
- Some process control systems use bat commands to periodically delete historical data, but this method has the following problems: 1. Deleting a large amount of data may cause the database to be locked for a short period of time, thus affecting the normal operation of the program. 2. If the unit is shut down for a long time, the data table may be completely cleared. 3. The deleted data cannot be viewed again.
- the purpose of the present invention is to overcome at least one defect in the prior art and to provide a database According to maintenance methods and equipment.
- the present invention provides a method for maintaining database data, comprising the following steps:
- S1 Create a database automatic maintenance task, which includes at least one subtask.
- Each subtask contains at least the following information: table name, number of retention days KeepDays, minimum number of retained rows KeepRowsMin, maximum number of rows to be deleted at a time DeleteRowsMax, and expected next deletion time NextDelTime;
- S3 Perform data maintenance tasks on the corresponding data table in the database according to the information contained in the subtask.
- the data maintenance task automatically delete the data in the data table before KeepDays days according to the time field to ensure that at least KeepRowsMin rows of data remain in the data table, and no more than DeleteRowsMax rows of data can be deleted at a single time.
- establishing a database automatic maintenance task specifically includes: establishing a database automatic maintenance table, the fields of which include at least: table name, number of retention days KeepDays, minimum number of retained rows KeepRowsMin, maximum number of rows deleted at a time DeleteRowsMax, and expected next deletion time NextDelTime;
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Quality & Reliability (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本发明涉及数据库管理技术领域,尤其涉及一种过程控制系统数据库的数据维护方法和设备。The present invention relates to the technical field of database management, and in particular to a data maintenance method and device for a process control system database.
过程控制系统是钢铁行业中承上启下的管理系统。它通过从上级制造执行系统获取主数据,并计算生产设定值,将其发送给下级基础自动化系统进行执行。在生产过程中,过程控制系统获取下级基础自动化系统的实测工艺数据,形成生产实绩,并将其发送给上级制造执行系统。The process control system is a management system that connects the upper and lower levels in the steel industry. It obtains master data from the upper-level manufacturing execution system, calculates production setting values, and sends them to the lower-level basic automation system for execution. During the production process, the process control system obtains the measured process data of the lower-level basic automation system, forms production results, and sends them to the upper-level manufacturing execution system.
本质上,过程控制系统是一个涉及数据交换、管理和显示的系统。它包括主数据表、实绩数据表、生产实时工艺数据表、日志表、工艺参数配置表、工艺参数历史表等等。当这些表中的数据增多时,可能会影响程序的查询和写入效率。通常情况下,实时数据需要保存至少半年,物料主数据及实绩数据需要保存至少两年。In essence, a process control system is a system that involves data exchange, management, and display. It includes master data tables, performance data tables, production real-time process data tables, log tables, process parameter configuration tables, process parameter history tables, and so on. When the data in these tables increases, it may affect the query and writing efficiency of the program. Generally, real-time data needs to be saved for at least half a year, and material master data and performance data need to be saved for at least two years.
为了确保系统的稳定高效运行,维护人员通常会定期删除早期的历史数据。然而,这种操作不仅增加了人工工作量,还可能导致误操作的风险。In order to ensure the stable and efficient operation of the system, maintenance personnel usually delete early historical data regularly. However, this operation not only increases the manual workload, but also may lead to the risk of misoperation.
一些过程控制系统使用bat命令来定期删除历史数据,但这种方法存在以下问题:1.大量删除数据可能导致数据库短期锁定,从而影响程序的正常运行。2.如果机组停产时间较长,可能会导致数据表被完全清空。3.被删除的数据将无法再次查看。Some process control systems use bat commands to periodically delete historical data, but this method has the following problems: 1. Deleting a large amount of data may cause the database to be locked for a short period of time, thus affecting the normal operation of the program. 2. If the unit is shut down for a long time, the data table may be completely cleared. 3. The deleted data cannot be viewed again.
发明内容Summary of the invention
本发明的目的在于克服现有技术中的至少一种缺陷,提出一种数据库的数 据维护方法和设备。The purpose of the present invention is to overcome at least one defect in the prior art and to provide a database According to maintenance methods and equipment.
为实现上述目的,本发明提供一种数据库的数据维护方法,包括如下步骤:To achieve the above object, the present invention provides a method for maintaining database data, comprising the following steps:
S1:创建数据库自动维护任务,该数据库自动维护任务至少包括一个子任务,每个子任务包含的信息至少包括:表名、保留天数KeepDays、最少保留行数KeepRowsMin、单次最多删除行数DeleteRowsMax、预期下次删除时间NextDelTime;S1: Create a database automatic maintenance task, which includes at least one subtask. Each subtask contains at least the following information: table name, number of retention days KeepDays, minimum number of retained rows KeepRowsMin, maximum number of rows to be deleted at a time DeleteRowsMax, and expected next deletion time NextDelTime;
S2:获取数据库自动维护任务中预期下次删除时间最小的子任务包含的信息,当该子任务包含的预期下次删除时间NextDelTime大于当前系统时间DtNow时,则重新执行步骤S2,当该子任务包含的预期下次删除时间NextDelTime小于或等于当前系统时间DtNow时,则执行步骤S3;S2: Obtain information contained in the subtask with the smallest expected next deletion time in the database automatic maintenance task. When the expected next deletion time NextDelTime contained in the subtask is greater than the current system time DtNow, re-execute step S2; when the expected next deletion time NextDelTime contained in the subtask is less than or equal to the current system time DtNow, execute step S3;
S3:按照该子任务包含的信息对数据库中对应的数据表执行数据维护任务,执行数据维护任务时,根据时间字段自动删除所述数据表中KeepDays天前的数据,保证所述数据表至少还剩KeepRowsMin行数据,且单次删除不得超过DeleteRowsMax行数据。S3: Perform data maintenance tasks on the corresponding data table in the database according to the information contained in the subtask. When performing the data maintenance task, automatically delete the data in the data table before KeepDays days according to the time field to ensure that at least KeepRowsMin rows of data remain in the data table, and no more than DeleteRowsMax rows of data can be deleted at a single time.
在一些实施例中,建立数据库自动维护任务,具体包括:建立数据库自动维护表,数据库自动维护表的字段至少包括:表名、保留天数KeepDays、最少保留行数KeepRowsMin、单次最多删除行数DeleteRowsMax、预期下次删除时间NextDelTime;In some embodiments, establishing a database automatic maintenance task specifically includes: establishing a database automatic maintenance table, the fields of which include at least: table name, number of retention days KeepDays, minimum number of retained rows KeepRowsMin, maximum number of rows deleted at a time DeleteRowsMax, and expected next deletion time NextDelTime;
数据库自动维护表的每一行一一对应一个子任务。Each row of the database automatic maintenance table corresponds to a subtask.
在一些实施例中,步骤S2中,当该子任务包含的预期下次删除时间NextDelTime大于当前系统时间DtNow时,则等待时间T0或T1,然后重新执行步骤S2。 In some embodiments, in step S2, when the expected next deletion time NextDelTime included in the subtask is greater than the current system time DtNow, wait for time T0 or T1, and then re-execute step S2.
在一些实施例中,T0等于NextDelTime减去DtNow的总秒数并向上取整数。In some embodiments, T0 is equal to the total number of seconds of NextDelTime minus DtNow and rounded up.
T1为设定的时间。T1 is the set time.
在一些实施例中,S3中每次执行数据维护任务后,更新该子任务的预期下次删除时间NextDelTime,等待时间T1,然后进入步骤S2。In some embodiments, after each execution of the data maintenance task in S3, the expected next deletion time NextDelTime of the subtask is updated, the waiting time T1 is waited, and then step S2 is entered.
在一些实施例中,执行数据维护任务前,还包括:判断数据库中是否存在与该子任务包含的表名对应的数据表,若数据库中存在对应的数据表时,则对所述数据表执行数据维护任务,否则,更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S2,T2大于T1。In some embodiments, before executing the data maintenance task, it also includes: determining whether there is a data table corresponding to the table name contained in the subtask in the database. If there is a corresponding data table in the database, the data maintenance task is executed on the data table; otherwise, the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and then wait for T1 seconds to enter step S2, where T2 is greater than T1.
在一些实施例中,数据表中的时间字段为一个,执行数据维护任务时,根据该时间字段TimeFieldName自动删除所述数据表中KeepDays天前的数据;In some embodiments, there is one time field in the data table, and when executing the data maintenance task, the data in the data table before KeepDays days is automatically deleted according to the time field TimeFieldName;
或者,or,
数据表中的时间字段为一个或多个,每个子任务包含的信息还包括时间字段TimeFieldName,该时间字段TimeFieldName为数据表的其中一个时间字段,执行数据维护任务时,根据该时间字段TimeFieldName自动删除所述数据表中KeepDays天前的数据。There are one or more time fields in the data table. The information contained in each subtask also includes a time field TimeFieldName. The time field TimeFieldName is one of the time fields in the data table. When executing the data maintenance task, the data in the data table before KeepDays days is automatically deleted according to the time field TimeFieldName.
在一些实施例中,步骤S3具体包括:In some embodiments, step S3 specifically includes:
S31:获取所述数据表中所述时间字段TimeFieldName小于deadLineTime的总行数r1,其中deadLineTime等于当前系统时间DtNow减去保留天数KeepDays,若r1大于0,则进入步骤S32;S31: Obtain the total number of rows r1 in the data table whose time field TimeFieldName is less than deadlineLineTime, where deadlineLineTime is equal to the current system time DtNow minus the number of retention days KeepDays. If r1 is greater than 0, proceed to step S32;
S32:获取所述数据表中总行数r2,获取r1、r2-KeepRowsMin、DeleteRowsMax这三个数据中的最小值delTarget,若delTarget大于0,则进入步骤S33; S32: Get the total number of rows r2 in the data table, and get the minimum value delTarget among the three data r1, r2-KeepRowsMin, and DeleteRowsMax. If delTarget is greater than 0, go to step S33;
S33:获取delTime,包括:从所述数据表中按照所述时间字段TimeFieldName升序查询,跳过delTarget行后,获取第一行的时间字段TimeFieldName的值即delTime;S33: obtaining delTime, including: searching the data table in ascending order according to the time field TimeFieldName, skipping the delTarget row, and obtaining the value of the time field TimeFieldName in the first row, namely delTime;
S34:删除所述数据表中所述时间字段TimeFieldName小于delTime的所有行,并获取实际删除行数delCnt,若delCnt大于或等于DeleteRowsMax,则更新该子任务的NextDelTime为当前系统时间DtNow加上T1秒,等待T1秒后进入步骤S2,若delCnt小于DeleteRowsMax,则更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S2,T2大于T1。S34: Delete all rows in the data table whose time field TimeFieldName is less than delTime, and obtain the actual number of deleted rows delCnt. If delCnt is greater than or equal to DeleteRowsMax, update the NextDelTime of the subtask to the current system time DtNow plus T1 seconds, wait for T1 seconds and enter step S2. If delCnt is less than DeleteRowsMax, update the expected next deletion time NextDelTime of the subtask to the current system time DtNow plus T2 seconds, wait for T1 seconds and enter step S2, where T2 is greater than T1.
在一些实施例中,每次执行数据维护任务后,当发现该数据维护任务未维护完成(即当r1、r2-KeepRowsMin均大于DeleteRowsMax的情况)时,则更新该子任务的NextDelTime为当前系统时间DtNow加上T1秒,并等待T1秒后进入步骤S2;当发现该数据维护任务已维护完成(即当r1、r2-KeepRowsMin中的任一个小于或等于DeleteRowsMax的情况)时,则更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S2,T2大于T1。In some embodiments, after each execution of a data maintenance task, when it is found that the data maintenance task has not been completed (i.e., when r1 and r2-KeepRowsMin are both greater than DeleteRowsMax), the NextDelTime of the subtask is updated to the current system time DtNow plus T1 seconds, and step S2 is entered after waiting for T1 seconds; when it is found that the data maintenance task has been completed (i.e., when any one of r1 and r2-KeepRowsMin is less than or equal to DeleteRowsMax), the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and step S2 is entered after waiting for T1 seconds, and T2 is greater than T1.
在一些实施例中,步骤S31中如果r1等于0,则更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S2;In some embodiments, if r1 is equal to 0 in step S31, the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and then step S2 is entered after waiting for T1 seconds;
和/或,and/or,
步骤S32中若delTarget小于或等于0,则更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S5。 If delTarget is less than or equal to 0 in step S32, the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and then the process goes to step S5 after waiting for T1 seconds.
在一些实施例中,子任务包含的信息还包括:用于表示是否备份的信息,步骤S33与步骤S34之间还包括如下步骤:根据该子任务包含的信息判断是否需要备份,若是,则执行数据备份步骤后进入步骤S34,若否,则跳过数据备份步骤,进入步骤S34;In some embodiments, the information included in the subtask also includes: information for indicating whether to back up, and the following steps are included between step S33 and step S34: judging whether to back up according to the information included in the subtask, if so, executing the data backup step and then entering step S34, if not, skipping the data backup step and entering step S34;
执行数据备份步骤,具体包括:获取所述数据表中所述时间字段TimeFieldName小于delTime的所有行,并生成备份数据后进行异库备份。The data backup step is performed, specifically including: obtaining all rows in the data table where the time field TimeFieldName is less than delTime, and performing a different database backup after generating backup data.
在一些实施例中,执行数据备份步骤,具体包括:获取所述数据表中所述时间字段TimeFieldName小于delTime的所有行,并生成多行备份表的数据后存入到备份表中;In some embodiments, performing the data backup step specifically includes: obtaining all rows in the data table where the time field TimeFieldName is less than delTime, and generating multiple rows of backup table data and storing them in the backup table;
备份表的字段至少包括:唯一ID、原始表的时间、原始表的表名、原始表的一行记录以及备份当前时刻。The fields of the backup table include at least: a unique ID, the time of the original table, the name of the original table, a row of records in the original table, and the current time of the backup.
本发明还公开一种数据库的数据维护设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的数据库的数据维护程序,所述数据库的数据维护程序配置为实现如上所述的数据库的数据维护方法。The present invention also discloses a database data maintenance device, comprising: a memory, a processor, and a database data maintenance program stored in the memory and executable on the processor, wherein the database data maintenance program is configured to implement the database data maintenance method as described above.
本发明至少具有如下有益效果:The present invention has at least the following beneficial effects:
1)本发明可以全自动完成过程控制系统数据库维护,减轻了人工维护的负担。1) The present invention can fully automatically complete the maintenance of the process control system database, reducing the burden of manual maintenance.
2)本发明在删除数据表之前,先进行异库备份,这一方面可以防止误删数据,另一方面也为后期数据回溯提供了可能性。2) Before deleting the data table, the present invention first performs a different database backup, which can prevent accidental deletion of data on the one hand, and also provides a possibility for later data backtracking on the other hand.
3)本发明在数据表删除过程中进行限流操作,避免了表死锁,确保了过程控制系统的正常业务逻辑运行。3) The present invention performs current limiting operation during the data table deletion process, thereby avoiding table deadlock and ensuring the normal business logic operation of the process control system.
4)本发明的数据表至少保留一定量的数据,以确保过程控制系统的HMI界 面不会为空。4) The data table of the present invention retains at least a certain amount of data to ensure that the HMI interface of the process control system The face will not be empty.
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
图1为本发明实施例提供的过程控制系统数据库的数据维护方法的流程图。FIG. 1 is a flow chart of a method for maintaining data in a process control system database according to an embodiment of the present invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
为了解决过程控制系统长时间运行导致数据库膨胀,进而影响运行效率的问题,本发明提出了一种数据库的历史数据维护方法。该方法可以确保数据表至少包含一定数量的行,通过优化删除操作来避免死锁,并对被删除的数据进行备份保存,以提高数据库的运行稳定性。In order to solve the problem that the long-term operation of the process control system causes the database to expand, thereby affecting the operation efficiency, the present invention proposes a method for maintaining historical data of the database. The method can ensure that the data table contains at least a certain number of rows, avoid deadlock by optimizing the deletion operation, and back up and save the deleted data to improve the operation stability of the database.
参见图1,本发明实施例提供了一种过程控制系统数据库的数据维护方法,包括如下步骤:Referring to FIG. 1 , an embodiment of the present invention provides a data maintenance method for a process control system database, comprising the following steps:
S1:创建数据库自动维护任务,该数据库自动维护任务至少包括一个子任务,每个子任务包含的信息至少包括:表名、保留天数KeepDays、最少保留行数KeepRowsMin、单次最多删除行数DeleteRowsMax、预期下次删除时间NextDelTime;S1: Create a database automatic maintenance task, which includes at least one subtask. Each subtask contains at least the following information: table name, number of retention days KeepDays, minimum number of retained rows KeepRowsMin, maximum number of rows to be deleted at a time DeleteRowsMax, and expected next deletion time NextDelTime;
S2:获取数据库自动维护任务中预期下次删除时间最小的子任务包含的信 息,当该子任务包含的预期下次删除时间NextDelTime大于当前系统时间DtNow时,则等待时间T0或T1,然后重新执行步骤S2,当该子任务包含的预期下次删除时间NextDelTime小于或等于当前系统时间DtNow时,则执行步骤S3;S2: Get the information contained in the subtask with the smallest expected next deletion time in the database automatic maintenance task. When the expected next deletion time NextDelTime included in the subtask is greater than the current system time DtNow, wait for time T0 or T1, and then re-execute step S2; when the expected next deletion time NextDelTime included in the subtask is less than or equal to the current system time DtNow, execute step S3;
S3:数据表自动维护,包括按照该子任务包含的信息对数据库中该子任务包含的表名对应的数据表执行数据维护任务,执行数据维护任务时,根据时间字段自动删除所述数据表中KeepDays天前的数据,保证所述数据表至少还剩KeepRowsMin行数据,且单次删除不得超过DeleteRowsMax行数据。S3: Automatic data table maintenance, including executing data maintenance tasks on the data table corresponding to the table name contained in the subtask in the database according to the information contained in the subtask. When executing the data maintenance task, the data in the data table older than KeepDays days is automatically deleted according to the time field to ensure that at least KeepRowsMin rows of data remain in the data table, and no more than DeleteRowsMax rows of data are deleted at a single time.
在一些实施例中,T0等于NextDelTime减去DtNow的总秒数并向上取整数。In some embodiments, T0 is equal to the total number of seconds of NextDelTime minus DtNow and rounded up.
在一些实施例中,S3中每次执行数据维护任务后,更新该子任务的预期下次删除时间NextDelTime,等待时间T1,然后进入步骤S2。In some embodiments, after each execution of the data maintenance task in S3, the expected next deletion time NextDelTime of the subtask is updated, the waiting time T1 is waited, and then step S2 is entered.
T1为设定的时间,T1一般为较短时间,比如为1秒等等。T1 is the set time, which is generally a shorter time, such as 1 second.
本发明可以定时或周期性(比如T1时间间隔)运行S2、S3步骤,对数据库的数据进行维护。The present invention can execute steps S2 and S3 regularly or periodically (such as at a time interval T1) to maintain the data in the database.
本发明可以设定为设备开机时该程序就开始运行,即开始执行S2、S3步骤,关机时则自动结束运行该程序。The present invention can be set so that the program starts running when the device is turned on, that is, starts to execute steps S2 and S3, and automatically ends running the program when the device is turned off.
在一些实施例中,建立数据库自动维护任务,具体包括:建立数据库自动维护表,数据库自动维护表的字段至少包括:表名、保留天数KeepDays、最少保留行数KeepRowsMin、单次最多删除行数DeleteRowsMax、预期下次删除时间NextDelTime;数据库自动维护表的每一行一一对应一个子任务。In some embodiments, establishing a database automatic maintenance task specifically includes: establishing a database automatic maintenance table, the fields of the database automatic maintenance table include at least: table name, retention days KeepDays, minimum number of retained rows KeepRowsMin, maximum number of rows to be deleted at a time DeleteRowsMax, expected next deletion time NextDelTime; each row of the database automatic maintenance table corresponds to a subtask one by one.
在一些实施例中,数据表中的时间字段为一个,执行数据维护任务时,根据该时间字段TimeFieldName自动删除所述数据表中KeepDays天前的数据。In some embodiments, there is only one time field in the data table. When a data maintenance task is executed, data in the data table older than KeepDays days is automatically deleted according to the time field TimeFieldName.
在另一些实施例中,数据表中的时间字段为一个或多个,每个子任务包含 的信息还包括时间字段TimeFieldName,该时间字段TimeFieldName为数据表的其中一个时间字段,执行数据维护任务时,根据该时间字段TimeFieldName自动删除所述数据表中KeepDays天前的数据。In some other embodiments, the time field in the data table is one or more, and each subtask contains The information also includes a time field TimeFieldName, which is one of the time fields in the data table. When the data maintenance task is executed, the data in the data table before KeepDays days is automatically deleted according to the time field TimeFieldName.
在一些实施例中,建立数据库自动维护表的字段至少包括:表名,类型为字符串类型,且为主键;保留天数,类型为单精度浮点型;最少保留行数,类型为整型;最多删除行数,类型为整型;时间字段,类型为字符串类型;预期下次删除时间,类型为日期时间。In some embodiments, the fields for establishing a database automatic maintenance table include at least: table name, which is a string type and is the primary key; number of retention days, which is a single-precision floating point type; minimum number of rows to be retained, which is an integer type; maximum number of rows to be deleted, which is an integer type; time field, which is a string type; and expected next deletion time, which is a date and time type.
此数据库自动维护表一般就建在过程控制系统的业务数据库中,当然也可以建在独立的数据库中,甚至是文本文件中。某实施例,以MySQL数据库为例,建立一个数据库自动维护表,表名为cfg_db_maintenance,表的字段详情如下:
This database automatic maintenance table is generally built in the business database of the process control system, and of course it can also be built in an independent database or even a text file. In one embodiment, taking the MySQL database as an example, a database automatic maintenance table is established, the table name is cfg_db_maintenance, and the field details of the table are as follows:
其中,某一行内容如下:Among them, one line contains the following:
TableName=mill_operation_logTableName=mill_operation_log
KeepDays=30KeepDays=30
KeepRowsMin=100KeepRowsMin=100
DeleteRowsMax=1000DeleteRowsMax=1000
TimeFieldName=OperationTimeTimeFieldName=OperationTime
NextDelTime=2023-08-2920:28:03 NextDelTime=2023-08-2920:28:03
它表示,程序需要自动维护表mill_operation_log,根据OperationTime这个时间字段自动删除30天前的数据,但是需要保证表mill_operation_log至少还剩100行数据,且单次删除不得超过1000行。下次执行该项维护任务的时间是2023-08-2920:28:03。It indicates that the program needs to automatically maintain the mill_operation_log table and automatically delete data older than 30 days based on the OperationTime time field, but it needs to ensure that there are at least 100 rows of data left in the mill_operation_log table and no more than 1,000 rows can be deleted at a time. The next time this maintenance task is executed is 2023-08-29 20:28:03.
在一些实施例中,步骤S1还包括建立备份表,字段包括:主键字段,保证其唯一;原始表的时间,类型为日期时间;原始表的表名,类型为字符串类型;原始表的一行记录,类型为文本;备份时间,类型为日期时间;In some embodiments, step S1 further includes establishing a backup table, the fields of which include: a primary key field, which ensures its uniqueness; the time of the original table, the type is date and time; the table name of the original table, the type is string type; a row of records in the original table, the type is text; the backup time, the type is date and time;
主键字段可以使用长整型作为自增ID,也可以使用字符串,由GUID生成。优选的,是使用SnowFlake组件生成的BIGINT作为主键字段,以确保其递增性和唯一性。与作为字符串的GUID相比,SnowFlake组件的读写效率更高,并且与自增ID相比,它不会暴露业务数据的进度。The primary key field can use a long integer as an auto-increment ID, or a string generated by a GUID. Preferably, the BIGINT generated by the SnowFlake component is used as the primary key field to ensure its increment and uniqueness. Compared with a GUID as a string, the SnowFlake component has higher read and write efficiency, and compared with an auto-increment ID, it does not expose the progress of business data.
需要说明的是,备份表不应放到过程控制系统的业务数据库中,应存放在第三方数据库中,以某实施例为例,其保存在本机SQLite数据库中,方便备份与管理,这个历史数据备份表的表名为HisDbBackup,表的字段详情如下:
It should be noted that the backup table should not be placed in the business database of the process control system, but should be stored in a third-party database. Taking a certain embodiment as an example, it is stored in the local SQLite database for easy backup and management. The name of this historical data backup table is HisDbBackup, and the field details of the table are as follows:
毫无疑问,RowJson将来会占用大量的空间。它是过程控制系统业务数据库历史数据备份的真正位置。采用这个表设计非常通用,可以备份各种类型的表。There is no doubt that RowJson will take up a lot of space in the future. It is the real location for the historical data backup of the process control system business database. This table design is very general and can back up various types of tables.
在一些实施例中,T0等于NextDelTime减去DtNow的总秒数并向上取整数。In some embodiments, T0 is equal to the total number of seconds of NextDelTime minus DtNow and rounded up.
在一些实施例中,执行数据维护任务前,还包括:判断数据库中是否存在 与该子任务包含的表名对应的数据表,若数据库中存在与该子任务包含的表名对应的数据表时,则对所述数据表执行数据维护任务,否则,更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S2,T2大于T1。In some embodiments, before executing the data maintenance task, it also includes: determining whether there is For the data table corresponding to the table name included in the subtask, if the data table corresponding to the table name included in the subtask exists in the database, the data maintenance task is performed on the data table; otherwise, the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and then enter step S2 after waiting for T1 seconds, where T2 is greater than T1.
在一些实施例中,步骤S3具体包括:In some embodiments, step S3 specifically includes:
S31:获取所述数据表中所述时间字段TimeFieldName小于deadLineTime的总行数r1,其中deadLineTime等于当前系统时间DtNow减去保留天数KeepDays,若r1大于0,则进入步骤S32;S31: Obtain the total number of rows r1 in the data table whose time field TimeFieldName is less than deadlineLineTime, where deadlineLineTime is equal to the current system time DtNow minus the number of retention days KeepDays. If r1 is greater than 0, proceed to step S32;
S32:获取所述数据表中总行数r2,获取r1、r2-KeepRowsMin、DeleteRowsMax这三个数据中的最小值delTarget,若delTarget大于0,则进入步骤S33;S32: Get the total number of rows r2 in the data table, and get the minimum value delTarget among the three data r1, r2-KeepRowsMin, and DeleteRowsMax. If delTarget is greater than 0, go to step S33;
S33:获取delTime,包括:从所述数据表中按照所述时间字段TimeFieldName升序查询,跳过delTarget行后,获取第一行的时间字段TimeFieldName的值即delTime;S33: obtaining delTime, including: searching the data table in ascending order according to the time field TimeFieldName, skipping the delTarget row, and obtaining the value of the time field TimeFieldName in the first row, namely delTime;
S34:删除所述数据表中所述时间字段TimeFieldName小于delTime的所有行。S34: Delete all rows in the data table where the time field TimeFieldName is less than delTime.
在一些实施例中,步骤S34中删除所述数据表中所述时间字段TimeFieldName小于delTime的所有行后,获取实际删除行数delCnt,若delCnt大于或等于DeleteRowsMax,则更新该子任务的NextDelTime为当前系统时间DtNow加上T1秒,等待T1秒后进入步骤S2,若delCnt小于DeleteRowsMax,则更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S2,T2大于T1。In some embodiments, after deleting all rows in the data table whose time field TimeFieldName is less than delTime in step S34, the actual number of deleted rows delCnt is obtained. If delCnt is greater than or equal to DeleteRowsMax, the NextDelTime of the subtask is updated to the current system time DtNow plus T1 seconds, and step S2 is entered after waiting for T1 seconds. If delCnt is less than DeleteRowsMax, the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and step S2 is entered after waiting for T1 seconds, and T2 is greater than T1.
在一些实施例中,步骤S34中删除所述数据表中所述时间字段 TimeFieldName小于delTime的所有行后,当发现该数据维护任务未维护完成(即当r1、r2-KeepRowsMin均大于DeleteRowsMax的情况)时,则更新该子任务的NextDelTime为当前系统时间DtNow加上T1秒,并等待T1秒后进入步骤S2;当发现该数据维护任务已维护完成(即当r1、r2-KeepRowsMin中的任一个小于或等于DeleteRowsMax的情况)时,则更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S2,T2大于T1。In some embodiments, the time field in the data table is deleted in step S34. After checking all the rows whose TimeFieldName is less than delTime, when it is found that the data maintenance task has not been completed (that is, when r1 and r2-KeepRowsMin are both greater than DeleteRowsMax), the NextDelTime of the subtask is updated to the current system time DtNow plus T1 seconds, and then enter step S2 after waiting for T1 seconds; when it is found that the data maintenance task has been completed (that is, when any one of r1, r2-KeepRowsMin is less than or equal to DeleteRowsMax), the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and then enter step S2 after waiting for T1 seconds, where T2 is greater than T1.
在一些实施例中,步骤S31中如果r1等于0,则更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S2。In some embodiments, if r1 is equal to 0 in step S31, the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and then step S2 is entered after waiting for T1 seconds.
在一些实施例中,步骤S32中若delTarget小于或等于0,则更新该子任务的预期下次删除时间NextDelTime为当前系统时间DtNow加上T2秒,并等待T1秒后进入步骤S5。In some embodiments, if delTarget is less than or equal to 0 in step S32, the expected next deletion time NextDelTime of the subtask is updated to the current system time DtNow plus T2 seconds, and then step S5 is entered after waiting for T1 seconds.
在一些实施例中,子任务包含的信息还包括:用于表示是否备份的信息,步骤S33与步骤S34之间还包括如下步骤:根据该子任务包含的信息判断是否需要备份,若是,则执行数据备份步骤后进入步骤S34,若否,则跳过数据备份步骤,进入步骤S34;In some embodiments, the information included in the subtask also includes: information for indicating whether to back up, and the following steps are included between step S33 and step S34: judging whether to back up according to the information included in the subtask, if so, executing the data backup step and then entering step S34, if not, skipping the data backup step and entering step S34;
执行数据备份步骤,具体包括:获取所述数据表中所述时间字段TimeFieldName小于delTime的所有行,并生成备份数据后进行异库备份。The data backup step is performed, specifically including: obtaining all rows in the data table where the time field TimeFieldName is less than delTime, and performing a different database backup after generating backup data.
在一些实施例中,执行数据备份步骤,具体包括:获取所述数据表中所述时间字段TimeFieldName小于delTime的所有行,并生成多行备份表的数据后存入到备份表中;In some embodiments, performing the data backup step specifically includes: obtaining all rows in the data table where the time field TimeFieldName is less than delTime, and generating multiple rows of backup table data and storing them in the backup table;
备份表的字段至少包括:唯一ID、原始表的时间、原始表的表名、原始表 的一行记录以及备份当前时刻。The fields of the backup table include at least: unique ID, original table time, original table name, original table A line of records and backup current time.
在一些实施例中,当步骤S1中建立数据库自动维护任务时采用建立数据库自动维护表时,步骤S2具体包括:获取自动维护表中预期下次删除时间最小的那一行Row,该行至少包括表名TableName,保留天数KeepDays,最少保留行数KeepRowsMin,最多删除行数DeleteRowsMax,时间字段TimeFieldName,预期下次删除时间NextDelTime。In some embodiments, when the database automatic maintenance task is established in step S1 by establishing a database automatic maintenance table, step S2 specifically includes: obtaining the row Row in the automatic maintenance table with the smallest expected next deletion time, the row at least including the table name TableName, the number of retention days KeepDays, the minimum number of retained rows KeepRowsMin, the maximum number of deleted rows DeleteRowsMax, the time field TimeFieldName, and the expected next deletion time NextDelTime.
当NextDelTime大于当前系统时间DtNow时,则休眠T0秒,然后重新执行步骤S2,其中T0表示(NextDelTime-DtNow)经历的总秒数并向上取整数。When NextDelTime is greater than the current system time DtNow, the process sleeps for T0 seconds and then re-executes step S2, where T0 represents the total number of seconds that have passed (NextDelTime-DtNow) and is rounded up to an integer.
当NextDelTime小于或等于当前系统时间DtNow时,则执行步骤S3;When NextDelTime is less than or equal to the current system time DtNow, step S3 is executed;
步骤S3具体包括:Step S3 specifically includes:
步骤S31,如果数据库中不存在表TableName,则更新Row的NextDelTime为当前系统时间DtNow加上T2秒,并进入步骤S4,否则,执行步骤S32;Step S31, if the table TableName does not exist in the database, update the NextDelTime of Row to the current system time DtNow plus T2 seconds, and go to step S4, otherwise, execute step S32;
步骤S32,获取表TableName中时间字段TimeFieldName小于deadLineTime的总行数r1,其中deadLineTime等于DtNow减去KeepDays。如果r1等于0,则更新Row的NextDelTime为DtNow加上T2秒,并进入步骤S4,如果r1大于0,则执行步骤S33;Step S32, get the total number of rows r1 in the table TableName whose time field TimeFieldName is less than deadlineLineTime, where deadlineLineTime is equal to DtNow minus KeepDays. If r1 is equal to 0, update the NextDelTime of Row to DtNow plus T2 seconds, and go to step S4. If r1 is greater than 0, go to step S33;
步骤S33,获取表TableName总行数r2。然后获取r1,r2-KeepRowsMin,DeleteRowsMax这三个数据中的最小值delTarget。若delTarget小于或等于0,则更新该行Row的NextDelTime为DtNow加上T2秒,并进入步骤S4,若delTarget大于0,则执行步骤S34;Step S33, get the total number of rows in table TableName, r2. Then get the minimum value delTarget among r1, r2-KeepRowsMin, DeleteRowsMax. If delTarget is less than or equal to 0, update the NextDelTime of the row Row to DtNow plus T2 seconds, and go to step S4. If delTarget is greater than 0, go to step S34.
步骤S34,获取delTime,即从表TableName中按照TimeFieldName升序查询,跳过delTarget行后选择第一行的TimeFieldName的值为delTime。 Step S34, obtaining delTime, that is, searching in ascending order of TimeFieldName from the table TableName, skipping the delTarget row and selecting the first row whose TimeFieldName value is delTime.
步骤S35,备份数据:获取表TableName中TimeFieldName小于delTime所有行,并生成多行备份表的数据,包括唯一ID,原始表的时间(原始表要备份的那一行的TimeFieldName所对应的时间),原始表的表名,以及当前行整体JSON序列化之后的字符串,备份当前时刻,并将这些数据存入到备份表中。Step S35, backup data: obtain all rows in the table TableName whose TimeFieldName is less than delTime, and generate multiple rows of backup table data, including the unique ID, the time of the original table (the time corresponding to the TimeFieldName of the row to be backed up in the original table), the table name of the original table, and the string after the entire JSON serialization of the current row, back up the current time, and store these data in the backup table.
步骤S36,删除数据:删除表TableName中TimeFieldName小于delTime所有行,并返回实际删除行数delCnt。Step S36, delete data: delete all rows in the table TableName where TimeFieldName is less than delTime, and return the actual number of deleted rows delCnt.
步骤S37,如果delCnt大于或等于DeleteRowsMax则更新Row的NextDelTime为DtNow加上T1秒,并进入步骤S4,否则更新Row的NextDelTime为DtNow加上T2秒,并进入步骤S4。Step S37, if delCnt is greater than or equal to DeleteRowsMax, update the NextDelTime of Row to DtNow plus T1 seconds, and go to step S4, otherwise update the NextDelTime of Row to DtNow plus T2 seconds, and go to step S4.
步骤S4,休眠T1秒,然后进入步骤S2。Step S4, sleep for T1 seconds, and then enter step S2.
其中T1是一个较小的时间,例如1秒,T2是一个较大的时间,例如300秒。其具体含义是是,当发现维护完成时则休眠较长时间T2,当发现未维护完成,则休眠较短时间T1,之后继续自动维护。T1 is a shorter time, such as 1 second, and T2 is a longer time, such as 300 seconds. The specific meaning is that when it is found that the maintenance is completed, it will sleep for a longer time T2, and when it is found that the maintenance is not completed, it will sleep for a shorter time T1, and then continue the automatic maintenance.
需要说明的是,对于部分表,如果历史数据不重要,可以选择不用备份,此时需要在自动维护表中额外新增一个字段,用于表示是否备份。如果无需备份,则跳过步骤S35。It should be noted that for some tables, if the historical data is not important, you can choose not to back up. In this case, you need to add an additional field in the automatic maintenance table to indicate whether to back up. If no backup is needed, skip step S35.
基于同样的发明构思,本发明实施例还公开一种数据库的数据维护设备,包括:存储器、处理器及存储在所述存储器上并可在所述处理器上运行的数据库的数据维护程序,所述数据库的数据维护程序配置为实现如上所述的数据库的数据维护方法。Based on the same inventive concept, an embodiment of the present invention also discloses a database data maintenance device, including: a memory, a processor, and a database data maintenance program stored in the memory and executable on the processor, wherein the database data maintenance program is configured to implement the database data maintenance method as described above.
所述处理器在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器通常用于控制所述电子设备的总体操作。本实施例中,所述处理器用于运行所述存储 器中存储的程序代码或者处理数据,例如数据库的数据维护方法的程序代码。In some embodiments, the processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is generally used to control the overall operation of the electronic device. In this embodiment, the processor is used to run the storage The program code stored in the device or the program code for processing data, such as the data maintenance method of the database.
所述存储器至少包括一种类型的可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,所述存储器可以是所述电子设备的内部存储单元,例如该电子设备的硬盘或内存。在另一些实施例中,所述存储器也可以是所述电子设备的外部存储设备,例如该电子设备上配备的插接式硬盘,智能存储卡(SmartMedia Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(FlashCard)等。当然,所述存储器还可以既包括所述电子设备的内部存储单元也包括其外部存储设备。本实施例中,所述存储器通常用于存储安装于所述电子设备的操作方法和各类应用软件,例如数据库的数据维护方法的程序代码等。此外,所述存储器还可以用于暂时地存储已经输出或者将要输出的各类数据。The memory includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory may be an internal storage unit of the electronic device, such as a hard disk or memory of the electronic device. In other embodiments, the memory may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (SmartMedia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the electronic device. Of course, the memory may also include both the internal storage unit of the electronic device and its external storage device. In this embodiment, the memory is generally used to store the operating method and various application software installed in the electronic device, such as the program code of the data maintenance method of the database, etc. In addition, the memory may also be used to temporarily store various types of data that have been output or are to be output.
基于同样的发明构思,本发明实施例还公开一种存储介质,所述存储介质存储有数据库的数据维护程序,所述数据库的数据维护程序用于使处理器执行时实现如上所述的数据库的数据维护方法。Based on the same inventive concept, an embodiment of the present invention further discloses a storage medium, wherein the storage medium stores a data maintenance program for a database, and the data maintenance program for the database is used to implement the above-mentioned data maintenance method for the database when the processor executes the program.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框 图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present invention is described with reference to flowcharts and/or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that the flowcharts and/or block diagrams can be implemented by computer program instructions. Each process and/or box in the figure, and the combination of the processes and/or boxes in the flowchart and/or block diagram. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate a device for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。 These computer program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and/or one or more boxes in the block diagram.
Claims (10)
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311272870.X | 2023-09-27 | ||
CN202311272870.XA CN117331939A (en) | 2023-09-27 | 2023-09-27 | Data maintenance method and equipment for database |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2025066059A1 true WO2025066059A1 (en) | 2025-04-03 |
Family
ID=89274869
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2024/083496 WO2025066059A1 (en) | 2023-09-27 | 2024-03-25 | Data maintenance method and device for database |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117331939A (en) |
WO (1) | WO2025066059A1 (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117331939A (en) * | 2023-09-27 | 2024-01-02 | 中冶南方工程技术有限公司 | Data maintenance method and equipment for database |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140229427A1 (en) * | 2013-02-11 | 2014-08-14 | International Business Machines Corporation | Database management delete efficiency |
CN112035297A (en) * | 2020-08-28 | 2020-12-04 | 浪潮云信息技术股份公司 | Automatic cloud backup execution method based on backup task |
CN114936210A (en) * | 2022-05-31 | 2022-08-23 | 中国船舶重工集团公司第七0七研究所 | User-oriented unmanaged database combined cleaning method |
CN115129686A (en) * | 2022-05-12 | 2022-09-30 | 苏宁消费金融有限公司 | The method of regularly deleting the historical partition data of Oracle database partition table |
CN116126840A (en) * | 2022-12-09 | 2023-05-16 | 中信银行股份有限公司 | Automatic cleaning method, device and equipment for data table |
CN117331939A (en) * | 2023-09-27 | 2024-01-02 | 中冶南方工程技术有限公司 | Data maintenance method and equipment for database |
-
2023
- 2023-09-27 CN CN202311272870.XA patent/CN117331939A/en active Pending
-
2024
- 2024-03-25 WO PCT/CN2024/083496 patent/WO2025066059A1/en unknown
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140229427A1 (en) * | 2013-02-11 | 2014-08-14 | International Business Machines Corporation | Database management delete efficiency |
CN112035297A (en) * | 2020-08-28 | 2020-12-04 | 浪潮云信息技术股份公司 | Automatic cloud backup execution method based on backup task |
CN115129686A (en) * | 2022-05-12 | 2022-09-30 | 苏宁消费金融有限公司 | The method of regularly deleting the historical partition data of Oracle database partition table |
CN114936210A (en) * | 2022-05-31 | 2022-08-23 | 中国船舶重工集团公司第七0七研究所 | User-oriented unmanaged database combined cleaning method |
CN116126840A (en) * | 2022-12-09 | 2023-05-16 | 中信银行股份有限公司 | Automatic cleaning method, device and equipment for data table |
CN117331939A (en) * | 2023-09-27 | 2024-01-02 | 中冶南方工程技术有限公司 | Data maintenance method and equipment for database |
Also Published As
Publication number | Publication date |
---|---|
CN117331939A (en) | 2024-01-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2797013A1 (en) | Database update execution according to power management schemes | |
WO2025066059A1 (en) | Data maintenance method and device for database | |
US9740994B2 (en) | Simulation of supply chain plans using data model | |
CN110597821B (en) | Method and device for changing database table structure | |
CN109710698B (en) | Data aggregation method and device, electronic equipment and medium | |
CN105045535A (en) | Method and system for automatically deleting expired data | |
CN100568245C (en) | Workflow data persistence processing method, device and workflow system | |
CN114004465A (en) | Data quality inspection method and system based on distributed big data computing platform | |
CN111159188B (en) | Processing method for realizing quasi-real-time large data volume based on DataWorks | |
CN113434938A (en) | BIM (building information modeling) model checking method and device, computer equipment and storage medium | |
CN111738868A (en) | Anti-money laundering and anti-terrorist financing risk monitoring method, device, computer equipment and storage medium | |
CN117472647A (en) | Database transaction rollback method and device | |
CN110287182A (en) | A big data data comparison method, device, equipment and terminal | |
CN108932334A (en) | One kind is based on the extension of time series storage model and matching optimization method | |
US9785894B2 (en) | Simulation of supply chain plans using web service | |
US20160292203A1 (en) | Process control method for database, medium, and database server | |
CN113419805A (en) | User interface layout method and device, computer equipment and storage medium | |
CN114139367B (en) | Automatic calculation method for standard embedded parts of nuclear power plant | |
CN112764754A (en) | File identifier management method, device and medium based on Unity3D | |
CN106055322A (en) | Flow scheduling method and device | |
CN117076141B (en) | High-applicability off-line data processing task issuing method and system | |
CN119848049B (en) | Database table management method, device, equipment and storage medium | |
JP7007596B2 (en) | Information processing equipment, control method, program | |
CN118820219A (en) | Method, system, device and medium for quickly deleting temporary tables of databases | |
CN119883524A (en) | Method, medium, product and equipment for executing database planning task |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 24869630 Country of ref document: EP Kind code of ref document: A1 |