Data version management method and device, storage medium and program product

By creating new data version nodes in the data version control linked list and storing version differential data, the problem of large storage overhead in dynamic data version control is solved, and efficient data management and fine version recording are achieved.

CN119781813APending Publication Date: 2025-04-08ZHEJIANG ZEEKR INTELLIGENT TECH CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411822473.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The prior art has a problem of large storage overhead in dynamic data version control, especially in large-scale data processing and real-time systems.

Method used

By monitoring data version changes, creating new data version nodes in response to changes, and storing version differences data before and after changes in these nodes, using compressed storage to reduce space overhead.

Benefits of technology

Effectively manage dynamic data versions, reduce storage overhead, improve data management efficiency, and realize fine recording and evolution management between data versions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781813A_ABST
    Figure CN119781813A_ABST
Patent Text Reader

Abstract

The invention provides a data version management method and device, a storage medium and a program product, and relates to the technical field of software development. The method comprises the steps of monitoring whether a data version is changed or not; in response to the change of the data version, a new data version node is created in a data version control linked list, the data version control linked list comprises at least one data version node, and each data version node is used for storing version difference data and a version identifier; and in the new data version node, storing the version identifier of the changed data version and the version difference data between the data version before change and the changed data version. According to the invention, the storage overhead of dynamic data version control can be saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of software development technology, and in particular to a data version management method, device, storage medium and program product. Background Art

[0002] In the context of existing software development and data management technologies, version control systems play a key role in source code management. However, for version control of dynamic data, especially in large-scale data processing and real-time systems, existing technologies have some limitations.

[0003] The current technical solutions for data version management save different versions of data and rely on rule engines or configuration files. The changes in data between different versions are determined by comparing the differences between rules. These methods have the problem of high storage overhead. Summary of the invention

[0004] The present application provides a data version management method, device, storage medium and program product to reduce the storage overhead of dynamic data version control in the prior art.

[0005] In a first aspect, the present application provides a data version management method, comprising:

[0006] Monitor whether the data version has changed;

[0007] In response to a data version change, creating a new data version node in a data version control linked list, wherein the data version control linked list includes at least one data version node, each data version node is used to store version difference data and a version identifier;

[0008] In the new data version node, the version identifier of the changed data version and the version difference data between the data version before the change and the data version after the change are stored.

[0009] In a possible implementation, in the new data version node, storing version difference data between the data version before the change and the data version after the change includes:

[0010] Determine the version difference data between the data version before the change and the data version after the change;

[0011] The version difference data is compressed and stored in the new data version node.

[0012] In a possible implementation, the first data version node in the data version control linked list stores the full amount of data of the corresponding data version.

[0013] In a possible implementation, after creating a new data version node in the data version control linked list, the method further includes:

[0014] The index list stores the version identifier of the changed data version and the index address of the new data version node in the data version control linked list. The index list is used for fast retrieval of the data version node in the data version control linked list.

[0015] In a possible implementation, in response to a data version change, creating a new data version node in a data version control linked list includes:

[0016] In response to a change in the data version, determining the number of data version nodes included in the data version control linked list;

[0017] If the number of data version nodes is equal to the set maximum number of data version nodes, then in the data version control linked list, the data stored in the first created data version node is stored in the data version node connected to the first created data version node, the first created data version node is deleted, and a new data version node is created at the end of the linked list;

[0018] Alternatively, if the number of data version nodes is equal to the set maximum number of data version nodes, a new data version control linked list is created through distributed storage, and a new data version node is created in the new data version control linked list.

[0019] In a possible implementation, it further includes:

[0020] If the first created data version node is deleted in the data version control linked list, and a new data version node is created at the end of the linked list, the index list corresponding to the data version control linked list is updated. The index list is used to store the version identifier corresponding to the data version node and the index address of the data version node in the data version control linked list.

[0021] In a possible implementation, monitoring whether the data version has changed includes at least one of the following:

[0022] If a data version insertion instruction is detected, it is determined that the data version has changed;

[0023] If a data version update instruction is detected, it is determined that the data version has changed;

[0024] If a data version rollback instruction is detected, it is determined that the data version has changed.

[0025] In a second aspect, the present application provides a data version management device, the data version management device comprising:

[0026] Monitoring module, used to monitor whether the data version has changed;

[0027] A creation module, configured to create a new data version node in a data version control linked list in response to a change in the data version, wherein the data version control linked list includes at least one data version node, each data version node being used to store version difference data and a version identifier;

[0028] The storage module is used to store, in the new data version node, the version identifier of the changed data version and the version difference data between the data version before the change and the data version after the change.

