A data warehouse-based data version management method, device and medium

By generating in-use and historical data tables in the data warehouse, and using business time and version fields to perform merging, deduplication, and difference operations to identify data change types, the problem of cumbersome data change identification in the data warehouse is solved, and accurate management and traceability of data versions are achieved.

CN116107996BActive Publication Date: 2026-03-20浪潮数字粮储科技有限公司
View PDF 4 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-30
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing technologies for identifying data changes in data warehouses are cumbersome, leading to reduced data warehouse credibility and difficulty in achieving effective version management of data.

Method used

By generating in-use and historical data tables, and using the business time and version fields, the system performs merging, deduplication, and difference operations to identify data change types and update the version field of the historical data table to achieve data version management.

Benefits of technology

It simplifies the data change identification process, improves the reliability of the data warehouse, and enables accurate management and traceability of data versions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116107996B_ABST
    Figure CN116107996B_ABST
Patent Text Reader

Abstract

The application discloses a data version management method and device based on a data warehouse and a medium. The method comprises the following steps: generating an in-use data table and a historical data table corresponding to business data according to a data source table for storing the business data in the data warehouse; determining a management interval of the business data, obtaining corresponding in-use business data from the in-use data table and corresponding current business data from the data source table according to the management interval; the management interval is determined by a business time field; performing a merging and deduplication operation on the in-use business data and the current business data to obtain target business data, and adding the target business data to a preset summary data table; performing a difference operation on the in-use business data and the current business data to determine a change type corresponding to the target business data in the summary data table according to a difference result obtained; and updating a version field and the business time field of the historical data table according to the change type.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of data processing, in particular to a data version management method and device based on a data warehouse and a medium. BACKGROUND

[0002] A data warehouse can provide guidance for business process improvement, monitoring time, cost, quality and control for enterprises that need business intelligence. With the development of daily work of enterprises, part of the business data will change frequently, and the data in the data mart layer of the data warehouse will also change. With the continuous covering and updating of historical data, the production library may run out of memory, causing some data to be deleted, or the data may become difficult to read and maintain with the update of technology.

[0003] Therefore, the data queried by the same filtering condition at different times may change, thereby reducing the credibility of the user to the data warehouse. At present, the method for identifying data changes is mostly to parse the database log to obtain the data change process, or to pack the data into a specific format file for comparison, which is relatively cumbersome. SUMMARY

[0004] In order to solve the above problems, the present application provides a data version management method based on a data warehouse, comprising:

[0005] According to the data source table for storing business data in the data warehouse, the in-use data table and the historical data table corresponding to the business data are generated; the in-use data table and the historical data table include a business time field for identifying data change time, and the historical data table further includes a version field for identifying business data version;

[0006] Determine the management interval of the business data, and according to the management interval, obtain the corresponding in-use business data from the in-use data table and the corresponding current business data from the data source table; the management interval is determined by the business time field;

[0007] Perform a merge and deduplication operation on the in-use business data and the current business data to obtain target business data, and add the target business data to a preset summary data table;

[0008] Perform a difference operation on the in-use business data and the current business data to determine the change type corresponding to the target business data in the summary data table according to the obtained difference result;

[0009] According to the change type, update the version field and the business time field of the historical data table.

[0010] In an implementation form of the present application, the in-service business data and the current business data are subjected to a merge and deduplication operation to obtain target business data, and the target business data is added to a preset summary data table, specifically comprising:

[0011] The in-service business data is stored in a first temporary table, and the current business data is stored in a second temporary table;

[0012] The in-service business data in the first temporary table and the current business data in the second temporary table are subjected to a merge and deduplication operation to obtain target business data;

[0013] The target business data is synchronized to a summary data table corresponding to the first temporary table and the second temporary table, and a change type field and a data source identification field are added to the summary data table.

[0014] In an implementation form of the present application, the in-service business data and the current business data are subjected to a difference operation to determine the change type corresponding to the target business data in the summary data table according to the difference result, specifically comprising:

[0015] A first difference set and a second difference set between the first temporary table and the second temporary table are determined by a preset difference function;

[0016] From the target business data, a first target business data corresponding to the first difference set and a second target business data corresponding to the second difference set are screened out;

[0017] It is determined that the change type corresponding to the first target business data is addition, and the change type corresponding to the second target business data is deletion.

[0018] In an implementation form of the present application, after it is determined that the change type corresponding to the first target business data is data addition, and the change type corresponding to the second target business data is data deletion, the method further comprises:

[0019] From the summary data table, a third target business data with the change type field being a null value and the data source identification field being the first temporary table is obtained;

[0020] It is determined that the change type corresponding to the third target business data is modification.

[0021] In an implementation form of the present application, according to the change type, the business time field of the in-service data table and the version field and the business time field of the historical data table are updated, specifically comprising:

[0022] In a case where the change type is addition, the first target service data is added to the in-use data table, and a service time field corresponding to the first service data is updated to a current time;

[0023] In a case where the change type is deletion, second target service data is migrated from the in-use data table to the historical data table, a version field of the second target service data is updated, and a service time field corresponding to the second target service data is updated to a current time;

[0024] In a case where the change type is modification, third target service data is migrated from the in-use data table to the historical data table, a version field of the third target service data is updated, and a service time field corresponding to the third target service data is updated to a current time.

[0025] In an implementation manner of the present application, the method further comprises:

[0026] corresponding historical service data is obtained from the historical data table at different time points;

[0027] It is determined whether the historical service data corresponding to the different time points is consistent, and if not, a change type of the historical service data is determined according to a service data summarization logic of the summary data table, so as to realize data tracing.

[0028] In an implementation manner of the present application, after the in-use data table and the historical data table corresponding to the service data are generated, the method further comprises:

[0029] The service data in the data warehouse is initialized to set a version field corresponding to the service data in the historical data table to an initial value.

[0030] In an implementation manner of the present application, the first difference set is a difference set obtained by subtracting the first temporary table from the second temporary table, and the second difference set is a difference set obtained by subtracting the second temporary table from the first temporary table.

[0031] An embodiment of the present application provides a data version management device based on a data warehouse, which is characterized by comprising:

[0032] at least one processor; and

[0033] a memory in communication connection with the at least one processor; wherein

[0034] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

[0035] generating, according to a data source table for storing business data in a data warehouse, an in-use data table and a history data table corresponding to the business data; the in-use data table and the history data table include a business time field for identifying data change time, and the history data table further includes a version field for identifying business data version;

[0036] determining a management interval of the business data, obtaining corresponding in-use business data from the in-use data table and corresponding current business data from the data source table according to the management interval; the management interval is determined by the business time field;

[0037] performing a merge and deduplication operation on the in-use business data and the current business data to obtain target business data, and adding the target business data to a preset summary data table;

[0038] performing a difference operation on the in-use business data and the current business data to determine a change type corresponding to the target business data in the summary data table according to a difference result obtained;

[0039] updating the version field and the business time field of the history data table according to the change type.

[0040] The embodiment of the application provides a non-volatile computer storage medium, which stores computer executable instructions, characterized in that the computer executable instructions are configured to:

[0041] generating, according to a data source table for storing business data in a data warehouse, an in-use data table and a history data table corresponding to the business data; the in-use data table and the history data table include a business time field for identifying data change time, and the history data table further includes a version field for identifying business data version;

[0042] determining a management interval of the business data, obtaining corresponding in-use business data from the in-use data table and corresponding current business data from the data source table according to the management interval; the management interval is determined by the business time field;

[0043] performing a merge and deduplication operation on the in-use business data and the current business data to obtain target business data, and adding the target business data to a preset summary data table;

[0044] performing a difference operation on the in-use business data and the current business data to determine a change type corresponding to the target business data in the summary data table according to a difference result obtained;

[0045] According to the change type, the version field and the business time field of the historical data table are updated.

[0046] The data version management method based on the data warehouse can bring the following advantages

