Data storage method, device, electronic device and storage medium
By comparing the balance data of the current time period with the data of the most recent historical time period, only the difference data is stored, which solves the problem of wasted storage space in financial institutions and achieves reduction in data volume and efficient use of storage space.
Patent Information
- Application Number
- CN202210166325.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-23
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-02-23
AI Technical Summary
When financial institutions store balance data, due to the date-sequential full storage method used in the existing technology, a large amount of redundant data results in a waste of storage space and the inability to fully utilize the hardware storage space.
By obtaining the balance data of the current time period and comparing it with the recent historical time period data, the difference data is determined, and only the difference data is stored in the target table to avoid redundant storage.
It effectively reduces the amount of stored data, avoids waste of storage space, and ensures that data at each time stage can be obtained from the target table.
Smart Images

Figure CN114564477B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of data storage technology, and in particular, to a data storage method, device, electronic device, and storage medium. Background Art
[0002] In order to better support business development and meet the needs of accounting and external supervision, financial institutions will record and store a large amount of data, including balance data, transaction details, etc. This data is usually stored and managed in various relational databases, but the storage size of the database is limited by the machine hardware and cannot be expanded infinitely. Therefore, how to use limited hardware to store more data has become a problem that needs to be solved urgently.
[0003] In the prior art, financial institutions generally store balance data in full in date order. For example, the balance data of a bank account is recorded daily in terms of account, product, subject, currency, etc., and the account balance is the measurement value. The full data is about 2 billion, which requires a large amount of storage space. However, the storage method of storing the full data in date order in the prior art will result in a large amount of redundant data, and a large amount of daily repeated data may appear, resulting in a waste of storage space and failure to fully utilize the storage space of the storage hardware. Summary of the invention
[0004] The embodiments of the present invention provide a data storage method, device, electronic device and storage medium to ensure that data of each time stage can be obtained from a target table while reducing the amount of stored data and avoiding waste of storage space.
[0005] In a first aspect, an embodiment of the present invention provides a data storage method, including:
[0006] Obtain the current balance data generated in the current time period, and obtain the target table storing the historical balance data corresponding to each historical time period;
[0007] Determine in the target table the historical balance data of the historical time period closest to the current time period as the data to be compared;
[0008] The current balance data is compared with the data to be compared, difference data between the current balance data and the data to be compared is determined, and the difference data is stored in the target table.
[0009] In a second aspect, an embodiment of the present invention further provides a data storage device, the device comprising:
[0010] The module for obtaining the target table is used to obtain the current balance data generated in the current time period, and obtain the target table storing the historical balance data corresponding to each historical time period;
[0011] A module for determining data to be compared, used to determine, in the target table, historical balance data of a historical time period closest to the current time period as data to be compared;
[0012] The difference data storage module is used to compare the current balance data with the data to be compared, determine the difference data between the current balance data and the data to be compared, and store the difference data in the target table.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0014] one or more processors;
[0015] a storage device for storing one or more programs,
[0016] When the one or more programs are executed by the one or more processors, the one or more processors implement the data storage method provided by any embodiment of the present invention.
[0017] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the data storage method provided by any embodiment of the present invention.
[0018] A data storage method provided by an embodiment of the present invention obtains current balance data generated in the current time period, and obtains a target table storing historical balance data corresponding to each historical time period; determines the historical balance data of the historical time period closest to the current time period in the target table as data to be compared; compares the current balance data with the data to be compared, determines the difference data between the current balance data and the data to be compared, and stores the difference data in the target table. This embodiment compares the current balance data with the data to be compared generated in the historical time period, and stores the difference data in the target table, so that the current balance data can be determined based on the difference data and the data to be compared, ensuring that the data of each time period can be obtained from the target table while reducing the amount of stored data to avoid wasting storage space.
[0019] In addition, a data storage device, an electronic device and a storage medium provided by the present invention correspond to the above method and have the same beneficial effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0021] Figure 1 A flowchart of a data storage method provided by an embodiment of the present invention;
[0022] Figure 2 A flowchart of another data storage method provided by an embodiment of the present invention;
[0023] Figure 3 A structural diagram of a data storage device provided by an embodiment of the present invention;
[0024] Figure 4 A structural diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0026] It should also be noted that, for ease of description, only the part relevant to the present invention but not all content is shown in the accompanying drawings. It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processing or methods depicted as flow charts. Although the flow chart describes each operation (or step) as sequential processing, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. When its operation is completed, the processing can be terminated, but it can also have additional steps not included in the accompanying drawings. The processing can correspond to methods, functions, procedures, subroutines, subprograms, etc.
[0027] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0028] Embodiment 1
[0029] Figure 1 A flowchart of a data storage method provided in an embodiment of the present invention. The method can be executed by a data storage device, which can be implemented by software and / or hardware and can be configured in a terminal and / or server to implement the data storage method in an embodiment of the present invention.
[0030] like Figure 1 As shown, the method of this embodiment may specifically include:
[0031] S101. Acquire current balance data generated in the current time period, and acquire a target table storing historical balance data corresponding to each historical time period.
[0032] Among them, the current balance data is the balance data generated by financial business operations in the current time period. The data type of the balance data may include at least one of accounts, accounting products, accounting subjects, currencies and account balances. Accounts are set up according to accounting subjects, have a certain format and structure, and are used as carriers to reflect the increase and change of accounting elements and their results. Accounting products can be products developed in the field of financial accounting; accounting subjects are categories for classifying and calculating the specific contents of accounting element objects.
[0033] Specifically, the current time period is the length of time between the time when the balance data currently needs to be stored and the time when the balance data was last stored. The current time period may include one day, one week, one month or one year. Those skilled in the art may determine the specific length of the current time period based on actual application conditions, and this is not limited in the embodiments of the present invention.
[0034] S102. Determine in the target table the historical balance data of the historical time period closest to the current time period as the data to be compared.
[0035] In a specific implementation, the historical time period closest to the current time period in the target table can be determined, that is, the historical time period last recorded in the target table can be determined according to the time sequence of the records. The historical balance data such as accounts, accounting products, accounting subjects, currencies and account balances corresponding to the historical time period are obtained, and the historical balance data is determined as the data to be compared.
[0036] S103: Compare the current balance data with the data to be compared, determine the difference data between the current balance data and the data to be compared, and store the difference data in the target table.
[0037] In a specific implementation, the target table stores the balance data according to different fields, and the field categories may include at least one of an account, an accounting product, an accounting subject, a currency, and an account balance. Optionally, comparing the current balance data with the data to be compared includes: comparing the current balance data with the data to be compared for each field category in the target table.
[0038] Specifically, during the comparison process, whether the field category has changed can be determined from the aspects of whether the field category has been added, deleted and / or updated. Further, whether the data corresponding to the field category has changed can be determined from the aspects of whether the data corresponding to each field category has been added, deleted and / or updated, thereby determining the difference data.
[0039] Optionally, the difference data includes newly added data; wherein, storing the difference data in the target table includes: when the difference data is newly added data, creating first zipper data in the target table based on the newly added data, and setting the first zipper data as open-chain data.
[0040] Specifically, the newly added data includes newly added field categories and / or newly added data corresponding to the original field categories. For the newly added data, the newly added data is used as the first zipper data, and the first zipper data is created in the target table to complete the storage of the newly added data. Furthermore, the first zipper data can be set as open-chain data to indicate that the data is currently valid data.
[0041] For example, when setting the open chain data, the end date of the open chain data can be set to a larger date value, such as 99991231. The data with an end date of 99991231 can be called open chain data, which is currently valid data in terms of business significance; the data with an end date less than 99991231 is closed chain data, which is historical data in terms of business significance. It should be noted that those skilled in the art can also use other dates as the end date of the open chain data, which is not limited in the embodiment of the present invention.
[0042] Optionally, the difference data also includes changed data; wherein, storing the difference data in the target table includes: when the difference data is changed data, determining the pre-changed data before the data change occurs in the data to be compared in the target table based on the changed data; when the pre-changed data is open-link data, closing the link of the pre-changed data and inserting the changed data into the target table.
[0043] Specifically, for the changed data, the data before the change in the data to be compared can be determined, and whether the data before the change is open-link data. If it is open-link data, the data before the change is closed and the changed data is inserted into the target table; if it is closed-link data, a new zipper can be created to store the changed data in the newly created zipper.
[0044] A data storage method provided by an embodiment of the present invention obtains current balance data generated in the current time period, and obtains a target table storing historical balance data corresponding to each historical time period; determines the historical balance data of the historical time period closest to the current time period in the target table as data to be compared; compares the current balance data with the data to be compared, determines the difference data between the current balance data and the data to be compared, and stores the difference data in the target table. This embodiment compares the current balance data with the data to be compared generated in the historical time period, and stores the difference data in the target table, so that the current balance data can be determined based on the difference data and the data to be compared, ensuring that the data of each time period can be obtained from the target table while reducing the amount of stored data to avoid wasting storage space.
[0045] Embodiment 2
[0046] Figure 2 A flowchart of another data storage method provided for an embodiment of the present invention. This embodiment is optimized based on the above-mentioned technical solutions. Optionally, it also includes: when correction information for correcting erroneous data in a target table is received, correction data for correcting the error can be obtained based on the correction information; the time length between the occurrence time of the erroneous data in the target table and the current time is determined, and whether the time length is greater than a preset threshold; if not, the data stored in the target table after the occurrence time is de-linked, and the zipper is re-run based on the correction data. Among them, the explanations of the terms that are the same or corresponding to the above-mentioned embodiments are not repeated here.
[0047] like Figure 2 As shown, the method of this embodiment may specifically include:
[0048] S201. Obtain current balance data generated in the current time period, and obtain a target table storing historical balance data corresponding to each historical time period.
[0049] S202. Determine in the target table the historical balance data of the historical time period closest to the current time period as the data to be compared.
[0050] S203: Compare the current balance data with the data to be compared, determine the difference data between the current balance data and the data to be compared, and store the difference data in the target table.
[0051] S204: When correction information for correcting erroneous data in the target table is received, correction data for correcting the error may be obtained based on the correction information.
[0052] In a specific implementation, after storing the balance data, it may be found that the data stored in the target table is incorrect, and the balance data in the target table needs to be corrected. When receiving the correction information sent by the client for correcting the erroneous data in the target table, the correction data and the corresponding contents such as the time to be corrected and the field to be corrected corresponding to the correction data are obtained, and the erroneous data is corrected.
[0053] S205, determining the time length between the time when the error data in the target table occurs and the current time, and determining whether the time length is greater than a preset threshold; if not, proceeding to S206.
[0054] It should be noted that there are two ways to correct the erroneous data: the first is to re-run the zipper data after the erroneous data in the target table to complete the modification of the erroneous data; the second is to de-link the data before the erroneous data, replace the erroneous data with the corrected data as a separate new data chain, and re-open the chain for the data after the erroneous data to complete the correction of the erroneous data. It can be understood that the de-link operation is to return the data to a certain time point; the chain repair operation can be to insert, modify, or delete a piece of data from the entire data chain.
[0055] In order to minimize the time spent on correcting erroneous data and improve the convenience of correcting erroneous data, for erroneous data that occurred for a short time, the erroneous data can be corrected by de-linking and re-running. This can minimize the steps of opening and de-linking, and the process of modifying erroneous data is concise and effective.
[0056] Specifically, based on the time to be corrected in the correction information, the time when the erroneous data in the target table occurred can be determined, and it can be judged whether the time between the time of occurrence and the current time is greater than a preset threshold. If it is less than the preset threshold, it means that the time distance between the time of occurrence and the current time is short, and the erroneous data can be corrected by retiring the chain.
[0057] S206: De-link the data stored in the target table after the occurrence time, and re-run the zipper based on the corrected data.
[0058] In a specific implementation, according to the time sequence recorded in the target table, the subsequent data adjacent to the erroneous data is determined, the subsequent data is delinked, and a new zipper based on the corrected data and the subsequent data is created, thereby realizing the zipper rerunning operation.
[0059] For example, if a problem is found in the data of a previous day (such as 20200806), in order to repair the data, it is necessary to first delink and then rerun the zipper with the latest data. The specific operation steps include: deleting the data with a start date greater than or equal to the date when the error occurred (such as 20200806) from the target table; reopening the data in the target table with an end date equal to the date when the error occurred (such as 20200806), that is, updating the end date to 99991231; rerunning the zipper with the latest data from the date when the error occurred to the current accounting date.
[0060] Optionally, if the duration between the occurrence moment and the current moment is less than or equal to a preset threshold, the previous adjacent data and the subsequent adjacent data corresponding to the occurrence moment are determined in the target table, the previous adjacent data is linked, and it is determined whether the subsequent adjacent data is consistent with the corrected data; if they are inconsistent, a new second zipper data is created based on the corrected data, and the end time of the newly created second zipper data is set as the start time of the subsequent adjacent data.
[0061] For erroneous data that has occurred for a long time, the chain repair method can be used to correct the erroneous data, which can avoid wasting a lot of time on rerunning the chain and improve the efficiency of correcting data.
[0062] Specifically, when the time from the current moment is long, the previous adjacent data and the next adjacent data corresponding to the occurrence moment are determined in the target table. It can be understood that the previous adjacent data is the data before the error data and adjacent to the error data in the time chain sequence of the target table; the next adjacent data is the data after the error data and adjacent to the error data in the time chain sequence of the target table.
[0063] Furthermore, to ensure that the correction process does not affect the preceding adjacent data, the preceding adjacent data can be closed. Then, it can be determined whether the erroneous data causes the same error in the succeeding adjacent data, that is, whether the succeeding adjacent data is consistent with the corrected data; if not, it means that the succeeding adjacent data is not affected by the erroneous data, and only the erroneous data is replaced with the corrected data. The replacement process is to create a new second zipper data based on the corrected data, and set the end time of the newly created second zipper data as the start time of the succeeding adjacent data. If they are consistent, it is necessary to rerun the data chain based on the corrected data, with the position of the erroneous data as the start position and the end position of the succeeding adjacent data as the end position.
[0064] For example, if the data occurred one year ago (20190806), the steps for repairing the chain are as follows:
[0065] 1. Check whether there is data identical to the revised data in the target table. If not, it means that it was affected after 20190806 and may be wrong data. Then you can add a new data with the start date of 20190806 and the end date of 99991231, and set the data as revised data.
[0066] 2. If there is data with a start date of 20190806, but there is no data with a start date of 20190806, find the data with a start date of the two dates closest to 20190806. For the convenience of explanation, they are called "previous number" and "after number" respectively, that is, the previous adjacent data is the "previous number" and the next adjacent data is the "after number". It can be divided into three specific cases: the first case is only the "previous number", then the "previous number" is closed, the end date is 20190806, a new data is added, the start date is 20190806, the end date is 99991231, and the data is set to the revised data. The second case is only the "after number", a new data is added with a start date of 20190806, and the end date is the start date of the "after number", and the data is set to the revised data. In the third case, there are both "previous number" and "after number". Check whether the data of the after number is equal to the revised data. If so, the end date of the previous number is changed to 20190806, and the start date of the after number is changed to 20190806. If the data of the after number is not equal to the revised data, the end date of the "previous number" is changed to 20190806, and a new data is added with the start date of 20190806 and the end date as the start date of the after number, and the data is set to the revised data.
[0067] Optionally, it also includes: when extraction information for extracting data in the target table is received, filtering conditions for the data to be extracted can be determined based on the extraction information; data that meets the filtering conditions is determined in the target table, and the filtered data is displayed.
[0068] In a specific implementation, data that meets the screening conditions can be extracted from the target table and displayed, wherein the screening conditions include time screening conditions and / or field category screening conditions.
[0069] Exemplarily, the data can be extracted by chaining the target table. The data retrieval scenarios are as follows: retrieve the full data of a certain day (for example, 20200807): the filtering conditions are that the start date is less than or equal to a certain day (for example, 20200807), and the end date is greater than a certain day (for example, 20200807); retrieve the data of a certain day (for example, 20200807) with specific conditions: the filtering conditions are that the start date is less than or equal to a certain day (for example, 20200807), and the end date is greater than a certain day (for example, 20200807), plus specific conditions, such as the account name is A, the accounting product is equal to B, etc.
[0070] This embodiment utilizes the time continuity of data and performs zipper storage based on the start date and end date. The data can be delinked, repaired, and retrieved by zipper, which is convenient for data maintenance and use. The erroneous data in the target table is corrected and the required data is filtered out in the target table by zipper retrieval, thereby improving the flexibility in the processing of the stored data.
[0071] Embodiment 3
[0072] Figure 3 The structural diagram of a data storage device provided in an embodiment of the present invention is used to execute the data storage method provided in any of the above embodiments. The device and the data storage method of the above embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the data storage device, reference can be made to the embodiment of the above data storage method. The device may specifically include:
[0073] The target table acquisition module 10 is used to acquire the current balance data generated in the current time period, and acquire the target table storing the historical balance data corresponding to each historical time period;
[0074] A module 11 for determining data to be compared is used to determine, in the target table, historical balance data of a historical time period closest to the current time period as data to be compared;
[0075] The difference data storage module 12 is used to compare the current balance data with the data to be compared, determine the difference data between the current balance data and the data to be compared, and store the difference data in the target table.
[0076] Based on any optional technical solution in the embodiment of the present invention, optionally, the difference data includes newly added data; and the difference data storage module 12 includes:
[0077] A newly created first zipper data unit is used to create a new first zipper data in the target table based on the newly added data when the difference data is the newly added data, and set the first zipper data as open-chain data.
[0078] Based on any optional technical solution in the embodiment of the present invention, optionally, the difference data also includes change data; wherein the difference data storage module 12 includes:
[0079] Determine the pre-change data unit, which is used for determining the pre-change data before the data change occurs in the data to be compared in the target table based on the change data when the difference data is the change data; when the pre-change data is open-link data, close the link of the pre-change data and insert the change data into the target table.
[0080] Based on any optional technical solution in the embodiments of the present invention, optionally, the device further includes:
[0081] A correction module is used for, when correction information for correcting erroneous data in the target table is received, obtaining correction data for correcting the error based on the correction information; determining the duration between the occurrence time of the erroneous data in the target table and the current time, and determining whether the duration is greater than a preset threshold; if not, de-linking the data stored in the target table after the occurrence time, and re-running the zipper based on the correction data.
[0082] Based on any optional technical solution in the embodiments of the present invention, optionally, the device further includes:
[0083] A chain processing module is used to determine, if yes, the preceding adjacent data and the following adjacent data corresponding to the occurrence time in the target table, perform chain processing on the preceding adjacent data, and judge whether the following adjacent data is consistent with the revised data; if not, create a new second zipper data based on the revised data, and set the end time of the newly created second zipper data as the start time of the following adjacent data.
[0084] Based on any optional technical solution in the embodiments of the present invention, optionally, the device further includes:
[0085] A data filtering module is used to determine the filtering conditions of the data to be extracted based on the extraction information when receiving the extraction information for extracting data in the target table; determine the data that meets the filtering conditions in the target table, and display the filtered data; wherein the filtering conditions include time filtering conditions and / or field category filtering conditions.
[0086] Based on any optional technical solution in the embodiment of the present invention, optionally, the storage difference data module 12 includes:
[0087] The comparison data unit is used to compare the current balance data with the data to be compared for each field category in the target table; wherein the field category includes at least one of an account, an accounting product, an accounting subject, a currency and an account balance.
[0088] The data storage device provided in the embodiment of the present invention can execute the data storage method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0089] It is worth noting that in the embodiment of the above-mentioned data storage device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0090] Embodiment 4
[0091] Figure 4 A structural diagram of an electronic device provided by an embodiment of the present invention. Figure 4 A block diagram of an exemplary electronic device 20 suitable for implementing an embodiment of the present invention is shown. The electronic device 20 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0092] like Figure 4 As shown, the electronic device 20 is in the form of a general computing device. The components of the electronic device 20 may include but are not limited to: one or more processors or processing units 201, a system memory 202, and a bus 203 connecting different system components (including the system memory 202 and the processing unit 201).
[0093] Bus 203 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0094] The electronic device 20 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 20, including volatile and non-volatile media, removable and non-removable media.
[0095] The system memory 202 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 204 and / or cache memory 205. The electronic device 20 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 206 may be used to read and write non-removable, non-volatile magnetic media. A disk drive for reading and writing removable non-volatile disks (such as "floppy disks"), and an optical disk drive for reading and writing removable non-volatile optical disks (such as CD-ROM, DVD-ROM or other optical media) may be provided. In these cases, each drive may be connected to the bus 203 via one or more data medium interfaces. The memory 202 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0096] A program / utility 208 having a set (at least one) of program modules 207 may be stored, for example, in the memory 202, such program modules 207 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 207 generally perform the functions and / or methods of the embodiments described herein.
[0097] The electronic device 20 may also communicate with one or more external devices 209 (e.g., keyboards, pointing devices, displays 210, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 20, and / or may communicate with any device that enables the electronic device 20 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 211. Furthermore, the electronic device 20 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 212. As shown, the network adapter 212 communicates with other modules of the electronic device 20 via a bus 203. It should be understood that other hardware and / or software modules may be used in conjunction with the electronic device 20, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0098] The processing unit 201 executes various functional applications and data processing by running programs stored in the system memory 202 .
[0099] An electronic device provided by the present invention can implement the following method: obtaining current balance data generated in the current time period, and obtaining a target table storing historical balance data corresponding to each historical time period; determining the historical balance data of the historical time period closest to the current time period in the target table as data to be compared; comparing the current balance data with the data to be compared, determining the difference data between the current balance data and the data to be compared, and storing the difference data in the target table. In this embodiment, by comparing the current balance data with the data to be compared generated in the historical time period, the difference data is stored in the target table, so that the current balance data can be determined based on the difference data and the data to be compared, ensuring that the data of each time period can be obtained from the target table, while reducing the amount of stored data and avoiding waste of storage space.
[0100] Embodiment 5
[0101] An embodiment of the present invention provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to perform a data storage method when executed by a computer processor, the method comprising:
[0102] The current balance data generated in the current time period is obtained, and a target table storing the historical balance data corresponding to each historical time period is obtained; the historical balance data of the historical time period closest to the current time period is determined in the target table as the data to be compared; the current balance data is compared with the data to be compared, the difference data between the current balance data and the data to be compared is determined, and the difference data is stored in the target table. In this embodiment, the current balance data is compared with the data to be compared generated in the historical time period, and the difference data is stored in the target table, so that the current balance data can be determined based on the difference data and the data to be compared, ensuring that the data of each time period can be obtained from the target table while reducing the amount of stored data and avoiding waste of storage space.
[0103] Of course, the computer executable instructions of a storage medium including computer executable instructions provided by an embodiment of the present invention are not limited to the operations of the method described above, and can also execute related operations in the data storage method provided by any embodiment of the present invention.
[0104] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.
[0105] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0106] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0107] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0108] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A data storage method, characterized in that: include: Acquire current balance data generated in the current time period, and acquire a target table storing historical balance data corresponding to each historical time period, wherein the current balance data is balance data generated by financial business operations in the current time period, and the data type of the balance data includes at least one of an account, a financial accounting product, an accounting subject, a currency, and an account balance, wherein the account is set according to the accounting subject and is used to reflect the increase and change of accounting elements and the carrier of their results, wherein the financial accounting product is a product developed in the field of financial accounting, and the accounting subject is a category for classifying and calculating the specific content of the accounting element object; Determine in the target table the historical balance data of the historical time period closest to the current time period as the data to be compared; Comparing the current balance data with the data to be compared, determining difference data between the current balance data and the data to be compared, and storing the difference data in the target table, wherein the difference data is determined based on addition, deletion and / or update between the current balance data and the data to be compared; When correction information for correcting the erroneous data in the target table is received, obtaining correction data for correcting the error based on the correction information; Determine the time length between the time when the error data in the target table occurs and the current time, and determine whether the time length is greater than a preset threshold; If not, de-zipping the data stored in the target table after the occurrence time, and re-running the zipper based on the corrected data; If yes, then determining the preceding adjacent data and the following adjacent data corresponding to the occurrence time in the target table, performing a link process on the preceding adjacent data, and judging whether the following adjacent data is consistent with the revised data; If they are inconsistent, new second zipper data is created based on the correction data, and the end time of the new second zipper data is set as the start time of the subsequent adjacent data.
2. The method according to claim 1, characterized in that The difference data includes newly added data; wherein storing the difference data in the target table includes: When the difference data is the newly added data, first zipper data is newly created in the target table based on the newly added data, and the first zipper data is set as open-zip data.
3. The method according to claim 2, characterized in that The difference data also includes change data; wherein storing the difference data in the target table includes: When the difference data is the changed data, the pre-changed data before the data change occurs is determined in the to-be-compared data of the target table based on the changed data; When the data before modification is open-link data, the data before modification is closed-linked and the modified data is inserted into the target table.
4. The method according to claim 1, characterized in that: Also includes: When receiving extraction information for extracting data from the target table, determining a screening condition for the data to be extracted based on the extraction information; Determine the data that meets the screening condition in the target table, and display the screened data; The screening conditions include time screening conditions and / or field category screening conditions.
5. The method according to claim 1, characterized in that The comparing the current balance data with the to-be-compared data includes: For each field category in the target table, the current balance data is compared with the data to be compared; The field category includes at least one of an account, an accounting product, an accounting subject, a currency and an account balance.
6. A data storage device, characterized in that: include: A target table acquisition module is used to acquire current balance data generated in the current time period, and acquire a target table storing historical balance data corresponding to each historical time period, wherein the current balance data is balance data generated by financial business operations in the current time period, and the data type of the balance data includes at least one of an account, a financial accounting product, an accounting subject, a currency, and an account balance, wherein the account is set according to the accounting subject and is used to reflect the increase and change of accounting elements and their results, wherein the financial accounting product is a product developed in the field of financial accounting, and the accounting subject is a category for classifying and calculating the specific content of the accounting element object; A module for determining data to be compared, used to determine, in the target table, historical balance data of a historical time period closest to the current time period as data to be compared; a difference data storage module, used for comparing the current balance data with the data to be compared, determining difference data between the current balance data and the data to be compared, and storing the difference data in the target table, wherein the difference data is determined based on addition, deletion and / or update between the current balance data and the data to be compared; a correction module, configured to, when correction information for correcting erroneous data in the target table is received, obtain correction data for correcting the error based on the correction information; Determine the time length between the time when the error data in the target table occurs and the current time, and determine whether the time length is greater than a preset threshold; If not, de-zipping the data stored in the target table after the occurrence time, and re-running the zipper based on the corrected data; a chain processing module, for determining, if yes, the preceding adjacent data and the following adjacent data corresponding to the occurrence time in the target table, performing chain processing on the preceding adjacent data, and judging whether the following adjacent data is consistent with the revised data; If they are inconsistent, new second zipper data is created based on the correction data, and the end time of the new second zipper data is set as the start time of the subsequent adjacent data.
7. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the data storage method according to any one of claims 1 to 5.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data storage method according to any one of claims 1 to 5 is implemented.