[0029] In a possible implementation manner, the storage module is specifically used for:

[0030] Determine the version difference data between the data version before the change and the data version after the change;

[0031] The version difference data is compressed and stored in the new data version node.

[0032] In a possible implementation, the first data version node in the data version control linked list stores the full amount of data of the corresponding data version.

[0033] In a possible implementation, the creation module is specifically used to:

[0034] The index list stores the version identifier of the changed data version and the index address of the new data version node in the data version control linked list. The index list is used for fast retrieval of the data version node in the data version control linked list.

[0035] In a possible implementation, the creation module is specifically used to:

[0036] In response to a change in the data version, determining the number of data version nodes included in the data version control linked list;

[0037] If the number of data version nodes is equal to the set maximum number of data version nodes, then in the data version control linked list, the data stored in the first created data version node is stored in the data version node connected to the first created data version node, the first created data version node is deleted, and a new data version node is created at the end of the linked list;

[0038] Alternatively, if the number of data version nodes is equal to the set maximum number of data version nodes, a new data version control linked list is created through distributed storage, and a new data version node is created in the new data version control linked list.

[0039] In a possible implementation, the data version management device further includes a processing module, and the processing module is used to:

[0040] If the first created data version node is deleted in the data version control linked list, and a new data version node is created at the end of the linked list, the index list corresponding to the data version control linked list is updated. The index list is used to store the version identifier corresponding to the data version node and the index address of the data version node in the data version control linked list.

[0041] In a possible implementation, the monitoring module is specifically used for:

[0042] If a data version insertion instruction is detected, it is determined that the data version has changed;

[0043] If a data version update instruction is detected, it is determined that the data version has changed;

[0044] If a data version rollback instruction is detected, it is determined that the data version has changed.

[0045] In a third aspect, the present application provides an electronic device, including:

[0046] Memory for storing computer-executable instructions;

[0047] A processor is used to execute computer-executable instructions to implement any data version management method in the first aspect.

[0048] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, they are used to implement any one of the data version management methods in the first aspect.

[0049] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed, is used to implement the data version management method of any one of the first aspects.

[0050] The data version management method, device, storage medium and program product provided by the present application monitor whether the data version has changed; in response to the change of the data version, a new data version node is created in the data version control linked list, the data version control linked list includes at least one data version node, each data version node is used to store version difference data and version identification; in the new data version node, the version identification of the changed data version and the version difference data between the data version before the change and the data version after the change are stored. The present application creates a new data version node in the data version control linked list in response to the data version change, and the data version linked list structure helps to effectively manage dynamic data versions and improve data management efficiency; in the new data version node, the version identification of the changed data version and the version difference data between the data version before the change and the data version after the change are stored, and the storage of version difference data can save data storage overhead, and the storage of version difference data can achieve fine recording and evolution management between data versions. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0052] Figure 1 A flowchart of a data version management method provided in an embodiment of the present application;

[0053] Figure 2 A structural diagram of a data version control linked list provided in an embodiment of the present application;

[0054] Figure 3 A relationship diagram of a data version control linked list and an index list mapping provided by another embodiment of the present application;

[0055] Figure 4 The process of the data version management method provided in the embodiment of the present application Figure 2 ;

[0056] Figure 5 The process of the data version management method provided in the embodiment of the present application Figure 3 ;

[0057] Figure 6 for Figure 5 A flowchart of a data version management method for updating a first target data version provided in the illustrated embodiment;

[0058] Figure 7 The process of the data version management method provided in the embodiment of the present application Figure 4 ;

[0059] Figure 8 for Figure 7A flowchart of a data version management method for rolling back to a second target data version provided in the illustrated embodiment;

[0060] Fig. 9 A schematic diagram of the structure of the data version management device provided by this application;

[0061] Fig.10 A schematic diagram of the structure of a data version management device provided in yet another embodiment of the present application.

[0062] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0063] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0064] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0065] In modern software development and data management practices, traditional version control systems mainly focus on the management of static files and have limited responsiveness to changes in dynamic data structures. In particular, in scenarios where dynamic data versions need to be continuously tracked and managed, existing technologies often fail to provide sufficient flexibility and efficiency. When dealing with large-scale and frequently changing data, performance bottlenecks and storage costs are often encountered.

[0066] In order to solve the above problems, an embodiment of the present application provides a data version management method based on a linked list structure, introduces a data version control linked list structure, and provides a new solution for dynamic data version control by storing difference data between different data versions and managing versioned nodes.

[0067] Furthermore, through the data version control linked list structure, not only can the evolution process of data be tracked and recorded efficiently, but it is also particularly suitable for application scenarios that require real-time response and accurate tracking of data changes.

