Historical data archiving implementation method and device and medium

By creating the inheritance relationship between the parent data table and the historical data table in the data management system, configuring archive conditions and performing archive tasks regularly, the historical data management problems under the traditional data management method are solved, and efficient data query and storage management are achieved.

CN119645930APending Publication Date: 2025-03-18SUZHOU REKTEC INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411710598.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-27
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Traditional data management methods are difficult to effectively process large amounts of historical data, resulting in degradation of data query performance, excessive storage space usage, and lack of flexible conditional configuration and management mechanisms.

Method used

By utilizing PGSQL's INHERIT function, we create parent data tables and historical data tables, realize the inheritance relationship of the data tables, configure archive conditions, execute archive tasks regularly, and optimize query functions to support historical data queries.

Benefits of technology

It realizes rapid access to historical data, improves data query speed, reduces storage space usage, supports flexible data archiving and querying, and reduces storage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119645930A_ABST
    Figure CN119645930A_ABST
Patent Text Reader

Abstract

The invention discloses a historical data archiving implementation method and device and a medium. The method comprises the following steps: creating a system architecture and a table; under the condition that table creation is completed, archiving conditions are configured; under the condition that the archiving condition configuration is completed, the archiving task is executed regularly; and aiming at the execution process of the archiving task, the query function is optimized. The method has the beneficial effects that the comprehensive functions of reducing the data volume of the table, improving the query performance, supporting flexible condition configuration, reducing the storage space occupied by the table, avoiding associated data migration, querying archived historical data, querying archived and unarchived total data and periodically deleting useless data through configuration are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data archiving, and in particular relates to a method, device and medium for realizing historical data archiving. Background Art

[0002] In today's digital age, the amount of data is growing explosively, and the data management challenges faced by enterprises and organizations are becoming increasingly severe. With the continuous development of business, more and more historical data is accumulated in the system, especially for those data tables with large data volumes, and traditional data management methods are gradually showing many drawbacks.

[0003] On the one hand, a large amount of historical data is accumulated in the data table, resulting in an excessive amount of data in the table, which not only affects the data query performance and slows down the query speed, but also takes up too much storage space and increases storage costs. For example, in some business systems, as time goes by, transaction records, log data, etc. continue to accumulate, making the relevant data tables bloated. The response time when querying these tables is significantly extended, which brings inconvenience to business operations.

[0004] On the other hand, there is a lack of flexible condition configuration and effective management mechanism for the processing of historical data. In many cases, enterprises need to classify historical data according to different business needs, such as archiving some data that is no longer frequently used, but existing systems often cannot meet such flexible archiving needs. For example, it may be necessary to archive data based on conditions such as the time range and business type, and traditional methods may not be able to easily implement these complex configurations. Summary of the invention

[0005] In order to solve the problems raised in the above background technology, the present invention provides a method for realizing historical data archiving.

[0006] To achieve the above object, the present invention provides the following technical solution: A method for archiving historical data includes:

[0007] System architecture and table creation;

[0008] After the table is created, configure the archiving conditions;

[0009] When the archiving conditions are configured, the archiving task is executed regularly;

[0010] Optimize the query function for the execution process of archiving tasks;

[0011] Further: The system architecture and table creation method include: for data tables with large data volumes, the system uses the INHERIT function of PGSQL based on the opening of the data archiving function to create a parent data table and a historical data table; the historical table and the current data table are integrated from the parent entity table;

[0012] Among them, INHERIT is table inheritance;

[0013] The system architecture and table creation steps are refined, and the parent data table and historical data table are created using the INHERIT function of PGSQL. For data tables with large amounts of data, this table inheritance method helps to better organize the data structure, facilitate the management of historical data and current data, and improve the efficiency of data storage and access.

[0014] Further: when the table is created, the archiving conditions are configured; wherein the method for configuring the archiving conditions includes: for the data table with the data archiving function enabled, the system uses the configuration function based on the data archiving requirements to configure the historical data archiving conditions for the data table with the data archiving function enabled;

[0015] The configuration content includes configuration name, table name, archive type, and FetchXML.

