Data updating method and device, equipment and storage medium

CN118210812BActive Publication Date: 2026-09-22CHINA CONSTRUCTION BANK +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410068518.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-17
Publication Date
2026-09-22
Estimated Expiration
2044-01-17

AI Technical Summary

Technical Problem

显然后台数据处理需要耗费一定的时间和系统资源,且系统复杂度较高,数据处理效率不高

Benefits of technology

[0011]本申请提供的数据更新方法、装置、设备及存储介质,在获取待更新数据之后,为待更新数据分配第一版本号,并将文件系统的版本号更新为第一版本号,然后将待更新数据中的数据记录更新至文件系统,其中,在待更新数据中的每条数据记录中添加第一版本号,使数据更新之前无需提前进行后台数据加工,使用相同的数据处理逻辑即可实现各种情况下的数据更新,系统复杂度较低,且数据更新效率较高。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118210812B_ABST
    Figure CN118210812B_ABST
Patent Text Reader

Abstract

The application provides a data updating method and device, equipment and a storage medium. It relates to the technical field of data processing. The method comprises the following steps: obtaining to-be-updated data, assigning a first version number to the to-be-updated data, and updating the version number of a file system to the first version number; and updating data records in the to-be-updated data to the file system, wherein the first version number is added to each data record in the to-be-updated data. The method of the application improves the data updating processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a data updating method, apparatus, device and storage medium. Background Technology

[0002] In computer systems, it's common to encounter situations where a certain type of full data meeting specific conditions needs to be updated periodically or irregularly, and this data needs to be updated with different values ​​based on a primary key. However, each time a user submits a full data file, it only contains the current full data; the data entries may have been added or removed compared to the previous update. Currently, to handle the various scenarios where the data entries in the old and new data files may be the same or different, background data processing is required. This involves comparing the current full data file with the previous one, identifying the differences, and then updating each entry individually. Clearly, background data processing consumes considerable time and system resources, resulting in high system complexity and low data processing efficiency. Summary of the Invention

[0003] This application provides a data update method, apparatus, device, and storage medium, which improves the efficiency of data update processing.

[0004] In a first aspect, this application provides a data update method, comprising: acquiring data to be updated, assigning a first version number to the data to be updated, and updating the version number of the file system to the first version number; updating the data records in the data to be updated to the file system, wherein the first version number is added to each data record in the data to be updated.

[0005] Secondly, this application provides a data update device, comprising: a data acquisition module, configured to acquire data to be updated, assign a first version number to the data to be updated, and update the version number of the file system to the first version number; and a data update module, configured to update data records in the data to be updated to the file system, wherein a first version number is added to each data record in the data to be updated.

[0006] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0007] The memory stores computer-executed instructions;

[0008] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.

[0009] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any implementation of the first aspect.

[0010] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any implementation of the first aspect.

[0011] The data update method, apparatus, device, and storage medium provided in this application, after acquiring the data to be updated, assign a first version number to the data to be updated, update the version number of the file system to the first version number, and then update the data records in the data to be updated to the file system. In this way, the first version number is added to each data record in the data to be updated, so that there is no need to perform background data processing in advance before the data update, and the same data processing logic can be used to realize data updates under various conditions. The system complexity is low and the data update efficiency is high. Attached Figure Description

[0012] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0013] Figure 1 This is a schematic diagram illustrating the status of traditional data updates.

[0014] Figure 2 Flowchart of the data update method provided in the embodiments of this application Figure 1 ;

[0015] Figure 3 Flowchart of the data update method provided in the embodiments of this application Figure 2 ;

[0016] Figure 4 This is a schematic diagram illustrating data updating using the data updating method provided in the embodiments of this application;

[0017] Figure 5 This is a schematic diagram of the structure of the data update device provided in the embodiments of this application;

[0018] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0019] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0020] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims. The acquisition, storage, use, and processing of data in the technical solutions of this application all comply with the relevant provisions of national laws and regulations.