[0068] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0069] Figure 1 Flow chart of the data version management method provided in the embodiment of the present application. Figure 1 As shown, the data version management method includes the following steps:

[0070] S101. Monitor whether the data version has changed.

[0071] Among them, monitoring data version changes is a key link in data management and quality control, which can ensure the accuracy and consistency of data. Data versions are usually closely related to operations such as updating, correcting or re-collecting data. Each version may reflect different data content, format or accuracy level, so it is crucial to identify version changes in a timely manner.

[0072] In actual operation, there are multiple methods that can be used to monitor changes in data versions. The embodiments of the present application do not limit the specific implementation method of monitoring changes in data versions.

[0073] In one implementation, whether the data version has changed is monitored by comparing the timestamps of the data, wherein data updates are usually accompanied by new timestamps. By comparing the latest timestamp with the previously recorded timestamp, it can be determined whether the data version has changed.

[0074] In another implementation, whether the data version has changed is monitored by checking the size or number of rows of the data. When the data version changes, the amount of data may change accordingly.

[0075] In summary, monitoring data version changes can help maintain data integrity and reliability on the one hand, and lay a solid foundation for data analysis and decision-making on the other. Choosing appropriate methods to monitor data changes can effectively improve the efficiency and quality of data management.

[0076] S102: In response to a data version change, a new data version node is created in a data version control linked list, where the data version control linked list includes at least one data version node, and each data version node is used to store version difference data and a version identifier.

[0077] After detecting that the data version has changed, in response to the data version change, a new data version node is created in the data version control linked list. The data version control linked list includes at least one data version node, and each data version node stores version difference data and a version identifier. The version difference data is the difference data between the current data version and the previous data version, and the version identifier is the current data version number. Furthermore, the structure of the data version control linked list can be selected according to actual needs, and the structure of the data version control linked list can be a differential structure or an incremental structure. The data version control linked list with a differential structure is intended to efficiently store and process data changes, and usually includes a part that records changes in order to save storage space; the data version control linked list with an incremental structure uses incremental storage to record data changes, which can include recording the differences between each version so that a specific version of the data can be reconstructed when needed.

[0078] In this embodiment, the data version control linked list is as follows: Figure 2 As shown, Figure 2 The structure diagram of the data version control linked list provided in the embodiment of the present application. Figure 2 It can be seen that the data version control linked list contains at least one data version node. The data version node data field stores the difference data between the current data version and the previous data version and the current data version number. The data version node pointer field points to the next node address, so that each data version node is dynamically generated in real time during runtime. When the data version control linked list is initialized, the difference data in the data version node data field in the data version control linked list is empty, and the version identifier is 0. When creating a data version control linked list, the maximum number of data version nodes can be set.

[0079] Alternatively, in an instant messaging (IM) system, sensitive word filtering is an important function used to protect users from harmful content. Traditional methods often use static filtering rules or simple keyword matching to manage and update sensitive word libraries in instant messaging systems, but these methods have storage redundancy and performance degradation problems, making it difficult to cope with dynamically changing content and real-time update requirements.

[0080] The embodiment of the present application can manage and update the sensitive word library in the form of a dynamic data structure by applying a data version control linked list. Each time the sensitive word library is updated, the system will only record the newly added or changed parts, without the need to store the entire word library in full, thereby saving storage space and improving system efficiency. At the same time, the data version control linked list can accurately record each addition, modification and deletion operation of sensitive words, providing administrators with detailed operation records and traceability, which is particularly important in security management and other aspects.

[0081] In addition, the data version control list can also support multi-user concurrent access and real-time updates to ensure the timeliness and accuracy of sensitive word libraries. This flexible and dynamic data management method greatly improves the performance of the IM system in terms of security, performance and user experience, enabling it to better respond to changing user needs and external environmental challenges.

[0082] In summary, the data version control linked list is not only a technical breakthrough, but also an important innovation in traditional data management methods. By applying this data structure in the IM system, the efficiency and accuracy of the sensitive word filtering function can be effectively improved, providing users with a safer and more reliable instant messaging environment.

[0083] The data version control linked list can also be applied to other real-time systems for large-scale data processing, which can effectively manage and control various data evolution scenarios and improve the applicability and flexibility of the system.

[0084] S103: Store the version identifier of the changed data version and the version difference data between the data version before the change and the data version after the change in the new data version node.

[0085] In this step, it can be understood that the new data version node created in S102 stores the version identifiers of the data versions before and after the change, and stores the version difference data between the data version before and after the change. The data version identifier is a specific mark used to clearly distinguish different versions of data.