[0047] Advantages:

[0048] By comparing the in-use business data and the current business data in the same management interval, the changed business data and the specific change type can be identified, and then the historical data table can be updated according to the change type to realize data version management, so that each changed business data can be accurately obtained, data support is provided for tracing the data change history, and the operation is more convenient without additional format processing of the business data. BRIEF DESCRIPTION OF DRAWINGS

[0049] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of the present application and illustrate embodiments of the present application and its description, which serve to explain the present application, and do not constitute improper limitations on the present application. In the drawings:

[0050] Figure 1 A flowchart of a data version management method based on a data warehouse provided by an embodiment of the present application is shown.

[0051] Figure 2 A structural diagram of a data version management device based on a data warehouse provided by an embodiment of the present application is shown. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme of the present application will be described in detail below in combination with specific embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0053] The technical scheme provided by each embodiment of the present application will be described in detail below in combination with the drawings.

[0054] As shown in the drawings, the data version management method based on the data warehouse provided by an embodiment of the present application comprises: Figure 1

[0055] S101: According to the data source table for storing business data in the data warehouse, the in-use data table and the historical data table corresponding to the business data are generated; the in-use data table and the historical data table comprise a business time field for identifying data change time, and the historical data table further comprises a version field for identifying the version of the business data.​

[0056] In order to improve the credibility of the data warehouse, it is necessary to record each change of the business data and realize the traceability of the data.

[0057] To achieve the above object, embodiments of the present application compare two pieces of data in the data warehouse in the same time period, identify all changed data such as newly added, modified and deleted data in the time period, and manage the data by version, store all version data in the data warehouse, realize the version management of the data, and based on the version data, deduce the business scenario and change process of each data change, realize the traceability of the result data change. Based on this, by extracting the business data stored in the plurality of data source tables, the in-use data table and the historical data table corresponding to the business data can be generated. The in-use data table is used to store the current in-use business data, including a business time field used to identify the data change time, and the historical data table is used to store the historical business data, including a business time field used to identify the data change time and a version field used to identify the version of the business data. The version number corresponding to the version field is positively correlated with the number of changes.

[0058] It should be noted that after the historical data table is generated, the business data in the data warehouse needs to be initialized to set the version field of each business data in the historical data table to the initial value 0. At this time, the version field is used to indicate that all business data in the data warehouse has not been changed.

[0059] S102: Determine the management interval of the business data, and according to the management interval, obtain the corresponding in-use business data from the in-use data table and obtain the corresponding current business data from the data source table; the management interval is determined by the business time field.

[0060] The embodiment of the present application can periodically perform version management on the service data according to fixed time intervals, such as one day, one week, etc. At each time of performing version management, the management time range, i.e. the management interval, of the data is controlled through the service time field, and then the in-use service data in the management interval is obtained from the in-use data table and the current service data in the management interval is obtained from the data source table. It can be understood that the data source table is a data table for recording the latest service data, and the data in the in-use data table is obtained from the data source table, so when the service data in the data source table is changed and the data in the in-use data table is not changed in time, the service data in the same management interval obtained from the data source table at different time points will be different. In order to realize data tracing and analysis in this case, the embodiment of the present application compares and analyzes the current service data in the data source table and the in-use data in the in-use data table in the same management interval, so as to determine the change type of the data, thereby realizing version recording and change tracing of the data.

[0061] S103: performing a merge and deduplication operation on the in-use service data and the current service data to obtain target service data, and adding the target service data to a preset summary data table.

[0062] After obtaining the in-use service data and the current service data, the in-use service data is stored in a first temporary table T1, and the current service data is stored in a second temporary table T2, and then the in-use service data in T1 and the current service data in T2 are subjected to a merge and deduplication operation to obtain target service data. At this time, the target service data is synchronized to a summary data table T3 corresponding to the first temporary table and the second temporary table, and a change type field and a data source identification field are added to the summary data table T3. The change type field is used to distinguish whether the type of data change is addition, modification or deletion in the subsequent, and the data source identification field is used to distinguish the current service data and the in-use service data, so as to facilitate subsequent data version management.