[0021] In computer systems, there are frequent needs for large-scale data updates, such as full data updates. During a data update, the number of data entries to be updated may increase or decrease compared to the last updated data entries in the file system. Therefore, the old and new data entries may have multiple instances of being the same or different. For example, in a full data update, the new full data file is FN, and the last updated full data file is FL. Comparing FN and FL by primary key will produce four categories of data: FP1 (data that is present in both FN and FL), FP2 (data that is present in both FN and FL but different), FP3 (data that is present in FN but not in FL), and FP4 (data that is absent in FN but present in FL). During a full data update, it is necessary to accurately identify and update FP2, FP3, and FP4. If only the new full data file FN is updated, only FP1, FP2, and FP3 will be updated, but FP4 will not.

[0022] like Figure 1 As shown, Figure 1 This diagram illustrates the state of a traditional data update. As can be seen from the diagram, during a full data update, because there may be differences between the old and new data files, the data needs to be processed in the background first. After identifying the different differences, FP2, FP3, and FP4 are then updated to the file system one by one.

[0023] As business grows, the demand for timely data updates increases. Data updates need to be completed as quickly as possible to provide query functionality. However, if backend files need to be processed before each update, the processing efficiency is low, the system's timeliness is poor, and the system complexity is high.

[0024] Figure 2 Flowchart of the data update method provided in the embodiments of this application Figure 1 .like Figure 2 As shown, the data update method includes:

[0025] Step S210: Obtain the data to be updated, assign a first version number to the data to be updated, and update the file system version number to the first version number.

[0026] The data update method of this embodiment can be applied to any scenario that requires a computer system to query and update data, and in such scenarios, the data is frequently updated. The larger the amount of data updated and the higher the update frequency, the greater the efficiency improvement of the data update method provided in this embodiment. This method can be executed by any computer or server deployed in a computer system.

[0027] The part of a computer system that stores files can be called a file system. The file system stores data, and when data updates are needed, it first retrieves the data to be updated. This data is generally in the form of a file; that is, the file containing the data to be updated is retrieved. The data to be updated includes multiple records, each containing at least one key-value pair and corresponding data. To avoid background data preprocessing each time the data to be updated is retrieved, in this embodiment, a new version number, such as a first version number, is assigned to the retrieved data, and then the current version number of the file system is updated to the first version number. The file system records a current version number, which is retrieved and updated simultaneously each time the data to be updated is retrieved and updated. The version numbers updated by the file system each time can be arranged in a certain preset order, such as V1, V2, V3… This order determines the update sequence of different version numbers.

[0028] In this embodiment, the data to be updated can be either a portion of the data to be updated or the entire dataset to be updated. That is, the data update method provided in this embodiment can update either a portion of the data or the entire dataset. When updating a portion of the data, the data to be updated includes each data record that needs to be updated. When updating the entire dataset, the data to be updated includes all data records.

[0029] Step S220: Update the data records in the data to be updated to the file system, wherein a first version number is added to each data record in the data to be updated.

[0030] The step of updating the data records in the data to be updated to the file system involves replacing each corresponding data record stored in the file system with each data record in the data to be updated, and adding a first version number to each data record in the data to be updated. Since there may be four different situations between the data records already stored in the file system and the data records in the data to be updated, such as... Figure 1Both shown have the same data, both have different data, the former has the data and the latter does not, the former does not have the data and the latter does, but Figure 1 Traditional data updates require distinguishing between various discrepancies. In this embodiment, however, there's no need to differentiate; it simply involves updating the data records in the data to be updated to the file system. That is, if a data record exists in the file system, it's updated; if it doesn't, it's added. However, this approach obviously misses some data records that existed in the file system but not in the data to be updated. To address this, this embodiment adds a first version number to each data record updated to the file system, indicating that each record was updated in this particular update process. Since a version number is added to each updated data record during each update, each day's data records have corresponding version number information. Based on the version number of each data record, the update information for each record can be determined. In addition, since the file system version number is updated to the first version number in step S210, each data record updated this time has the same version number as the file system at this time. In this way, the file system version number and the version number of each data record can be compared to determine whether each file record is the data record updated this time, so as to accurately return the latest data when performing file query.