[0086] The embodiment of the present application creates a new data version node in the data version control linked list in response to data version changes. The data version linked list structure helps to effectively manage dynamic data versions and improve data management efficiency. In the new data version node, the version identifier of the data version after the change and the version difference data between the data version before the change and the data version after the change are stored. By storing the version difference data, data storage overhead can be saved, and storing the version difference data can achieve detailed recording and evolution management between data versions.

[0087] Based on the above embodiment, in a new data version node, version difference data between the data version before the change and the data version after the change is stored, including: determining the version difference data between the data version before the change and the data version after the change; compressing the version difference data and storing it in the new data version node.

[0088] In this embodiment, it can be understood that before storing the version difference data between the data version before the change and the data version after the change, it is necessary to determine the version difference data between the data version before the change and the data version after the change, and then compress the determined version difference data, and finally store the compressed version data difference data in the new data version node. Among them, the version data difference data can realize the fine recording and evolution management between data versions. When monitoring data version changes, the version data difference data can effectively record and manage data changes to ensure the integrity and consistency of the data version.

[0089] Furthermore, the specific implementation method of compressing version difference data can be set according to actual needs, and the embodiments of the present application do not limit this.

[0090] In one example, the ZLIB compression algorithm is used to compress version difference data. Specifically: the Lempel-Ziv1977 (LZ77 for short) algorithm is used to find repeated data in the version difference data, which is represented by a pointer and a length value, and the non-repeated data is directly encoded; then, the version difference data after the LZ77 algorithm is Huffman encoded, and a Huffman tree is constructed according to the frequency of occurrence of the encoded characters, and high-frequency symbols are encoded into shorter binary sequences, and low-frequency symbols are encoded into longer binary sequences, thereby completing the compression of the version difference data. Compared with the traditional method that requires the complete recording of each version of the data, the compressed storage of version difference data not only saves storage space, but also improves storage efficiency when processing large-scale data, saving resource costs.

[0091] The embodiment of the present application can reduce storage overhead and improve storage efficiency while ensuring data integrity and traceability by storing compressed version difference data in a new data version node.

[0092] Based on the above embodiment, the first data version node in the data version control linked list stores the full data of the corresponding data version. It can be understood that the first data version node in the data version control linked list is used to store the full data for the data version, and the remaining data version nodes in the data version control linked list are used to store version difference data and version identifiers. Among them, the full data of the data version refers to all the data content contained in the data version.

[0093] The embodiment of the present application makes data version management clearer by storing the full data and version difference data of the data version in different data version nodes respectively.

[0094] Furthermore, after creating a new data version node in the data version control linked list, it also includes: storing the version identifier of the changed data version and the index address of the new data version node in the data version control linked list in an index list, and the index list is used for fast retrieval of the data version node in the data version control linked list.

[0095] In this embodiment, it can be understood that when the data version changes, it is necessary to store not only the version difference data between the data version before the change and the data version after the change, but also the version identifier of the data version after the change and the index address of the new data version node in the data version control linked list. Among them, the version difference data between the data version before the change and the data version after the change is stored in the new data version node, and the version identifier of the data version after the change and the index address of the new data version node in the data version control linked list are stored in the index list.

[0096] The specific implementation method of storing the version identifier of the changed data version in the index list and the index address of the new data version node in the data version control linked list can be set according to actual needs.

[0097] In one implementation, the previously existing index list is deleted, and then a new index list is rebuilt based on the nodes contained in the current data version control linked list, and the version identifier of the changed data version and the index address of the new data version node in the data version control linked list are stored in the newly built index list.

[0098] In another implementation, the index address and corresponding version identifier of the new data version node are added to the existing index list to store the version identifier of the changed data version and the index address of the new data version node in the data version control linked list.

[0099] Furthermore, the index list stores the corresponding version identifier in real time along with the newly created data version node, and there is a one-to-one mapping relationship between the version identifier in the index list and the corresponding data version node in the data version control linked list.

[0100] In this embodiment, each time a data version node is created in the data version control linked list, the index list is refreshed in real time and stores the corresponding version identifier, and a one-to-one mapping relationship is established between the data version node and the index list. For specific mapping relationships, see Figure 3 , Figure 3 A diagram showing the relationship between a data version control linked list and an index list mapping provided by another embodiment of the present application. Figure 3As shown, when a version 0 node is created in the data version control linked list, the corresponding version identifier is stored in the index list, that is, version 0 is stored, and the version 0 node is mapped one-to-one with version 0 in the index list. When a version 1 node is created in the data version control linked list, the corresponding version identifier is stored in the index list, that is, version 1 is stored, and the version 1 node is mapped one-to-one with version 1 in the index list, and so on.