[0063] S104: performing a difference operation on the in-use service data and the current service data to determine the change type corresponding to the target service data in the summary data table according to the obtained difference result.

[0064] After adding the target service data to the summary data table T3, the field value corresponding to the change type field of the target service data, i.e. the change type corresponding to each piece of target service data, needs to be further determined, so as to facilitate management of the data version according to the change type. In the embodiment of the present application, the change type can be determined through the difference result obtained by performing a difference operation on the in-use service data and the current service data.

[0065] Specifically, the first difference set and the second difference set between the first temporary table and the second temporary table are determined by a preset difference function, such as a MINUS function. The first difference set is a difference set obtained by subtracting the first temporary table from the second temporary table, and represents newly added data in the data source table at the current time; and the second difference set is a difference set obtained by subtracting the second temporary table from the first temporary table, and represents deleted data in the data source table at the current time.

[0066] Further, after obtaining the first difference set and the second difference set, the first target business data corresponding to the first difference set and the second target business data corresponding to the second difference set are filtered out from the target business data, and then the change type field corresponding to the identified first target business data and second target business data is assigned a corresponding field value, that is, the change type corresponding to the first target business data is determined to be added, and the change type corresponding to the second target business data is determined to be deleted. That is, by the difference operation, the data difference between the data source table and the in-use data table can be obtained, and further according to the type of the obtained difference set, it is determined what data in the data source table is changed compared with the in-use data table.

[0067] After the above operation is performed, the third target business data in the data summary table, whose change type field is empty and whose data source identifier field is the first temporary table, is obtained, and the change type corresponding to the third target business data is set to be modified. Thus, according to the data difference between the in-use data table and the data source table, the assignment of the change type field in the data summary table is realized, and it is determined that the data source table has made what data change compared with the in-use data table corresponding thereto.

[0068] S105: updating the version field and the business time field of the historical data table according to the change type.

[0069] After determining the change type corresponding to each target business data in the target summary table, the version field and the business time field of the historical data table can be updated according to the change type to realize data version management. Different processing methods can be used for data version management according to different change types.

[0070] First, in the case where the change type is added, it is indicated that part of the data in the current data source table has been added, and the part of the data has not been updated in the in-use data table. At this time, the added first target business data is added to the in-use data table, and the business time field corresponding to the first target business data is updated to the current time to record the change time of the business data.

[0071] Secondly, in the case that the change type is deletion, it is explained that part of the data in the current data source table has been deleted, while the part of the data is still reserved in the in-use data table. At this time, the second target business data needs to be migrated from the in-use data table to the historical data table, and the version field of the second target business data is updated, for example, the version number corresponding to the version field is increased by 0.1 or other arbitrary values greater than 0, and the business time field corresponding to the second target business data is updated to the current time. In this way, through the data migration operation, the deleted data in the data source table is also eliminated from the in-use data table, ensuring the synchronization of business data between the two, and the version number of each deleted data can be accurately recorded through the historical data table. In this way, the specific change history of the business data can be clearly determined through the version number.

[0072] Thirdly, in the case that the change type is modification, it is explained that part of the data in the data source table has been modified, while the modification content has not been synchronized to the in-use data table. At this time, the third target business data which has been modified needs to be migrated from the in-use data table to the historical data table, and the version field of the third target business data is updated, and the business time field corresponding to the third target business data is updated to the current time. The third target business data which has been migrated in the above process has become historical data. At this time, the data which has been changed in the data source table needs to be added to the in-use data table to ensure the synchronization of data between the data tables.