[0031] After obtaining the data to be updated, updating the file system version number to the first version number can be done before updating the data records in the data to be updated to the file system, or after updating the data records in the data to be updated to the file system, or the update of the file system version number to the first version number and the update of the data records in the data to be updated to the file system can be done simultaneously.

[0032] The specific process of updating data records in the data to be updated to the file system can be as follows: Each data record in the data to be updated is matched against the key-value pairs of the data records stored in the file system. Based on the matching results, the corresponding data records are updated, and a first version number is added to each updated data record. The specific matching method can be: read each data record in the data to be updated one by one, and match each data record against the key-value pairs of the data records stored in the file system; update the data records corresponding to successfully matched key values, add data records corresponding to unsuccessfully matched key values, and add a first version number to each updated or added data record. Key-value matching can be primary key-value matching, which means matching each data record in the data to be updated against the primary key-value pairs of the data records stored in the file system, updating the corresponding data records based on the matching results, and adding a first version number to each updated data record. Primary key-value matching is a commonly used method for data matching.

[0033] The data update method provided in this embodiment, after obtaining the data to be updated, assigns a first version number to the data to be updated, updates the version number of the file system to the first version number, and then updates the data records in the data to be updated to the file system. In this way, the first version number is added to each data record in the data to be updated, so that no background data processing is required before the data update. The same data processing logic can be used to realize data updates in various situations, resulting in low system complexity and high data update efficiency.

[0034] Figure 3 Flowchart of the data update method provided in the embodiments of this application Figure 2 .like Figure 3 As shown, the data update method includes:

[0035] Step S310: Obtain the data to be updated, assign a first version number to the data to be updated, and update the file system version number to the first version number.

[0036] Step S320: Update the data records in the data to be updated to the file system, wherein a first version number is added to each data record in the data to be updated.

[0037] Steps S310 and S320 are the same as steps S210 and S220, and will not be repeated here.

[0038] Step S330: Receive a data query request for the file system.

[0039] Figure 2The technical solution provided in the illustrated embodiment can realize data updates to the file system. That is, after executing steps S310 and S320, a data update of the file system is completed. This embodiment shows how to perform data queries on the updated file system after a data update. Upon receiving a data query request for the file system, a data query needs to be performed on the file system according to the data request. The data query request includes query keys, also known as query keywords, such as data number, data type, etc.

[0040] Step S340: Query matching data records in the file system. If the version number of the queried data record is inconsistent with the current version number of the file system, the queried data record is invalid.

[0041] Once the query key in the data query request is determined, the data can be queried in the file system using the query key. Since the file system records the current version number, and each data record retrieved according to the data query request also has a corresponding version number, after retrieving each data record, the version number of each data record is further compared with the version number of the file system. If the version number of the data record matches the version number of the file system, it means that the retrieved data record is the most recently updated and is valid. If the version number of the retrieved data record does not match the version number of the file system, it means that the retrieved data record is not the most recently updated and is invalid. In this way, data validity can be determined simply by storing the version number corresponding to each update in the system and recording the corresponding version number in each updated data record.

[0042] Specifically, the process of querying matching data records in the file system involves: reading the current version number of the file system; querying matching data records according to the data query request, and comparing the version number of the queried data record with the current version number of the file system; if the version number of the queried data record matches the current version number of the file system, the queried data record is returned as the query result; if the version number of the queried data record does not match the current version number of the file system, the queried data record is invalid. When the version number of the queried data record matches the current version number of the file system, the returned data record is the query result corresponding to the data query request. If the queried data record is invalid, it will not be returned.

[0043] In a file system, besides data updates, data processing may also involve data rollback and data invalidation due to data usage requirements. Based on... Figure 2In the illustrated embodiment, if data rollback or data invalidation is required after updating the file system, the following processing method shall be followed.