[0101] The embodiment of the present application can improve the efficiency of data version query by storing the version identifier of the changed data version and the index address of the new data version node in the data version control linked list in the index list.

[0102] On the basis of the above embodiments, the creation of a new data version node in the data version control linked list in response to a data version change described in S102 includes: determining the number of data version nodes included in the data version control linked list in response to a data version change; if the number of data version nodes is equal to the set maximum number of data version nodes, then in the data version control linked list, the data stored in the first created data version node is stored in the data version node connected to the first created data version node, the first created data version node is deleted, and a new data version node is created at the end of the linked list; or, if the number of data version nodes is equal to the set maximum number of data version nodes, a new data version control linked list is created through distributed storage, and a new data version node is created in the new data version control linked list.

[0103] In one implementation, when the number of data version nodes is equal to the set maximum number of data version nodes, it is necessary to delete the first created data version node in the data version control linked list, and create a new data version node at the end of the linked list. Assuming that the number of data version nodes is 5 and the set maximum number of data version nodes is 5, if you want to create a new data version node at this time, you need to delete the first created data version node and create a new data version node at the end of the linked list.

[0104] In another implementation, when the number of data version nodes is equal to the set maximum number of data version nodes, a new data version control linked list is created through distributed storage, and a new data version node is created in the new data version control linked list. In other words, when the number of data version nodes is equal to the set maximum number of data version nodes, a new data version control linked list is recreated. The created new data version control linked list can be stored in different places.

[0105] The embodiments of the present application provide different implementation methods for creating a new data version control linked list, thereby improving the flexibility and user experience of the data version management method.

[0106] Based on the above embodiment, it also includes: if the first created data version node is deleted in the data version control linked list, and a new data version node is created at the end of the linked list, the index list corresponding to the data version control linked list is updated, and the index list is used to store the version identifier corresponding to the data version node, and the index address of the data version node in the data version control linked list.

[0107] In this embodiment, it can be understood that when deleting the first created data version node in the data version control linked list and creating a new data version node at the end of the linked list, the index list corresponding to the data version control linked list needs to be updated synchronously.

[0108] The embodiments of the present application can achieve real-time management and rapid retrieval of data versions by maintaining the data version control linked list and its mapping relationship with the index list in real time, and can further achieve rapid positioning and backtracking to a specific version of the data state, thereby meeting the requirements of the real-time system for efficient management of data version control.

[0109] Based on the above embodiments, monitoring whether the data version has changed includes at least one of the following: if a data version insertion instruction is monitored, determining that the data version has changed; if a data version update instruction is monitored, determining that the data version has changed; if a data version rollback instruction is monitored, determining that the data version has changed.

[0110] Among them, the purpose of the data version insertion instruction is to create a new data version in the storage system in order to record the data change history and implement data version control. For example, the data version insertion instruction is to call the insert method, and the insert method can calculate the difference data between the current data version and the new data version.

[0111] The data version update instruction is intended to update the data version in the storage system. For example, the data version update instruction is to call an update method, which can change the difference data between the previous data version and the changed data version, and apply the new difference data to the specified version.

[0112] The data version rollback instruction is used to restore data to a specific historical version. For example, the data version rollback instruction is to call the revert To Version method. The revert To Version method can roll back the data version to a specific historical version, and the specific historical version needs to be found through the find method.

[0113] The embodiments of the present application help maintain the quality and reliability of data by monitoring whether the data version has changed, and can also improve the overall management capability and response speed of the data version management method.

[0114] Figure 4 The process of the data version management method provided in the embodiment of the present application Figure 2 .like Figure 4 As shown, the data version management method provided in this embodiment includes the following steps:

[0115] Step S401: Create a data version control linked list, which includes at least one data version node. Each data version node stores version difference data and a version identifier. The version difference data is the difference data between the current data version and the previous data version, and the version identifier is the current data version number.

[0116] The detailed steps have been described in detail in the above embodiments, so they will not be repeated here.

[0117] Step S402: Create an index list for storing version identifiers. The index list stores corresponding version identifiers in real time along with the newly created data version nodes. There is a one-to-one mapping relationship between the version identifiers in the index list and the corresponding data version nodes in the data version control linked list.

[0118] The detailed steps have been described in detail in the above embodiments, so they will not be repeated here.

[0119] Step S403: In response to the first data version insert instruction, calculate and compress the difference data between the first data version and the current data version to obtain the first version difference data.

[0120] The detailed steps have been described in detail in the above embodiments, so they will not be repeated here.