[0073] Through the above steps, the business data which has been changed in the data source table can be identified in time, and the business data before the change is migrated to the historical data table for recording. At the same time, according to the primary key of the business data, the version number of the historical business data corresponding to the business data is identified, and the version number is updated, realizing the version management of the business data. In this way, after the corresponding historical business data is obtained from the historical data table at different time points, it is needed to determine whether the historical business data corresponding to the different time points is consistent. If not, the change type of the historical business data is determined according to the business data summary logic in the historical data table, so as to realize data tracing. That is to say, the data difference between the in-use data table and the data source table can be determined by the embodiments of the present application, the change type of the historical business data is determined by restoring the specific business scenario, so as to realize data tracing.

[0074] The above is the method embodiment provided by the present application. Based on the same idea, some embodiments of the present application also provide a device corresponding to the above method.

[0075] Figure 2 A structure schematic diagram of a data version management device based on a data warehouse provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, it comprises: Figure 2

[0076] at least one processor; and​

[0077] a memory in communication connection with the at least one processor; wherein

[0078] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:

[0079] According to the data source table for storing business data in the data warehouse, the in-use data table and the historical data table corresponding to the business data are generated; the in-use data table and the historical data table include a business time field for identifying data change time, and the historical data table further includes a version field for identifying a business data version;

[0080] A management interval of the business data is determined, and corresponding in-use business data is obtained from the in-use data table and corresponding current business data is obtained from the data source table according to the management interval; the management interval is determined by the business time field;

[0081] The in-use business data and the current business data are subjected to a merge and deduplication operation to obtain target business data, and the target business data is added to a preset summary data table;

[0082] The in-use business data and the current business data are subjected to a difference operation, so as to determine a change type corresponding to the target business data in the summary data table according to a difference result obtained;

[0083] According to the change type, the version field and the business time field of the historical data table are updated.

[0084] The embodiment of the application provides a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are set to:

[0085] According to the data source table for storing business data in the data warehouse, the in-use data table and the historical data table corresponding to the business data are generated; the in-use data table and the historical data table include a business time field for identifying data change time, and the historical data table further includes a version field for identifying a business data version;

[0086] A management interval of the business data is determined, and corresponding in-use business data is obtained from the in-use data table and corresponding current business data is obtained from the data source table according to the management interval; the management interval is determined by the business time field;

[0087] The in-use business data and the current business data are subjected to a merge and deduplication operation to obtain target business data, and the target business data is added to a preset summary data table;

[0088] The difference operation is performed on the in-use service data and the current service data to determine the change type corresponding to the target service data in the summary data table according to a difference result obtained;

[0089] According to the change type, the version field and the service time field of the historical data table are updated.

[0090] Each of the embodiments in the present application is described in a progressive manner, and the same and similar parts of each of the embodiments can be referred to each other. Each of the embodiments mainly explains the difference from other embodiments. In particular, for the device and medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the related parts can be referred to the part of the method embodiments.

[0091] The device and medium provided by the embodiments of the present application are one-to-one corresponding to the method, and therefore, the device and medium also have the similar beneficial technical effects as the method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the device and medium will not be described here.

[0092] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can adopt a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer usable program codes.

[0093] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks can be implemented by computer program instructions. 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 devices to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a means for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The function of the means specified in one flow or multiple flows and / or blocks. Figure 1 The function of the means specified in one flow or multiple flows and / or blocks.

[0094] These computer program instructions can also be stored in a computer readable storage medium capable of guiding the computer or other programmable data processing devices to work in a specific manner, so that the instructions stored in the computer readable storage medium produce a product including instruction means, which implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The function of the means specified in one flow or multiple flows and / or blocks.Figure 1 the function(s) specified in the block or blocks.

[0095] These computer program instructions can also be loaded into computer or other programmable data processing devices to cause a series of operational steps to be performed on the computer or other programmable devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable devices provide steps for implementing the flowchart block(s) or block(s) in the flowchart. Figure 1 the flowchart block(s) or block(s) and / or Figure 1 the function(s) specified in the block or blocks.

[0096] In one typical configuration, the computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.

[0097] The memory can include non-persistent memory and / or volatile memory, such as random access memory (RAM) about which the computer stores information about an operating system, application software, and / or the like. Memory is an example of computer readable media.