[0044] After data is updated in the file system, the file system records the most recent version number, such as... Figure 2 The first version number in the illustrated embodiment. In one embodiment, when a data rollback request is received, that is, when it is necessary to roll back the data stored in the file system to the last updated data, it is necessary to obtain the last updated data, for example, obtain the last updated data file. Then, determine the second version number corresponding to the last updated data. The second version number is an earlier version number than the first version number, and each version number corresponds to one updated data. Then, update the file system version number to the second version number, and update the file system with the data records from the last updated data, wherein the second version number is added to each data record in the last updated data. That is, use the data corresponding to the second version number to perform a new update to the file system, and the update method is the same as... Figure 2 The embodiments shown are the same. After the above update is completed, the version number of the file system is the second version number, and all data records in the file system corresponding to the second version number have been updated and have the corresponding second version number. Therefore, when querying data in the file system, the rolled-back data records, that is, the data records corresponding to the second version number, will be retrieved. The data rollback method provided in this application embodiment has simple and efficient processing logic, reducing system complexity.

[0045] In one embodiment, when a data invalidation request is received, the version number of the data record corresponding to the data invalidation request in the file system is updated to a version number prior to the first version number. The data invalidation request includes an invalidation request for at least one data record. The data invalidation process can be achieved by simply modifying the version number of the data record corresponding to the data invalidation request in the file system. By simply changing the version number of the data record corresponding to the data invalidation request to a version number prior to the current version number of the file system, the corresponding data record can be invalidated. Thus, when data is queried in the file system, the modified version number will not be returned, thereby achieving data invalidation. The data invalidation method provided in this application embodiment has very simple processing logic, reducing system complexity.

[0046] In data invalidation processes, full data invalidation is frequently performed, which means invalidating all recently updated data. When a full data invalidation request is received, the version numbers of data records in the file system corresponding to version number 1 can be updated to a version number prior to version number 1. This approach is similar to the partial data record invalidation approach described above; it involves querying the data records in the file system to determine the version number corresponding to each file record, and then modifying the version numbers of all data records with version number 1 to a version number prior to version number 1.

[0047] Alternatively, for complete data invalidation, there's another approach: upon receiving a complete data invalidation request, update the file system's version number to a version number preceding the first version number. This means it's unnecessary to modify the version number of each individual data record stored in the file system; simply updating the file system's version number to a version number preceding the first version number is sufficient to complete the complete data invalidation. This method is more efficient.

[0048] Figure 4 This is a schematic diagram illustrating data updating using the data updating method provided in the embodiments of this application. Figure 4 As shown, the file system underwent multiple full data updates, with files to be updated designated as F1, F2, ..., Fn. The primary key value and corresponding data value of each file to be updated are shown in the figure. In this embodiment, the primary key value of the data records is matched to perform data updates. Each data record in the file system includes a primary key value, a data value, and a version number. After each data update, the primary key value is matched, the corresponding data record is updated in the file system, and the corresponding version number is modified. Additionally, the file system also stores a system version number, corresponding to each file to be updated. For example, the version number corresponding to file F1 is V1, the version number corresponding to file F2 is V2, and the version number corresponding to file Fn is Vn.

[0049] Figure 5 This is a schematic diagram of the structure of the data update device provided in an embodiment of this application. Figure 5 As shown, the data update device includes: a data acquisition module 510 and a data update module 520.

[0050] Among them, the data acquisition module 510 is used to acquire the data to be updated, assign a first version number to the data to be updated, and update the version number of the file system to the first version number;

[0051] The data update module 520 is used to update the data records in the data to be updated to the file system, wherein a first version number is added to each data record in the data to be updated.

[0052] In some embodiments, the data update device further includes a data query module, which is used to receive a data query request to the file system; query matching data records in the file system, wherein if the version number corresponding to the queried data record is inconsistent with the current version number of the file system, the queried data record is invalid.

[0053] In some embodiments, the data query module is specifically used to read the current version number of the file system; query matching data records according to the data query request, and compare whether the version number corresponding to the queried data record is consistent with the current version number of the file system; if the version number corresponding to the queried data record is consistent with the current version number of the file system, the queried data record is returned as the query result; if the version number corresponding to the queried data record is inconsistent with the current version number of the file system, the queried data record is invalid.