[0121] like Figure 3 As shown, in this embodiment, when the system obtains the version data inserted into version 2, the version data of version 2 is compared and calculated with the version data of version 1 stored in the data version node of version 1, and compressed to obtain the difference version data CompressedDiff1_2. In one embodiment, the ZLIB compression algorithm is used for compression.

[0122] Step S404: Create a first data version node in the data version control linked list, where the first data version node stores first version difference data and a first data version identifier.

[0123] like Figure 3 As shown, in this embodiment, the system creates a new data version node for version 2 in the data version control linked list, and stores the obtained difference version data CompressedDiff1_2 and version 2 in the data version node for version 2.

[0124] Step S405: Update the index list and establish a mapping between the first data version node and the index list. Figure 3As shown, in this embodiment, the index list is updated, version 2 is stored in the index list, and a one-to-one mapping relationship is established between version 2 in the index list and the version 2 data version node in the data version control linked list.

[0125] Figure 5 The process of the data version management method provided in the embodiment of the present application Figure 3 .like Figure 5 As shown, the data version management method provided in this embodiment includes the following steps:

[0126] Step S501: Create a data version control linked list, which includes at least one data version node. Each data version node stores version difference data and a version identifier. The version difference data is the difference data between the current data version and the previous data version, and the version identifier is the current data version number.

[0127] The detailed steps have been described in detail in the above embodiments, so they will not be repeated here.

[0128] Step S502: Create an index list for storing version identifiers. The index list stores corresponding version identifiers in real time along with the newly created data version nodes. There is a one-to-one mapping relationship between the version identifiers in the index list and the corresponding data version nodes in the data version control linked list.

[0129] Step 503: In response to the instruction to update the first target data version, the first target data version identifier in the index list is used to search and obtain the corresponding first target data version node in the data version control linked list.

[0130] Step 504: Calculate the difference data between the second data version and the first target data version, obtain the second version difference data, and compress it.

[0131] Step 505: Create a second data version node, and store the second version difference data and the second data version identifier in the second data version node.

[0132] The detailed steps have been described in detail in the above embodiments, so they will not be repeated here.

[0133] Step 506: Rebuild the mapping relationship between the data version control linked list and the index list.

[0134] The following will be combined Figure 6 , explaining steps S503 to S506, Figure 6 for Figure 5 The flowchart of the data version management method for updating the first target data version provided in the embodiment shown is as follows. Figure 6As shown, in an illustrative example, the version identifier of the first target data version is version 2, and the second data version is newdata. The data version node of version 2 in the data version control linked list is obtained by searching the index list; CompressedDiff1_2 in the data version node of version 2 is decompressed and calculated to obtain the version data of version 2, and the second version difference data CompressedDiffnewdata_2 is obtained after comparing newdata with the version data of version 2 and compressing; a new second data version node is created in the data version control linked list, in which the second version difference data CompressedDiffnewdata_2 and version 2 are stored; the mapping between the data version control linked list and the index list is rebuilt, and the version 2 in the index list is mapped one by one with the second data version node. In this embodiment, a bidirectional linked list is used to save the pointer of the node before the update, and version rollback is supported.

[0135] In another illustrative example, still referring to Figure 6 , the version identifier of the first target data version is version 2, and the second data version is newdata. The data version node of version 1 in the data version control linked list is obtained by searching the index list; CompressedDiff1_1 in the data version node of version 1 is decompressed and the version data of version 1 is calculated to obtain the version data of version 1. Newdata is compared and calculated with the version data of version 1 and compressed to obtain the second version difference data CompressedDiffnewdata_2; a new second data version node is created in the data version control linked list, in which the second version difference data CompressedDiffnewdata_2 and version 2 are stored, and the node points to the next data version node, and the first target data version node is replaced with the second data version node; the mapping between the data version control linked list and the index list is rebuilt, and the version 2 in the index list is mapped one-to-one with the second data version node.

[0136] It should be noted that if there is another version node after the first target data version node, such as Figure 6 If there are other versions after version 2, namely version 3, version 4, ..., then in addition to executing steps S504 and S505, it is also necessary to calculate the difference data between the data version corresponding to the next version node of the first target data version node (here, version 3) and the second data version, obtain the third version difference data, and use the third version difference data to update the difference data stored in the version node corresponding to version 3. Then, execute step S506.

[0137] The data version management method provided in this embodiment can be applied to systems such as sensitive word libraries of instant messaging (IM) applications, and can update corresponding data in real time without replacing or copying the old version as a whole. After each update, only the modified data and changes are stored, thereby saving storage space and processing time.