[0016] The method of configuring archiving conditions is clarified, and data tables with enabled functions are configured according to data archiving requirements, so that archiving conditions can be flexibly set according to actual business needs, enhancing the system's adaptability to data archiving in different application scenarios.

[0017] Further: The archiving types in the configuration content include: delete, migrate;

[0018] The system's processing after determining the archive type includes:

[0019] When the archive type is Delete, the system directly deletes the queried data;

[0020] When the archiving type is migration, the system opens a database transaction, deletes the queried data from the current data table, and then inserts it into the historical data table.

[0021] The processing procedures of different archiving types (deletion, migration) are explained in detail. The system can accurately perform corresponding operations according to the specified archiving type, avoiding confusion in data processing and ensuring the accuracy of the data archiving process and the integrity of the data.

[0022] Further: when the archiving condition configuration is completed, the archiving task is executed regularly; wherein the process of executing the archiving task regularly includes:

[0023] Based on the daily time cycle; the system uses the scheduled execution mechanism to execute the archiving task on a daily basis;

[0024] The method for the system to perform archiving tasks regularly every day includes: loading all historical archiving configurations, and performing data query and archiving processing according to the configured FetchXML;

[0025] The archiving processing method includes: deleting and migrating data, and inserting historical archive log records after each configuration execution.

[0026] The process of scheduled archiving tasks is standardized, and scheduled execution is based on daily time periods to ensure the timeliness and regularity of data archiving. By loading all historical archiving configurations and processing them according to FetchXML, data query and archiving processing can be completed efficiently, and historical archive logs can be recorded to facilitate subsequent audits and troubleshooting.

[0027] Further: optimizing the query function for the execution process of the archiving task; wherein the method for optimizing the query function includes: for the data query function, based on the purpose of improving the query flexibility and efficiency, adjusting FetchXML to support the specified query of historical data or all data;

[0028] Among them, adjusting the FetchXML method includes: adding the attribute scope to the entity node of FetchXML to support three types: active, history, and all. Active, history, and all refer to the current data table, the historical data table, and the parent data table respectively, and active is used by default; querying different data tables according to the configuration of scope, that is, the original FetchXML only queries the current data table without adjustment.

[0029] The query function during the execution of archiving tasks has been optimized to improve the flexibility and efficiency of queries. By adjusting FetchXML to support the specified query of historical data or all data, developers and users can more easily obtain the required data and meet diverse data query needs.

[0030] Further: FetchXML is an intermediate language for database query based on XML statements, and the data conditions that need to be archived are configured in the form of FetchXML.

[0031] FetchXML is explained to clarify its role as a database query middle-layer language and its form in archiving condition configuration, which helps developers understand how to use FetchXML to accurately configure the data conditions that need to be archived and improve the accuracy of data archiving.

[0032] A device for implementing a method for archiving historical data: comprising:

[0033] The data archiving function activation module is used to enable the data archiving function for data tables with large data volumes, and automatically create parent data tables and historical data tables. The INHERIT function of PGSQL is used to integrate the historical table and the current data table from the parent entity table.

[0034] The historical data archiving condition configuration module is used to configure the archiving conditions of the data table with the data archiving function enabled. The configuration includes the configuration name, table name, archiving type, and the data conditions that need to be archived configured in the form of FetchXML;

[0035] Scheduled archiving execution module is used to execute archiving tasks on a scheduled basis every day, load all historical archiving configurations, and perform data queries according to the configured FetchXML. Depending on the archiving type, it is selected to delete the queried data or delete the queried data from the current data table and then insert it into the historical data table. After each configuration execution is completed, the historical archive log record is inserted;

[0036] The FetchXML query adjustment module is used to adjust FetchXML to support querying historical data or all data. By adding the attribute scope to the entity node of FetchXML, it supports three types: active, history, and all, which represent the current data table, historical data table, and parent data table respectively. Active is used for query by default.

[0037] A computer-readable storage medium stores program instructions therein, and the program instructions are used to implement the above method when executed by a processor.

[0038] The present invention solves the defects existing in the background technology and has the following beneficial effects:

[0039] 1. The implementation method of historical data archiving enables users to quickly find and access the required historical data after data archiving

[0040] 2. The implementation method of historical data archiving can improve the query speed of existing data, improve the work efficiency of employees and reduce time waste

[0041] 3. The implementation method of historical data archiving is to configure the scheduled cleaning of log data to free up a lot of storage space

[0042] 4. The implementation method of historical data archiving adopts the method of not splitting the database, which reduces the migration of related data and avoids the situation where related data is out of sync

[0043] 5. The implementation method of historical data archiving has the comprehensive functions of reducing the amount of data in the table, improving query performance, supporting flexible condition configuration, reducing the storage space occupied by the table, avoiding the migration of related data, querying the archived historical data, querying the total archived and unarchived data, and regularly deleting useless data through configuration. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0045] Figure 1 A flow chart for data archiving of the present invention;

[0046] Figure 2 A flowchart of data query of the present invention;

[0047] Figure 3 It is a device diagram of the present invention; DETAILED DESCRIPTION

[0048] The present invention will now be further described in detail with reference to the accompanying drawings and embodiments. These drawings are simplified schematic diagrams that only illustrate the basic structure of the present invention in a schematic manner, and therefore only show the components related to the present invention.

[0049] Application Overview:

[0050] During the use of the system, as time goes by, the amount of data in each table of the system gradually increases. When the amount of data in the database table becomes extremely large, a series of problems will arise. First, the response time for query operations on large data tables will increase significantly, and the speed will become slower and slower. Secondly, in daily work and report statistics, since we often only need to pay attention to recent data or data under specific conditions, we need to set time or other filtering conditions for reports and daily queries. Furthermore, when adding more indexes to optimize database queries to improve query speed, the database will occupy more storage space. In addition, if historical data is migrated to other databases for storage, the associated data will not be displayed normally and need to be migrated together. For example, the customer table and the order table, after migrating the orders two years ago, querying all customer documents will involve multi-database associated queries. At the same time, data archiving is usually stored in the time interval dimension, which makes it difficult to archive certain specific conditions, such as archiving special data. In addition, for data in log tables that are older, it is necessary to consider how to clean them up regularly.

[0051] There are usually two solutions to these problems. First, create indexes for commonly used query conditions and sorting fields to improve query speed. However, when inserting, updating, and deleting data tables, indexes need to be dynamically maintained to ensure their correctness and effectiveness, which will increase the execution time of these operations. In addition, indexes occupy a certain amount of physical storage space. As the amount of data increases, the space occupied by indexes also increases accordingly, thereby increasing the overall storage requirements of the database. Second, divide the large table into multiple small tables (partitions) according to a certain field (such as date, region, etc.), and only access the relevant partitions each time the query is made, reducing the amount of data scanned. However, if the query condition does not involve the partition key, or the partition key is not selected properly, the query may need to scan multiple partitions, thereby reducing query performance.

[0052] The technical solution of this application brings about many beneficial effects and effectively solves a series of problems mentioned in the application overview.

[0053] First, after data is archived, users can quickly find and access the required historical data. By using the INHERIT function of PGSQL, parent data tables and historical data tables are created, and the historical tables and current data tables are integrated from the parent entity table, data archiving configuration and management are performed at the same time, including setting archiving conditions (such as archiving type, FetchXML, etc.) and executing archiving tasks at a scheduled time. When the amount of data in the system table increases, historical data is no longer mixed in the massive current data, but is stored in the historical data table in an orderly manner. Users can locate and obtain it more quickly when querying, which greatly improves the access efficiency of historical data and solves the problem of difficult to find and access historical data.

[0054] Secondly, the query speed of existing data has been significantly improved, thereby improving employee work efficiency and reducing time waste. When creating tables and configuring archiving conditions, the data is classified and sorted, and the historical data archiving conditions are configured according to needs. In addition, the query function during the execution of the archiving task is optimized by adding the attribute scope to the entity node of FetchXML to support three types of active (current data table), history (historical data table), and all (parent data table), and active is used for query by default. In this way, in daily work and report statistics, employees can more accurately locate the table where the required data is located, reduce unnecessary data scanning, speed up the query speed, save a lot of time, and effectively improve employee work efficiency.