[0054] In some embodiments, the data update module 520 is further configured to, when receiving a data rollback request, obtain the data from the last update, determine the second version number corresponding to the data from the last update, update the version number of the file system to the second version number, and update the data records in the data from the last update to the file system, wherein the second version number is added to each data record in the data from the last update.

[0055] In some embodiments, the data update module 520 is further configured to update the version number of the data record corresponding to the data failure request in the file system to a version number prior to the first version number when a data failure request is received.

[0056] In some embodiments, the data update module 520 is further configured to, when receiving a request for full data invalidation, update the version number of the data record in the file system whose version number is the first version number to the version number prior to the first version number.

[0057] In some embodiments, the data update module 520 is further configured to update the file system version number to a version number prior to the first version number when a request for full data invalidation is received.

[0058] In some embodiments, the data update module 520 is specifically used to perform key-value matching between each data record in the data to be updated and the data records stored in the file system, update the corresponding data record according to the matching result, and add a first version number to each updated data record.

[0059] In some embodiments, the data update module 520 is specifically used to read each data record in the data to be updated one by one, and perform key-value matching between each data record and the data records stored in the file system; update the data record corresponding to the successfully matched key value, add the data record corresponding to the unsuccessfully matched key value, and add a first version number to each updated or added data record.

[0060] In some embodiments, the data update module 520 is specifically used to match each data record in the data to be updated with the primary key value of the data record stored in the file system, update the corresponding data record according to the matching result, and add a first version number to each updated data record.

[0061] In some embodiments, the data to be updated is the full data to be updated.

[0062] The data update apparatus provided in this application embodiment can be used to execute the technical solution of the data update method in the above embodiment. Its implementation principle and technical effect are similar, and will not be described again here.

[0063] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented in software via processing element calls, while others are implemented in hardware. For example, the data acquisition module 510 and the data update module 520 can both be separate processing elements, or they can be integrated into a chip in the above device. Alternatively, they can be stored as program code in the memory of the above device, and their functions can be called and executed by a processing element of the above device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.

[0064] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 6 As shown, the electronic device may include: a transceiver 61, a processor 62, and a memory 63.

[0065] Processor 62 executes computer execution instructions stored in memory, causing processor 62 to perform the scheme in the above embodiments. Processor 62 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0066] The memory 63 is connected to the processor 62 via the system bus and completes communication between them. The memory 63 is used to store computer program instructions.

[0067] Transceiver 61 can be used to obtain the task to be run and its configuration information.

[0068] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0069] The electronic device provided in this application embodiment can be a computer or server in a computer system capable of data processing.

[0070] This application also provides a chip for executing instructions, which is used to execute the data update method described in the above embodiments.

[0071] This application also provides a computer-readable storage medium storing computer instructions that, when executed on a computer, cause the computer to perform the data update method described in the above embodiments.

[0072] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium, and when the at least one processor executes the computer program, it can implement the technical solution of the data update method in the above embodiments.