[0138] Figure 7 The process of the data version management method provided in the embodiment of the present application Figure 4 .like Figure 7 As shown, the data version management method provided in this embodiment includes the following steps:

[0139] Step S701, create a data version control linked list, the linked list includes at least one data version node, each data version node stores version difference data and a version identifier, the version difference data is the difference data between the current data version and the previous data version, and the version identifier is the current data version number.

[0140] Step S702: Create an index list for storing version identifiers. The index list stores corresponding version identifiers in real time along with the newly created data version nodes. There is a one-to-one mapping relationship between the version identifiers in the index list and the corresponding data version nodes in the data version control linked list.

[0141] Step S703: In response to the rollback to the second target data version instruction, a third data version identifier is added to the index list.

[0142] Step S704: Search and obtain the corresponding second target data version node in the data version control linked list through the second target version identifier in the index list.

[0143] Step S705: Create a third data version node in the data version control linked list, and store the second difference data and the third data version identifier in the second target data version node in the third data version node.

[0144] The detailed steps have been described in detail in the above embodiments, so they will not be repeated here.

[0145] Step S706: Establish a mapping relationship between the third data version identifier and the third data version node in the index list.

[0146] The following will be combined Figure 8 , explaining steps S703 to S706, Figure 8 for Figure 7 The flowchart of the data version management method for rolling back to the second target data version provided in the embodiment shown. Figure 8As shown, in this embodiment, the version identifier of the second target data version is version 2, and a third data version identifier is added in the index list as version n+1; the data version node of version 2 in the data version control linked list is retrieved through the version identifier of version 2 in the index list; a data version node of the third data version node version n+1 is created in the data version control linked list, and the difference data CompressedDiff1_2 and the third data version n+1 in the data version node of version 2 are stored in the version n+1 data version node, and point to the next data version node; a one-to-one mapping relationship between the version identifier version n+1 in the index list and the version n+1 data version node in the data version control linked list is established.

[0147] The data version management method provided in this embodiment can be applied to systems such as instant messaging (IMS) application sensitive word libraries. A new data version node is created for each update, which records the history of data changes. When an erroneous operation is found or data needs to be restored, it can be quickly and conveniently rolled back to the previous version.

[0148] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.

[0149] Fig. 9 This is a schematic diagram of the structure of the data version management device provided by this application. Fig. 9 As shown, the data version management device 900 includes:

[0150] Monitoring module 901, used to monitor whether the data version has changed;

[0151] A creation module 902, configured to create a new data version node in a data version control linked list in response to a change in the data version, wherein the data version control linked list includes at least one data version node, each data version node being used to store version difference data and a version identifier;

[0152] The storage module 903 is used to store the version identifier of the changed data version and the version difference data between the data version before the change and the data version after the change in the new data version node.

[0153] In a possible implementation, the storage module 903 is specifically used for:

[0154] Determine the version difference data between the data version before the change and the data version after the change;

[0155] The version difference data is compressed and stored in the new data version node.

[0156] In a possible implementation, the first data version node in the data version control linked list stores the full amount of data of the corresponding data version.

[0157] In a possible implementation, the creation module 902 is specifically used to:

[0158] The index list stores the version identifier of the changed data version and the index address of the new data version node in the data version control linked list. The index list is used for fast retrieval of the data version node in the data version control linked list.

[0159] In a possible implementation, the creation module 902 is specifically used to:

[0160] In response to a change in the data version, determining the number of data version nodes included in the data version control linked list;

[0161] If the number of data version nodes is equal to the set maximum number of data version nodes, then in the data version control linked list, the data stored in the first created data version node is stored in the data version node connected to the first created data version node, the first created data version node is deleted, and a new data version node is created at the end of the linked list;

[0162] Alternatively, if the number of data version nodes is equal to the set maximum number of data version nodes, a new data version control linked list is created through distributed storage, and a new data version node is created in the new data version control linked list.

[0163] In a possible implementation, the data version management device further includes a processing module (not shown), and the processing module is used to:

[0164] If the first created data version node is deleted in the data version control linked list, and a new data version node is created at the end of the linked list, the index list corresponding to the data version control linked list is updated. The index list is used to store the version identifier corresponding to the data version node and the index address of the data version node in the data version control linked list.

[0165] In a possible implementation, the monitoring module 901 is specifically used to:

[0166] If a data version insertion instruction is detected, it is determined that the data version has changed;

[0167] If a data version update instruction is detected, it is determined that the data version has changed;

[0168] If a data version rollback instruction is detected, it is determined that the data version has changed.

[0169] In this embodiment, the data version management device can be applied to large-scale data processing and real-time system environments through the combination of various modules to realize functions such as real-time dynamic data version management and rapid retrieval, thereby improving the flexibility of system dynamic data management and user experience.