[0098] Computer readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible by a computing device. According to the definition herein, computer readable media does not include transitory media, such as modulated data signals and carrier waves.

[0099] It should also be noted that the terms "comprising", "including", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article or apparatus that comprises a list of elements does not include only those elements recited, but can also include other elements not expressly listed or inherent to such process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.

[0100] The above merely provides an example of the present application, but is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the scope of claims of the present application.

Claims

1. A data version management method based on a data warehouse, characterized in that, The method includes: Based on the data source table in the data warehouse used to store business data, generate a data table in use and a historical data table corresponding to the business data; the data table in use and the historical data table include a business time field for identifying the time of data change, and the historical data table also includes a version field for identifying the version of the business data. The management range of the business data is determined, and based on the management range, the corresponding in-use business data is obtained from the in-use data table, and the corresponding current business data is obtained from the data source table; the management range is determined by the business time field. The in-use business data and the current business data are merged and deduplicated to obtain the target business data, and the target business data is added to a preset summary data table; The difference between the in-use business data and the current business data is calculated to determine the change type corresponding to the target business data in the summary data table based on the difference result. Based on the change type, update the version field and business time field of the historical data table; The in-use business data and the current business data are merged and deduplicated to obtain target business data, which is then added to a preset summary data table. Specifically, this includes: The in-use business data is stored in a first temporary table, and the current business data is stored in a second temporary table; The in-use business data in the first temporary table and the current business data in the second temporary table are merged and deduplicated to obtain the target business data; The target business data is synchronized to the summary data table corresponding to the first temporary table and the second temporary table, and a change type field and a data source identifier field are added to the summary data table; The difference between the in-use business data and the current business data is calculated to determine the change type corresponding to the target business data in the summary data table based on the difference result. Specifically, this includes: The first difference set and the second difference set between the first temporary table and the second temporary table are determined by a preset difference function. From the target business data, filter out the first target business data corresponding to the first difference set and the second target business data corresponding to the second difference set; The change type corresponding to the first target business data is determined to be "addition", and the change type corresponding to the second target business data is determined to be "deletion". After determining that the change type corresponding to the first target business data is data addition and the change type corresponding to the second target business data is data deletion, the method further includes: Obtain the third target business data from the summary data table where the change type field is empty and the data source identifier field is the first temporary table; The change type corresponding to the third target business data is determined to be "modification".

2. The data version management method based on a data warehouse according to claim 1, characterized in that, Based on the change type, the business time field of the currently used data table, as well as the version field and business time field of the historical data table, are updated, specifically including: When the change type is "new", the first target business data is added to the in-use data table, and the business time field corresponding to the first target business data is updated to the current time. In the case of the change type being deletion, the second target business data is migrated from the in-use data table to the historical data table, the version field of the second target business data is updated, and the business time field corresponding to the second target business data is updated to the current time. When the change type is modification, the third target business data is migrated from the in-use data table to the historical data table, the version field of the third target business data is updated, and the business time field corresponding to the third target business data is updated to the current time.

3. The data version management method based on a data warehouse according to claim 1, characterized in that, The method further includes: At different points in time, the corresponding historical business data is obtained from the historical data table; Determine whether the historical business data corresponding to the different time points are consistent. If not, determine the change type of the historical business data according to the business data aggregation logic of the summary data table to achieve data traceability.

4. The data version management method based on a data warehouse according to claim 1, characterized in that, After generating the in-use data table and historical data table corresponding to the business data, the method further includes: The business data in the data warehouse is initialized so that the version field corresponding to the business data in the historical data table is set to the initial value.

5. The data version management method based on a data warehouse according to claim 1, characterized in that, The first difference set is the difference set obtained by subtracting the first temporary table from the second temporary table, and the second difference set is the difference set obtained by subtracting the second temporary table from the first temporary table.