[0073] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0074] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A data update method, characterized in that, include: Obtain the data to be updated, assign a first version number to the data to be updated, and update the version number of the file system to the first version number; wherein, the data to be updated includes all data, and the data to be updated exists in the form of files; The data records in the data to be updated are updated to the file system, wherein the first version number is added to each data record in the data to be updated; Receive a data query request for the file system; wherein the data query request includes a query key value; The system queries for matching data records in the file system. If the version number of the queried data record is inconsistent with the current version number of the file system, the queried data record is invalid. When a data rollback request is received, the data from the last update is obtained, the second version number corresponding to the data from the last update is determined, and the version number of the file system is updated to the second version number. The data records in the previously updated data are updated to the file system, wherein a second version number is added to each data record in the previously updated data. The second version number is an earlier version number than the first version number, and each version number corresponds to each updated data. When a data failure request is received, the version number of the data record in the file system corresponding to the data failure request is updated to the version number before the first version number, wherein the data failure request includes a failure request for at least one data record. When a request to completely invalidate data is received, the version number of the data record in the file system whose version number is the first version number is updated to a version number prior to the first version number, or... Update the version number of the file system to the version number of the file system prior to the first version number; The step of querying matching data records in the file system includes: Read the current version number of the file system; The system queries the data records to find matching records according to the data query request, and compares the version number of the queried data records with the current version number of the file system to see if they are consistent. If the version number of the retrieved data record matches the current version number of the file system, the retrieved data record is returned as the query result. If the version number of the retrieved data record is inconsistent with the current version number of the file system, the retrieved data record is invalid. The step of updating the data records in the data to be updated to the file system includes adding the first version number to each data record in the data to be updated, which includes: Each data record in the data to be updated is matched with the data records stored in the file system using key-value pairs. The corresponding data record is updated according to the matching result, and the first version number is added to each updated data record. The step of performing key-value matching between each data record in the data to be updated and the data records stored in the file system, updating the corresponding data record according to the matching result, and adding the first version number to each updated data record includes: Read each data record in the data to be updated one by one, and match each data record with the key-value pairs of the data records stored in the file system; Update the data record corresponding to the key value that matches successfully, add the data record corresponding to the key value that does not match successfully, and add the first version number to each updated or added data record.

2. The method according to claim 1, characterized in that, The step of performing key-value matching between each data record in the data to be updated and the data records stored in the file system, updating the corresponding data record according to the matching result, and adding the first version number to each updated data record further includes: Each data record in the data to be updated is matched with the primary key value of the data record stored in the file system. The corresponding data record is updated according to the matching result, and the first version number is added to each updated data record.

3. The method according to any one of claims 1 to 2, characterized in that, The data to be updated refers to the full dataset.

4. A data update device, characterized in that, include: The data acquisition module is used to acquire data to be updated, assign a first version number to the data to be updated, and update the version number of the file system to the first version number; wherein, the data to be updated includes all data and exists in the form of files; The data update module is used to update the data records in the data to be updated to the file system, wherein the first version number is added to each data record in the data to be updated; A data query module is used to receive data query requests for the file system; wherein the data query request includes a query key value; and to query matching data records in the file system, wherein if the version number corresponding to the queried data record is inconsistent with the current version number of the file system, the queried data record is invalid. The data update module is further configured to, upon receiving a data rollback request, obtain the data from the last update, determine the second version number corresponding to the data from the last update, update the version number of the file system to the second version number, and update the data records in the data from the last update to the file system, wherein the second version number is added to each data record in the data from the last update, the second version number being an earlier version number than the first version number, and each version number corresponding to each updated data; The data update module is further configured to, when receiving a data failure request, update the version number of the data record in the file system corresponding to the data failure request to a version number prior to the first version number, wherein the data failure request includes a failure request for at least one data record; and when receiving a full data failure request, update the version number of the data record in the file system whose version number is the first version number to a version number prior to the first version number, or update the version number of the file system to a version number of the file system prior to the first version number; Specifically, the data query module is used to read the current version number of the file system; query matching data records according to the data query request, and compare whether the version number corresponding to the queried data record is consistent with the current version number of the file system; if the version number corresponding to the queried data record is consistent with the current version number of the file system, the queried data record is returned as the query result; if the version number corresponding to the queried data record is inconsistent with the current version number of the file system, the queried data record is invalid. Specifically, the data update module is used to perform key-value matching between each data record in the data to be updated and the data records stored in the file system, update the corresponding data record according to the matching result, and add the first version number to each updated data record. The step of performing key-value matching between each data record in the data to be updated and the data records stored in the file system, updating the corresponding data record according to the matching result, and adding the first version number to each updated data record includes: reading each data record in the data to be updated one by one, performing key-value matching between each data record and the data records stored in the file system; updating the data record corresponding to the successfully matched key value, adding the data record corresponding to the unsuccessfully matched key value, and adding the first version number to each updated or added data record.

5. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1-3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-3.

7. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method of any one of claims 1-3.

Citation Information

Patent Citations

  • Data updating method and device, computer equipment, readable storage medium and product

    CN116661834A