[0170] The data version management device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0171] It should be noted that it should be understood that the division of the various modules of the above device is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the processing module can be a separately established processing element, or it can be integrated in a chip of the above device. In addition, it can also be stored in the memory of the above device in the form of program code, and 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. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0172] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more microprocessors (DSP), or one or more field programmable gate arrays (FPGA). For another example, when a module is implemented in the form of a processing element to allocate program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0173] Fig.10 A schematic diagram of the structure of the electronic device provided in this application, such as Fig.10As shown, the electronic device 1000 includes: a memory 1010 and a processor 1020 .

[0174] The memory 1010 stores a computer program that can be executed by at least one processor 1020. The computer program is executed by at least one processor 1020 to enable the data version management device to implement the data query method provided in any of the above embodiments.

[0175] The memory 1010 and the processor 1020 may be connected via a bus 1030 .

[0176] The relevant instructions can be understood by referring to the relevant descriptions and effects corresponding to the method embodiments, which will not be repeated here.

[0177] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed, they are used to implement the method described in any of the aforementioned embodiments.

[0178] Among them, the computer readable storage medium may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.

[0179] An embodiment of the present application provides a computer program product, which includes computer-executable instructions. When the computer-executable instructions are executed by a processor, they are used to implement the method described in any of the aforementioned embodiments.

[0180] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0181] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the application herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not applied for by the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0182] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data version management method, characterized in that: The method comprises: Monitor whether the data version has changed; In response to a data version change, creating a new data version node in a data version control linked list, wherein the data version control linked list includes at least one data version node, each data version node is used to store version difference data and a version identifier; In the new data version node, the version identifier of the changed data version and the version difference data between the data version before the change and the data version after the change are stored.

2. The data version management method according to claim 1, characterized in that: In the new data version node, the version difference data between the data version before the change and the data version after the change is stored, including: Determine the version difference data between the data version before the change and the data version after the change; The version difference data is compressed and stored in the new data version node.

3. The data version management method according to claim 1, characterized in that: The first data version node in the data version control linked list stores the full amount of data of the corresponding data version.

4. The data version management method according to any one of claims 1 to 3, characterized in that: After creating a new data version node in the data version control linked list, it also includes: The index list stores the version identifier of the changed data version and the index address of the new data version node in the data version control linked list. The index list is used for fast retrieval of the data version node in the data version control linked list.

5. The data version management method according to any one of claims 1 to 3, characterized in that: In response to a change in the data version, a new data version node is created in the data version control linked list, including: In response to a change in the data version, determining the number of data version nodes included in the data version control linked list; If the number of data version nodes is equal to the set maximum number of data version nodes, then in the data version control linked list, the data stored in the first created data version node is stored in the data version node connected to the first created data version node, the first created data version node is deleted, and a new data version node is created at the end of the linked list; Alternatively, if the number of data version nodes is equal to the set maximum number of data version nodes, a new data version control linked list is created through distributed storage, and a new data version node is created in the new data version control linked list.

6. The data version management method according to claim 5, characterized in that: Also includes: If the first created data version node is deleted in the data version control linked list, and a new data version node is created at the end of the linked list, the index list corresponding to the data version control linked list is updated. The index list is used to store the version identifier corresponding to the data version node and the index address of the data version node in the data version control linked list.

7. According to any one of claims 1 to 3, the monitoring of whether the data version has changed comprises at least one of the following: If a data version insertion instruction is detected, it is determined that the data version has changed; If a data version update instruction is detected, it is determined that the data version has changed; If a data version rollback instruction is detected, it is determined that the data version has changed.

8. A data version management device, characterized in that: include: Monitoring module, used to monitor whether the data version has changed; A creation module, configured to create a new data version node in a data version control linked list in response to a change in the data version, wherein the data version control linked list includes at least one data version node, each data version node being used to store version difference data and a version identifier; The storage module is used to store, in the new data version node, the version identifier of the changed data version and the version difference data between the data version before the change and the data version after the change.

9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory is used to store computer-executable instructions; The processor is used to execute the computer-executable instruction to implement the data version management method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which, when executed, are used to implement the data version management method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program, characterized in that When the computer program is executed, the data version management method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Data retrieval method under big data environment

    CN104679897A

  • Vehicle type information data version management system and method based on block chain technology

    CN115129689A

  • Structured data version management method and device and related equipment

    CN115878589A

  • Data version control method and equipment

    CN117827783A

  • Snapshot capacity calculation method and device based on multi-version data

    CN117873958A