[0055] Furthermore, configuring scheduled cleanup of log data can free up a lot of storage space. After completing the configuration of archiving conditions, the system uses a scheduled execution mechanism to execute archiving tasks on a daily basis based on the daily time period. During the execution process, not only the data is queried and archived (including deletion, migration, and other operations), but also historical archive log records are inserted. For the large amount of data accumulated over time in the log table, scheduled cleanup can release storage space in a timely manner to avoid affecting system operation due to insufficient storage space. At the same time, it can ensure that historical log data can be queried from the relevant historical data table or archive log records when needed, achieving a balance between efficient use of storage space and data management.

[0056] Finally, data archiving adopts a method of not splitting the database, which reduces the migration of related data and avoids the situation where related data is out of sync. This application creates a parent data table and a historical data table inside the database, and uses table inheritance and other functions to implement archiving management. For data with the archiving type of migration, it is processed in the database transaction, and the data is deleted from the current data table and inserted into the historical data table, rather than migrating to other databases. When the amount of data in the database table increases and needs to be processed, this method avoids the problems of related data not being able to be displayed normally and related queries being complicated due to migrating historical data to other databases, reduces the workload and complexity of related data migration, ensures the relevance and integrity of the data, makes data query and use more accurate and reliable, and prevents data errors and inconsistencies caused by the asynchrony of related data.

[0057] Exemplary methods:

[0058] like Figure 1 The figure shows a flow chart of a method for realizing historical data archiving in the present invention.

[0059] The method specifically comprises the following steps:

[0060] A method for implementing historical data archiving includes:

[0061] System architecture and table creation;

[0062] After the table is created, configure the archiving conditions;

[0063] When the archiving conditions are configured, the archiving task is executed regularly;

[0064] Optimize the query function for the execution process of archiving tasks;

[0065] The system architecture and table creation method include: for data tables with large data volumes, the system uses the INHERIT function of PGSQL based on the opening of the data archiving function to create a parent data table and a historical data table; the historical table and the current data table are integrated from the parent entity table;

[0066] Among them, INHERIT is table inheritance;

[0067] like Figure 1 As shown, when the table is created, the archiving conditions are configured; wherein the method for configuring the archiving conditions includes: for the data table with the data archiving function enabled, the system uses the configuration function based on the data archiving requirements to configure the historical data archiving conditions for the data table with the data archiving function enabled;

[0068] The configuration content includes configuration name, table name, archive type, and FetchXML.

[0069] The archiving types in the configuration content include: delete, migrate;

[0070] The system's processing after determining the archive type includes:

[0071] When the archive type is Delete, the system directly deletes the queried data;

[0072] When the archiving type is migration, the system opens a database transaction, deletes the queried data from the current data table, and then inserts it into the historical data table.

[0073] When the archiving conditions are configured, the archiving task is executed on a scheduled basis. The process of executing the archiving task on a scheduled basis includes:

[0074] Based on the daily time cycle; the system uses the scheduled execution mechanism to execute the archiving task on a daily basis;

[0075] The method for the system to perform archiving tasks regularly every day includes: loading all historical archiving configurations, and performing data query and archiving processing according to the configured FetchXML;

[0076] The archiving processing method includes: deleting and migrating data, and inserting historical archive log records after each configuration execution.

[0077] like Figure 2 As shown, the query function is optimized for the execution process of the archiving task; wherein the method for optimizing the query function includes: for the data query function, based on the purpose of improving the query flexibility and efficiency, the FetchXML is adjusted to support the specified query of historical data or all data;

[0078] Among them, adjusting the FetchXML method includes: adding the attribute scope to the entity node of FetchXML to support three types: active, history, and all. Active, history, and all refer to the current data table, the historical data table, and the parent data table respectively, and active is used by default; querying different data tables according to the configuration of scope, that is, the original FetchXML only queries the current data table without adjustment.

[0079] FetchXML is a middle-tier language for database query based on XML statements. The data conditions that need to be archived are configured in the form of FetchXML.

