Accounting data recovery method and related device
Through the automated accounting data recovery method, the data extraction scope and timing relationship are determined, and the error problems caused by complex operations in the existing technology are solved, achieving efficient and accurate data recovery.
Patent Information
- Application Number
- CN202510668900.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-08-15
AI Technical Summary
In the prior art, the operation of accounting data recovery is complex, which can easily lead to errors, affecting data accuracy and efficiency, and requires professional personnel to handle it in the company's computer room, which ordinary personnel cannot operate.
By determining the data extraction range of source accounting data, obtaining the target data collection, and loading it to the source layer of the data warehouse, the date field is automatically modified according to the date field and timing relationship of the sub-data to restore to the detailed layer, achieving efficient data recovery without manual intervention.
It improves the efficiency of accounting data recovery, ensures the maintenance of data accuracy and timing relationships, reduces manual operation errors, and simplifies operational processes.
Smart Images

Figure CN120492229A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of financial technology, and in particular to an account data recovery method and related devices. Background Art
[0002] Data warehouses are core infrastructure for analytical data processing. In the field of financial technology, data warehouses can be used to store and maintain accounting data generated by upstream accounting systems.
[0003] In related technologies, when accounting data in the upstream accounting system changes, the corresponding accounting data in the data warehouse needs to be recovered. Specifically, it is necessary to manually modify the configuration of the production environment extraction tool to re-extract the sub-data of the corresponding table to the source layer of the data warehouse, and then manually modify the corresponding accounting data in the detail layer to maintain the data warehouse.
[0004] However, improper operation of this method can easily lead to errors, affecting the accuracy of the next day's batch run and historical data. In addition, the operation is complex and requires professional operation and maintenance personnel to handle it in the company's computer room. Ordinary on-duty personnel cannot handle it, and the efficiency is low. Summary of the Invention
[0005] In response to the above problems, the present application provides an accounting data recovery method and related devices to improve the efficiency of accounting data recovery.
[0006] Based on this, this application discloses the following technical solutions:
[0007] In a first aspect, an embodiment of the present application provides a method for recovering account data, the method comprising:
[0008] Determine the data extraction scope of source accounting data, where the source accounting data comes from an upstream accounting system and includes multiple sub-data;
[0009] Acquire a target data set from the source account data according to the data extraction scope;
[0010] Loading the target data set into the source layer of the data warehouse;
[0011] According to the date field of each sub-data in the target data set, the target data set is restored to the corresponding partition of the source layer, and the historical data corresponding to the data extraction range in the detail layer of the data warehouse is deleted;
[0012] According to the temporal relationship between the sub-data of each partition in the source layer, the date field of the sub-data is modified, and the modified sub-data of each partition is restored to the detail layer of the data warehouse.
[0013] Optionally, the date field of the sub-data includes a start time and an end time, and the sub-data of each partition in the source layer includes first sub-data and second sub-data having an associated relationship. Modifying the date field of the sub-data according to the temporal relationship between the sub-data of each partition in the source layer includes:
[0014] If the second sub-data changes at the target time and the end time of the first sub-data exceeds the target time, the start time of the second sub-data is modified to the target time, and the end time of the first sub-data is modified to the day before the target time.
[0015] Optionally, each business entity has a version chain, which is used to store historical versions and effective time intervals of sub-data corresponding to the business entity. The effective time interval includes an effective start time, an effective end time, and an effective flag. Modifying the date field of the sub-data according to the temporal relationship between the sub-data of each partition in the source layer includes:
[0016] If the sub-data of each partition in the source layer includes sub-data that has changed in the target business entity, the original version chain of the target business entity is updated according to the temporal relationship between the sub-data of each partition in the source layer to obtain an updated version chain, with the validity flag of the original version chain being ineffective and the validity flag of the updated version chain being effective;
[0017] The date field of the sub-data is modified according to the effective time interval of the update version chain.
[0018] Optionally, the upstream accounting system has a view created for sub-data with the same table structure, and the view is used to query the sub-data corresponding to the target date field.
[0019] Optionally, the method further includes:
[0020] In response to the data warehouse being in an abnormal state, the abnormal state includes a change in the amount of sub-data of the data warehouse or a change in the operation time of the sub-data of the data warehouse, a prompt message is sent to the maintenance personnel of the data warehouse to enable the maintenance personnel to perform data recovery.
[0021] Optionally, the method further includes:
[0022] In response to receiving an instruction to perform data recovery, sequentially executing a first scheduling instance, a second scheduling instance, and a third scheduling instance in the set of scheduling instances;
[0023] The first scheduling instance is used to determine the data extraction range according to the target state of the source accounting data, wherein the source accounting data comes from the upstream accounting system and includes multiple sub-data;
[0024] Acquire a target data set from the source account data according to the data extraction scope;
[0025] The second scheduling instance is used to execute the loading of the target data set into the source layer of the data warehouse;
[0026] The third scheduling instance is used to execute the step of restoring the target data set to the corresponding partition of the source layer according to the date field of each sub-data in the target data set and subsequent steps.
[0027] Optionally, acquiring a target data set from the source account data according to the data extraction range includes:
[0028] According to the data extraction scope, a target data set in the source account data is obtained, and the target data set is converted into a target text format.
[0029] In a second aspect, an embodiment of the present application provides an account data recovery device, the device comprising:
[0030] a determination unit, configured to determine a data extraction range of source accounting data, the source accounting data being from an upstream accounting system and including a plurality of sub-data;
[0031] An extraction unit, configured to obtain a target data set from the source account data according to the data extraction range;
[0032] A loading unit, configured to load the target data set into a source layer of a data warehouse;
[0033] a restoration unit, configured to restore the target data set to a corresponding partition of the source layer according to a date field of each sub-data in the target data set, and delete historical data corresponding to the data extraction range in the detail layer of the data warehouse;
[0034] The modification unit is used to modify the date field of the sub-data according to the temporal relationship between the sub-data of each partition in the source layer, and restore the modified sub-data of each partition to the detail layer of the data warehouse.
[0035] In a third aspect, an embodiment of the present application provides a computer device, the computer device including a processor and a memory:
[0036] The memory is used to store a computer program and transmit the computer program to the processor;
[0037] The processor is configured to execute the method described in the first aspect above according to the computer program.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method described in the first aspect above.
[0039] In a fifth aspect, an embodiment of the present application provides a computer program product comprising a computer program, which, when executed on a computer device, enables the computer device to execute the method described in the first aspect above.
[0040] It can be seen from the above technical solutions that this application has at least the following beneficial effects:
[0041] Determine the data extraction scope of the source accounting data, which comes from the upstream accounting system and includes multiple sub-data. Based on the data extraction scope, obtain the target data set in the source accounting data. Load the target data set into the source layer of the data warehouse. Based on the date field of each sub-data in the target data set, restore the target data set to the corresponding partition of the source layer, and delete the historical data corresponding to the data extraction scope in the detail layer of the data warehouse. Based on the temporal relationship between the sub-data in each partition of the source layer, modify the date field of the sub-data, and restore the modified sub-data of each partition to the detail layer of the data warehouse. In this way, when the source accounting data changes, it is possible to extract the sub-data in the upstream accounting system whose temporal relationship may have changed, and modify the date field of the corresponding sub-data in the source layer based on the temporal relationship, so that the sub-data can continue to maintain an accurate temporal relationship. There is no need to manually modify the extraction configuration or manually modify each accounting data table, thereby improving the efficiency of accounting data recovery. While replacing historical data, the temporal relationship between each sub-data is also maintained, ensuring that the sub-data maintained by the data warehouse is more accurate in terms of temporal sequence, and improving the accuracy of data in the data warehouse while efficiently restoring data. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only some embodiments recorded in this application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0043] Figure 1 A flowchart of an accounting data recovery method provided in an embodiment of the present application;
[0044] Figure 2 A flowchart illustrating steps for implementing an accounting data function provided in an embodiment of the present application;
[0045] Figure 3A schematic diagram of an application scenario of an accounting data recovery method provided in an embodiment of the present application;
[0046] Figure 4 A schematic diagram of the structure of an accounting data recovery device provided in an embodiment of the present application;
[0047] Figure 5 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are for illustrative purposes only and are not intended to limit the scope of protection of the present application.
[0049] As can be seen from the above, when accounting data in the upstream accounting system changes, it is necessary to manually modify the configuration of the production environment's extraction tool to re-extract the sub-data of the corresponding table to the source layer of the data warehouse, and then manually modify the corresponding accounting data in the detail layer to maintain the data warehouse. Improper operation can easily lead to errors, especially when there may be a time series relationship between different sub-data. For example, the multiple sub-data corresponding to a contract correspond to a continuous period of contract validity. In other words, the multiple sub-data corresponding to the contract jointly maintain a time series relationship. When one of the sub-data changes, the time series relationship needs to be reconstructed. In the process of restoring the time series relationship of accounting data, manual recovery is inefficient and accuracy is difficult to guarantee.
[0050] Based on this, the embodiment of the present application provides an accounting data recovery method and related devices. When the source accounting data changes, it is possible to extract sub-data in the upstream accounting system whose time series relationship may have changed, and modify the date field of the corresponding sub-data in the source layer according to the time series relationship, so that the sub-data continue to maintain an accurate time series relationship. There is no need to manually modify the extraction configuration or manually modify each accounting data table, thereby improving the efficiency of accounting data recovery. While replacing the historical data, the time series relationship between each sub-data is also maintained, ensuring that the sub-data maintained by the data warehouse is more accurate in time series, and improving the accuracy of the data in the data warehouse while efficiently recovering the data.
[0051] The accounting data recovery method provided in this application can be applied to computer devices capable of processing accounting data, such as terminal devices and servers. Specifically, terminal devices may include desktop computers, laptops, mobile phones, and tablet computers; servers may be independent physical servers, server clusters composed of multiple physical servers, or distributed systems. Terminal devices and servers may be connected directly or indirectly via wired or wireless communication, and this application does not impose any limitations thereon.
[0052] See also Figure 1 , which is a flow chart of the method for recovering account data provided by the embodiment of the present application. For the sake of convenience, the following embodiment is introduced by taking the execution subject of the method for recovering account data as the server as an example. Figure 1 As shown, the accounting data recovery method includes S101-S105.
[0053] S101: Determine the data extraction scope of source accounting data.
[0054] Source accounting data is a collection of original financial data generated in business activities. The source accounting data comes from the upstream accounting system. In the embodiment of the present application, the data warehouse is used to store and maintain the source accounting data generated by the upstream accounting system.
[0055] The source account data includes multiple sub-data, wherein each sub-data has a date field, and the date field is used to identify the time point or time range corresponding to the sub-data.
[0056] The data extraction range is the time range corresponding to the sub-data from which data is extracted from the source account data. This data extraction range can be used to identify sub-data whose temporal relationships may change when a data change operation occurs on the source account data.
[0057] For example, if a sub-data on 2025-03-05 changes, 2025-03-05 can be used as the data extraction range, or 2025-03-05 to the day the account data is restored can be used as the data extraction range; when new data is added to the source account data, the time range corresponding to the new data can be used as the data extraction range. This embodiment of the application does not limit this.
[0058] In a possible implementation, the upstream accounting system has a view created for sub-data with the same table structure, and the view is used to query the sub-data corresponding to the target date field.
[0059] This view is a virtual table based on the underlying physical table. It is generated using predefined query logic (such as filter conditions and field mappings). It does not store actual data but supports dynamic queries. The corresponding sub-data must have the same table structure to ensure view definition compatibility.
[0060] As a result, the view can be used to more quickly filter the source accounting data from the upstream accounting system to obtain sub-data of the corresponding date or corresponding date range, thereby improving the efficiency of data extraction.
[0061] S102: Acquire a target data set from the source accounting data according to the data extraction scope.
[0062] The target data set is the data extracted from the source accounting data. The target data set includes multiple sub-data items, and the data range corresponding to each sub-data item in the target data set matches the data extraction range. For example, you can use Informactica (a data warehouse tool) to determine the filter range of the source accounting data based on the data extraction range to obtain the target data set.
[0063] In a possible implementation, a target data set in the source account data may be obtained according to the data extraction scope, and the target data set may be converted into a target text format.
[0064] The target text format is to convert the target data set into a format corresponding to the text. Therefore, during the data extraction process, the target data set is converted into unstructured text, which not only reduces the storage space in the data warehouse, but also makes it easier to perform partition processing and data reception in the data warehouse, thereby improving the efficiency of accounting data recovery.
[0065] S103: Load the target data set into the source layer of the data warehouse.
[0066] The following is a brief introduction to the two components of a data warehouse:
[0067] The Operation Data Store (ODS) is part of the hierarchical management of the data warehouse. Source accounting data is stored in the ODS after being extracted, transformed, and loaded.
[0068] The Data Warehouse Detail (DWD) layer is part of the hierarchical management of the data warehouse. It is used to further refine and process the accounting data of the source layer. The detail layer generally maintains the same data granularity as the source layer and provides a certain degree of data quality assurance.
[0069] By loading the target data set into the source layer, the preliminarily processed target data set is stored in the data warehouse in a manner that minimizes conversion and retains the original state of the data, providing a basis for subsequent processing of accounting data recovery.
[0070] S104: According to the date field of each sub-data in the target data set, the target data set is restored to the corresponding partition of the source layer, and the historical data corresponding to the data extraction range in the detail layer of the data warehouse is deleted.
[0071] Specifically, the source layer is mapped to multiple partitions based on the date field, for example, one partition per day. The sub-data included in the target data set can be classified and stored in the corresponding partitions in the source layer based on the date field. The historical data corresponding to the data extraction range in the detail layer of the data warehouse is deleted. The historical data is the original data stored in the detail layer.
[0072] As a possible implementation method, Impala (dynamic partitioning technology) can be used to restore the target data set to the corresponding partition of the source layer, so that partitions can be automatically created based on the date field without having to manually define each partition path in advance.
[0073] S105: According to the temporal relationship between the sub-data of each partition in the source layer, the date field of the sub-data is modified, and the modified sub-data of each partition is restored to the detail layer of the data warehouse.
[0074] The time series relationship is used to indicate the order in which the actual business operations of each sub-data occur. To ensure that the accounting data stored and maintained in the data warehouse is accurate, the corresponding time series relationship of the data warehouse needs to be maintained when changes such as data changes and data additions occur in the source accounting data.
[0075] For example, for the order creation event and payment event for the same payment order, the time field of the order creation time must be earlier than the time field of the payment event. For another example, for two expense records for the same business, the time field of the first expense record must be earlier than the time field of the second expense record.
[0076] The embodiment of the present application does not specifically limit how to modify the date field of the sub-data according to the temporal relationship between the sub-data of each partition in the source layer. The following two methods are used as examples for explanation.
[0077] Method 1: For example, consider a subdata whose date fields include a start time and an end time. Each partition of the source layer contains associated subdata, including first and second subdata. Before the data changes, the first and second subdata are continuous, and their corresponding time fields do not overlap. For example, the first and second subdata can be two pieces of accounting data corresponding to the same contract.
[0078] As a possible implementation method, the association relationship between the first sub-data and the second sub-data can be determined in this way: for the sub-data belonging to the same business, a business primary key and an operation type identifier are assigned, and all sub-data of the same business entity are associated through the business primary key. If the first sub-data and the second sub-data have the same business primary key, they have an association relationship.
[0079] If the second sub-data changes at the target time and the end time of the first sub-data exceeds the target time, the start time of the second sub-data is modified to the target time, and the end time of the first sub-data is modified to the day before the target time.
[0080] The target time is the time when the second sub-data is modified. For example, if the second sub-data changes on May 22, 2022, the target time is set to May 22, 2022. The start time of the second sub-data is modified to May 22, 2022. The start time of the first sub-data is May 20, 2022, and the end time is May 23, 2022. Since the first and second sub-data are associated, when the second sub-data changes, the end time of the first sub-data cannot be applied to the target time and the period after it. To maintain accurate time sequence, the start time of the first sub-data is modified to May 21, 2022.
[0081] Therefore, for sub-data whose time field corresponds to a period of time rather than a time point, the end time of the associated sub-data can be modified according to the target time, so that the sub-data have a continuous time series relationship, and the time ranges corresponding to each sub-data do not overlap with each other. Not only does it eliminate the need for manual modification, but it can also realize batch recovery of the time series relationship of multiple sub-data in multiple time periods, thereby improving the accuracy and efficiency of accounting data recovery.
[0082] Method 2: Each business entity has a version chain, which is used to store the historical version identifier and effective time interval of the sub-data corresponding to the business entity. The effective time interval includes the effective start time, effective end time and effective identifier. The effective identifier is used to identify whether the version chain is effective.
[0083] If the sub-data of each partition in the source layer includes the sub-data that has changed in the target business entity, the original version chain of the target business entity is updated according to the temporal relationship between the sub-data of each partition in the source layer to obtain an updated version chain.
[0084] The target business entity is one of multiple business entities, which can be contracts, orders, etc. The original version chain is the original version chain of the target business entity, and the updated version chain is the version chain after the original version chain is updated. After the update, the effectiveness mark of the original version chain is invalid, and the effectiveness mark of the updated version chain is valid. At the same time, historical version marks such as v1 and v2 can be assigned to the original version chain and the updated version chain. Based on the temporal relationship between the sub-data of each partition in the source layer, the effective start time and effective end time of the original version chain can be updated to maintain the temporal relationship consistency between the sub-data of the same business entity after data changes (such as additions, deletions, and modifications). Then, based on the effective time interval of the updated version chain, the date field of the sub-data is modified.
[0085] Therefore, data change management can be performed through the version chain. The ineffective original version chain can store the date information of the original sub-data of the target business entity, and the effective updated version chain can store the date information of the current latest sub-data, so as to facilitate the backtracking of the sub-data of the target business entity. At the same time, the updated version chain can also be used to automatically and timely update the date field of the sub-data, thereby improving the efficiency of accounting data recovery.
[0086] It can be seen from the above technical solution that the data extraction scope of the source accounting data is determined. The source accounting data comes from the upstream accounting system and includes multiple sub-data. According to the data extraction scope, the target data set in the source accounting data is obtained. The target data set is loaded into the source layer of the data warehouse. According to the date field of each sub-data in the target data set, the target data set is restored to the corresponding partition of the source layer, and the historical data corresponding to the data extraction scope in the detail layer of the data warehouse is deleted. According to the temporal relationship between the sub-data of each partition in the source layer, the date field of the sub-data is modified, and the modified sub-data of each partition is restored to the detail layer of the data warehouse. Therefore, when the source accounting data changes, the sub-data in the upstream accounting system whose temporal relationship may change can be extracted, and according to the temporal relationship, the date field of the corresponding sub-data in the source layer is modified, so that the sub-data can continue to maintain an accurate temporal relationship, without the need to manually modify the extraction configuration or manually modify each accounting data table, thereby improving the efficiency of accounting data recovery. While replacing historical data, the temporal relationship between each sub-data is also maintained, ensuring that the sub-data maintained by the data warehouse is more accurate in terms of temporal sequence, and improving the accuracy of data in the data warehouse while efficiently restoring data.
[0087] In one possible implementation, in response to a data warehouse abnormality, a prompt message is sent to the data warehouse maintenance personnel to enable them to restore the data. The abnormality includes a change in the amount of data in the data warehouse's sub-data or a change in the time of sub-data operation. The prompt message may be a text message, a system pop-up window, or the like.
[0088] Therefore, when the data warehouse stores abnormal sub-data of the upstream accounting system, maintenance personnel can promptly identify the situation and perform relevant operations for data recovery, reducing the time wasted due to the inability to detect abnormal data.
[0089] Furthermore, a first scheduling instance can be created for S101-S102, a second scheduling instance can be created for S103, and a third scheduling instance can be created for S104-S105. The first scheduling instance, the second scheduling instance, and the third scheduling instance are configured with dependencies among each other, thereby constituting a scheduling instance set. In response to the server receiving an instruction to perform data recovery, the first scheduling instance, the second scheduling instance, and the third scheduling instance in the scheduling instance set are executed in sequence, that is, the scheduling instances corresponding to the extraction job, the loading job, and the data recovery job are automatically executed in sequence.
[0090] Therefore, by scheduling instances to encapsulate the various steps of accounting data recovery, one-click execution can be achieved, and the entire process from data extraction to data recovery does not require manual intervention, further improving the efficiency of accounting data recovery.
[0091] Below through Figure 2 and Figure 3 The above application embodiments are introduced as examples. Figure 2 This figure is a flow chart illustrating the steps for implementing an accounting data function provided by an embodiment of the present application. First, a view of the source accounting data is created in the source system (upstream accounting system), and a maintenance extraction job is configured in the data warehouse. A maintenance loading job is then configured in the detail layer, and a script for detail layer data repair is written. This script can be used to execute S104-S105. A scheduling instance is then created in the scheduling platform to implement one-click data recovery. A data quality verification job is also configured to determine whether the data warehouse has accepted abnormal data.
[0092] See also Figure 3This figure is a schematic diagram of an application scenario of an accounting data recovery method provided by an embodiment of the present application. The server regularly executes the normal extraction operation, data loading, and detailed layer processing steps, and verifies the sub-data of the data warehouse. If the verification passes, it means that the upstream accounting system has not undergone any data change operation that causes a change in the timing relationship, and the normal verification process ends. If the verification fails, a text message notification is sent to the person in charge. The person in charge can issue a data recovery instruction and call the scheduling instance set with one click to execute the extraction operation, loading operation, and detailed layer data repair operation in sequence to complete the data repair.
[0093] See also Figure 4 , Figure 4 An accounting data recovery device provided in an embodiment of the present application includes:
[0094] A determination unit 401 is configured to determine a data extraction range of source accounting data, where the source accounting data comes from an upstream accounting system and includes multiple sub-data.
[0095] An extraction unit 402 is configured to obtain a target data set from the source account data according to the data extraction range;
[0096] The loading unit 403 is used to load the target data set into the source layer of the data warehouse;
[0097] Restoring unit 404, configured to restore the target data set to a corresponding partition of the source layer according to the date field of each sub-data in the target data set, and delete the historical data corresponding to the data extraction range in the detail layer of the data warehouse;
[0098] The modification unit 405 is configured to modify the date field of the sub-data according to the temporal relationship between the sub-data of each partition in the source layer, and restore the modified sub-data of each partition to the detail layer of the data warehouse.
[0099] It can be seen from the above technical solution that the data extraction range of the source accounting data is determined by the determination unit 401, and the source accounting data comes from the upstream accounting system and includes multiple sub-data. The target data set in the source accounting data is obtained according to the data extraction range by the extraction unit 402. The target data set is loaded into the source layer of the data warehouse by the loading unit 403. The target data set is restored to the corresponding partition of the source layer according to the date field of each sub-data in the target data set by the recovery unit 404, and the historical data corresponding to the data extraction range in the detail layer of the data warehouse is deleted. The date field of the sub-data is modified according to the temporal relationship between the sub-data of each partition in the source layer by the modification unit 405, and the sub-data of each partition after the modification is restored to the detail layer of the data warehouse. As a result, when source accounting data changes, it is possible to extract sub-data from the upstream accounting system whose timing relationships may have changed. Based on this timing relationship, the date fields of the corresponding sub-data in the source layer are modified, ensuring that the sub-data maintain an accurate timing relationship. This eliminates the need to manually modify the extraction configuration or manually modify individual accounting data tables, improving the efficiency of accounting data recovery. While replacing historical data, the timing relationships between the various sub-data are also maintained, ensuring that the sub-data maintained in the data warehouse are more accurately timed. This improves the accuracy of the data in the data warehouse while efficiently recovering data.
[0100] As a possible implementation, the date field of the sub-data includes a start time and an end time, the sub-data of each partition in the source layer includes first sub-data and second sub-data having an associated relationship, and the modifying unit 405 is specifically configured to:
[0101] If the second sub-data changes at the target time and the end time of the first sub-data exceeds the target time, the start time of the second sub-data is modified to the target time, and the end time of the first sub-data is modified to the day before the target time.
[0102] As a possible implementation, each business entity has a version chain, which is used to store historical versions of sub-data corresponding to the business entity and an effective time interval. The effective time interval includes an effective start time, an effective end time, and an effective flag. The modification unit 405 is specifically used to:
[0103] If the sub-data of each partition in the source layer includes sub-data that has changed in the target business entity, the original version chain of the target business entity is updated according to the temporal relationship between the sub-data of each partition in the source layer to obtain an updated version chain, with the validity flag of the original version chain being ineffective and the validity flag of the updated version chain being effective;
[0104] The date field of the sub-data is modified according to the effective time interval of the update version chain.
[0105] As a possible implementation, the upstream accounting system has a view created for sub-data of the same table structure, and the view is used to query the sub-data corresponding to the target date field.
[0106] As a possible implementation, the apparatus 400 further includes a prompting unit configured to:
[0107] In response to the data warehouse being in an abnormal state, the abnormal state includes a change in the amount of sub-data of the data warehouse or a change in the operation time of the sub-data of the data warehouse, a prompt message is sent to the maintenance personnel of the data warehouse to enable the maintenance personnel to perform data recovery.
[0108] As a possible implementation, the apparatus 400 further includes a scheduling unit configured to:
[0109] In response to receiving an instruction to perform data recovery, sequentially executing a first scheduling instance, a second scheduling instance, and a third scheduling instance in the set of scheduling instances;
[0110] The first scheduling instance is used to determine the data extraction range according to the target state of the source accounting data, wherein the source accounting data comes from the upstream accounting system and includes multiple sub-data;
[0111] Acquire a target data set from the source account data according to the data extraction scope;
[0112] The second scheduling instance is used to execute the loading of the target data set into the source layer of the data warehouse;
[0113] The third scheduling instance is used to execute the step of restoring the target data set to the corresponding partition of the source layer according to the date field of each sub-data in the target data set and subsequent steps.
[0114] As a possible implementation, the extraction unit 402 is specifically configured to:
[0115] According to the data extraction scope, a target data set in the source account data is obtained, and the target data set is converted into a target text format.
[0116] See also Figure 5 , an embodiment of the present application further provides a computer device, the computer device comprising a memory 501 and a processor 502:
[0117] The memory is used to store a computer program and transmit the computer program to the processor;
[0118] The processor is configured to execute the method of the above method embodiment according to the computer program.
[0119] An embodiment of the present application further provides a computer-readable storage medium, characterized in that the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method of the above method embodiment.
[0120] An embodiment of the present application further provides a computer program product including a computer program, which, when executed on a computer device, enables the computer device to execute the method of the above method embodiment.
[0121] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Reference can be made to the common and similar parts between the various embodiments. For the systems or devices disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple, and the relevant parts can be referred to the method description.
[0122] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "based, at least in part, on." The term "one embodiment" means "at least one embodiment," the term "another embodiment" means "at least one additional embodiment," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0123] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or plural.
[0124] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.
[0125] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0126] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for recovering accounting data, characterized in that: The method comprises: Determine the data extraction scope of source accounting data, where the source accounting data comes from an upstream accounting system and includes multiple sub-data; Acquire a target data set from the source account data according to the data extraction scope; Loading the target data set into the source layer of the data warehouse; According to the date field of each sub-data in the target data set, the target data set is restored to the corresponding partition of the source layer, and the historical data corresponding to the data extraction range in the detail layer of the data warehouse is deleted; According to the temporal relationship between the sub-data of each partition in the source layer, the date field of the sub-data is modified, and the modified sub-data of each partition is restored to the detail layer of the data warehouse.
2. The method according to claim 1, characterized in that The date field of the sub-data includes a start time and an end time, and the sub-data of each partition in the source layer includes first sub-data and second sub-data having an associated relationship. Modifying the date field of the sub-data according to the temporal relationship between the sub-data of each partition in the source layer includes: If the second sub-data changes at the target time and the end time of the first sub-data exceeds the target time, the start time of the second sub-data is modified to the target time, and the end time of the first sub-data is modified to the day before the target time.
3. The method according to claim 1, characterized in that Each business entity has a version chain, which is used to store the historical versions and effective time intervals of the sub-data corresponding to the business entity. The effective time interval includes the effective start time, effective end time, and effective flag. Modifying the date field of the sub-data based on the temporal relationship between the sub-data of each partition in the source layer includes: If the sub-data of each partition in the source layer includes sub-data that has changed in the target business entity, the original version chain of the target business entity is updated according to the temporal relationship between the sub-data of each partition in the source layer to obtain an updated version chain, with the validity flag of the original version chain being ineffective and the validity flag of the updated version chain being effective; The date field of the sub-data is modified according to the effective time interval of the update version chain.
4. The method according to claim 1, wherein The upstream accounting system has a view created for sub-data with the same table structure, and the view is used to query the sub-data corresponding to the target date field.
5. The method according to claim 1, characterized in that The method further comprises: In response to the data warehouse being in an abnormal state, the abnormal state includes a change in the amount of sub-data of the data warehouse or a change in the operation time of the sub-data of the data warehouse, a prompt message is sent to the maintenance personnel of the data warehouse to enable the maintenance personnel to perform data recovery.
6. The method according to claim 5, characterized in that The method further comprises: In response to receiving an instruction to perform data recovery, sequentially executing a first scheduling instance, a second scheduling instance, and a third scheduling instance in the set of scheduling instances; The first scheduling instance is used to determine the data extraction range according to the target state of the source accounting data, wherein the source accounting data comes from the upstream accounting system and includes multiple sub-data; Acquire a target data set from the source account data according to the data extraction scope; The second scheduling instance is used to execute the loading of the target data set into the source layer of the data warehouse; The third scheduling instance is used to execute the step of restoring the target data set to the corresponding partition of the source layer according to the date field of each sub-data in the target data set and subsequent steps.
7. The method according to any one of claims 1 to 6, characterized in that The step of obtaining a target data set from the source accounting data according to the data extraction range includes: According to the data extraction scope, a target data set in the source account data is obtained, and the target data set is converted into a target text format.
8. An accounting data recovery device, characterized in that: The device comprises: a determination unit, configured to determine a data extraction range of source accounting data, the source accounting data being from an upstream accounting system and including a plurality of sub-data; An extraction unit, configured to obtain a target data set from the source account data according to the data extraction range; A loading unit, configured to load the target data set into a source layer of a data warehouse; a restoration unit, configured to restore the target data set to a corresponding partition of the source layer according to a date field of each sub-data in the target data set, and delete historical data corresponding to the data extraction range in the detail layer of the data warehouse; The modification unit is used to modify the date field of the sub-data according to the temporal relationship between the sub-data of each partition in the source layer, and restore the modified sub-data of each partition to the detail layer of the data warehouse.
9. A computer device, characterized in that: The computer device includes a processor and a memory: The memory is used to store a computer program and transmit the computer program to the processor; The processor is configured to execute the method according to any one of claims 1 to 7 according to the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method according to any one of claims 1 to 7.