6. A data version management device based on a data warehouse, characterized in that, include: At least one processor; as well as, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to: Based on the data source table in the data warehouse used to store business data, generate a data table in use and a historical data table corresponding to the business data; the data table in use and the historical data table include a business time field for identifying the time of data change, and the historical data table also includes a version field for identifying the version of the business data. The management range of the business data is determined, and based on the management range, the corresponding in-use business data is obtained from the in-use data table, and the corresponding current business data is obtained from the data source table; the management range is determined by the business time field. The in-use business data and the current business data are merged and deduplicated to obtain the target business data, and the target business data is added to a preset summary data table; The difference between the in-use business data and the current business data is calculated to determine the change type corresponding to the target business data in the summary data table based on the difference result. Based on the change type, update the version field and business time field of the historical data table; The in-use business data and the current business data are merged and deduplicated to obtain target business data, which is then added to a preset summary data table. Specifically, this includes: The in-use business data is stored in a first temporary table, and the current business data is stored in a second temporary table; The in-use business data in the first temporary table and the current business data in the second temporary table are merged and deduplicated to obtain the target business data; The target business data is synchronized to the summary data table corresponding to the first temporary table and the second temporary table, and a change type field and a data source identifier field are added to the summary data table; The difference between the in-use business data and the current business data is calculated to determine the change type corresponding to the target business data in the summary data table based on the difference result. Specifically, this includes: The first difference set and the second difference set between the first temporary table and the second temporary table are determined by a preset difference function. From the target business data, filter out the first target business data corresponding to the first difference set and the second target business data corresponding to the second difference set; The change type corresponding to the first target business data is determined to be "addition", and the change type corresponding to the second target business data is determined to be "deletion". After determining that the change type corresponding to the first target business data is data addition and the change type corresponding to the second target business data is data deletion, the process further includes: Obtain the third target business data from the summary data table where the change type field is empty and the data source identifier field is the first temporary table; The change type corresponding to the third target business data is determined to be "modification".

7. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are set as follows: Based on the data source table in the data warehouse used to store business data, generate a data table in use and a historical data table corresponding to the business data; the data table in use and the historical data table include a business time field for identifying the time of data change, and the historical data table also includes a version field for identifying the version of the business data. The management range of the business data is determined, and based on the management range, the corresponding in-use business data is obtained from the in-use data table, and the corresponding current business data is obtained from the data source table; the management range is determined by the business time field. The in-use business data and the current business data are merged and deduplicated to obtain the target business data, and the target business data is added to a preset summary data table; The difference between the in-use business data and the current business data is calculated to determine the change type corresponding to the target business data in the summary data table based on the difference result. Based on the change type, update the version field and business time field of the historical data table; The in-use business data and the current business data are merged and deduplicated to obtain target business data, which is then added to a preset summary data table. Specifically, this includes: The in-use business data is stored in a first temporary table, and the current business data is stored in a second temporary table; The in-use business data in the first temporary table and the current business data in the second temporary table are merged and deduplicated to obtain the target business data; The target business data is synchronized to the summary data table corresponding to the first temporary table and the second temporary table, and a change type field and a data source identifier field are added to the summary data table; The difference between the in-use business data and the current business data is calculated to determine the change type corresponding to the target business data in the summary data table based on the difference result. Specifically, this includes: The first difference set and the second difference set between the first temporary table and the second temporary table are determined by a preset difference function. From the target business data, filter out the first target business data corresponding to the first difference set and the second target business data corresponding to the second difference set; The change type corresponding to the first target business data is determined to be "addition", and the change type corresponding to the second target business data is determined to be "deletion". After determining that the change type corresponding to the first target business data is data addition and the change type corresponding to the second target business data is data deletion, the process further includes: Obtain the third target business data from the summary data table where the change type field is empty and the data source identifier field is the first temporary table; The change type corresponding to the third target business data is determined to be "modification".

Citation Information

Patent Citations

  • Data edition control method and data edition controller

    CN107665227A

  • Data synchronization method and device based on update time and primary key and medium

    CN114741401A

  • Method, device and equipment for recording and querying bank data change history

    CN115129733A

  • System and method for database versioning

    US7251669B1