[0080] like Figure 3 As shown, a device for implementing a method for archiving historical data includes:

[0081] The data archiving function activation module is used to enable the data archiving function for data tables with large data volumes, and automatically create parent data tables and historical data tables. The INHERIT function of PGSQL is used to integrate the historical table and the current data table from the parent entity table.

[0082] The historical data archiving condition configuration module is used to configure the archiving conditions of the data table with the data archiving function enabled. The configuration includes the configuration name, table name, archiving type, and the data conditions that need to be archived configured in the form of FetchXML;

[0083] Scheduled archiving execution module is used to execute archiving tasks on a scheduled basis every day, load all historical archiving configurations, and perform data queries according to the configured FetchXML. Depending on the archiving type, it is selected to delete the queried data or delete the queried data from the current data table and then insert it into the historical data table. After each configuration execution is completed, the historical archive log record is inserted;

[0084] The FetchXML query adjustment module is used to adjust FetchXML to support querying historical data or all data. By adding the attribute scope to the entity node of FetchXML, it supports three types: active, history, and all, which represent the current data table, historical data table, and parent data table respectively. Active is used for query by default.

[0085] A computer-readable storage medium stores program instructions therein, and the program instructions are used to implement the above method when executed by a processor.

[0086] A computer-readable storage medium stores program instructions therein: the program instructions are executed by a processor to implement a method for archiving historical data.

[0087] In addition to the above-mentioned methods and devices, an embodiment of the present application may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of a method for implementing historical data archiving according to various embodiments of the present application described in the above method section of this specification.

[0088] The computer program product may be written in any combination of one or more programming languages ​​to write program codes for performing the operations of the embodiments of the present application, including object-oriented programming languages ​​such as Java, C++, etc., and conventional procedural programming languages ​​such as "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0089] In addition, an embodiment of the present application may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of viewing PDF reference documents in the intelligent knowledge base according to various embodiments of the present application described in the above method section of this specification.

[0090] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0091] The working principle of the present invention is:

[0092] S1. Enable the data archiving function for data tables with large data volumes. After enabling it, we will automatically create two tables, a parent data table and a historical data table, and use the INHERIT (table inheritance) function of PGSQL to integrate both the historical table and the current data table from the parent entity table.

[0093] S2. For the data table with data archiving function enabled, configure the historical data archiving conditions. The configuration itself includes [Configuration Name], [Table Name], [Archiving Type] (delete or archive), [FetchXML] (FetchXML: a middle-layer language for database query based on XML statements). The data conditions that need to be archived are configured in the form of FetchXML.

[0094] S3. The system executes the archiving task regularly every day. The task will load all historical archiving configurations and process them in a loop. It will query data according to the configured FetchXML. If the archiving type = delete, the found data will be deleted directly. If the archiving type = migrate, the database transaction will be opened to delete the found data from the current data table and then insert it into the historical data table. After each configuration is executed, a historical archive log is inserted to record the migration start time, end time, and amount of migrated data.

[0095] S4. Adjust FetchXML to support querying historical data or all data. Add the attribute [scope] to the entity node of FetchXML to support three types: active, history, and all, which respectively represent: current data table, historical data table, and parent data table. Active is used by default, and queries are performed on different data tables according to the configuration of [scope]. That is, the original FetchXML only queries the current data table without adjustment, which will greatly improve the query speed.

[0096] Application scenario examples:

[0097] Case 1: After the system has been used for 10 years, a large amount of historical data is stored in the work order table. However, the system users are more concerned about the recent work orders. Due to the large amount of work order data, each query of recent work orders takes a lot of time. At this time, we can configure a new historical data archiving rule for the work order table, archiving type = migration, configure FetchXML, and the conditions are: the work order completion time is before this year, and the work order status is closed. In this case, the data that meets the above conditions will be migrated to the work order history table on a daily basis, and the speed of querying recent functions will be greatly improved.

[0098] Case 2: Clean up job execution logs. A large number of jobs are executed every day, and the log data continues to increase. For this type of data, you can configure the archive type = delete, and the FetchXML condition is: the execution time is older than one month. Then the job execution logs older than one month will be cleaned up regularly every day.

[0099] In the description of the present invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present invention, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0100] In the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example.

[0101] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may alter, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A method for implementing historical data archiving, characterized in that: include: System architecture and table creation; After the table is created, configure the archiving conditions; When the archiving conditions are configured, the archiving task is executed regularly; Optimize the query function for the execution process of archiving tasks.

2. The method for realizing historical data archiving according to claim 1, characterized in that: The system architecture and table creation method include: for data tables with large data volume, the system creates a parent data table and a historical data table based on the activation of the data archiving function and using the INHERIT function of PGSQL; the historical table and the current data table are integrated from the parent entity table; Wherein, the INHERIT is table inheritance.

3. The method for realizing historical data archiving according to claim 1, characterized in that: When the table is created, the archiving conditions are configured; wherein the method for configuring the archiving conditions includes: for the data table with the data archiving function enabled, the system uses the configuration function to configure the historical data archiving conditions for the data table with the data archiving function enabled based on the data archiving requirements; The configuration content includes configuration name, table name, archive type, and FetchXML.

4. The method for realizing historical data archiving according to claim 3, characterized in that: The archiving types in the configuration content include: deletion and migration; The system's processing after determining the archive type includes: When the archive type is Delete, the system directly deletes the queried data; When the archiving type is migration, the system opens a database transaction, deletes the queried data from the current data table, and then inserts it into the historical data table.

5. The method for realizing historical data archiving according to claim 1, characterized in that: When the archiving conditions are configured, the archiving task is executed on a scheduled basis. The process of executing the archiving task on a scheduled basis includes: Based on the daily time cycle; the system uses the scheduled execution mechanism to execute the archiving task on a daily basis; The method for the system to perform archiving tasks regularly every day includes: loading all historical archiving configurations, and performing data query and archiving processing according to the configured FetchXML; The archiving processing method includes: deleting and migrating data, and inserting historical archive log records after each configuration execution.

6. The method for realizing historical data archiving according to claim 1, characterized in that: Optimizing the query function for the execution process of the archiving task; wherein the method for optimizing the query function includes: for the data query function, based on the purpose of improving the query flexibility and efficiency, adjusting FetchXML to support the specified query of historical data or all data; Among them, adjusting the FetchXML method includes: adding the attribute scope to the entity node of FetchXML to support three types: active, history, and all. Active, history, and all refer to the current data table, the historical data table, and the parent data table respectively, and active is used by default; querying different data tables according to the configuration of scope, that is, the original FetchXML only queries the current data table without adjustment.

7. The method for realizing historical data archiving according to claim 3, characterized in that: The FetchXML is an intermediate language for database query based on XML statements, and the data conditions that need to be archived are configured in the form of FetchXML.

8. A device for implementing a method for archiving historical data, characterized in that: Included equipment: The data archiving function activation module is used to enable the data archiving function for data tables with large data volumes, and automatically create parent data tables and historical data tables. The INHERIT function of PGSQL is used to integrate the historical table and the current data table from the parent entity table. A historical data archiving condition configuration module is used to configure the archiving conditions of a data table with the data archiving function enabled. The configuration includes a configuration name, a table name, an archiving type, and data conditions to be archived configured in the form of FetchXML; Scheduled archiving execution module is used to execute archiving tasks on a scheduled basis every day, load all historical archiving configurations, and perform data queries according to the configured FetchXML. Depending on the archiving type, it is selected to delete the queried data or delete the queried data from the current data table and then insert it into the historical data table. After each configuration execution is completed, the historical archive log record is inserted; The FetchXML query adjustment module is used to adjust FetchXML to support querying historical data or all data. By adding the attribute scope to the entity node of FetchXML, it supports three types: active, history, and all, which represent the current data table, historical data table, and parent data table respectively. Active is used for query by default.

9. A computer-readable storage medium having program instructions stored therein, characterized in that: When the program instructions are executed by a processor, the method as claimed in any one of claims 1 to 7 is implemented.