A method and device for incremental generation and a method and device for data updating

By recording key-value pairs of change operations in the key-value database, merging and versioning, the problem of inefficient incremental recording of key-value databases is solved, and efficient memory usage and system performance is achieved.

CN110147359BActive Publication Date: 2024-11-05BEIJING QIHOOD TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201711330795.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-12-13
Publication Date
2024-11-05
Estimated Expiration
2037-12-13

AI Technical Summary

Technical Problem

The existing key-value database cannot maintain the advantage of key-value storage when recording incremental data, resulting in excessive memory usage and affecting system efficiency.

Method used

By monitoring the changes to the key-value database by external systems, the original key and value corresponding to the change operation are recorded into a preset special key-value pair, and merge and add version numbers if necessary to avoid duplicate recording.

Benefits of technology

Record incremental data while maintaining the advantage of key-value storage, reducing memory usage and improving system efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110147359B_ABST
    Figure CN110147359B_ABST
Patent Text Reader

Abstract

The present invention discloses an incremental generation method and device and a data update method and device, and relates to the field of computer technology. The method comprises: monitoring whether a change operation of a key-value database is received from an external system; if the change operation is received, recording the original key and the corresponding original value corresponding to the change operation into a special value corresponding to a preset special key. The method solves the problem that the existing incremental recording method cannot record the increment under the advantageous condition of the key-value storage form, and achieves the beneficial effect of recording the increment under the advantageous condition of the key-value storage form, avoiding occupying more memory and easily affecting the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to an incremental generation method and device, and a data update method and device. Background Art

[0002] With the rise of web2.0 (second generation internet) websites, traditional relational databases have become unable to cope with web2.0 websites, especially the ultra-large-scale and highly concurrent SNS (Social Networking Services) type web2.0 purely dynamic websites, exposing many difficult-to-overcome problems. Non-relational databases have developed very rapidly due to their own characteristics. The emergence of NoSQL (NoSQL = Not Only SQL) databases is to solve the challenges brought by large-scale data sets and multiple data types, especially the application of big data. Key-value databases are a type of NoSQL database.

[0003] In a key-value database, data is stored in the form of key-value pairs, and key-value storage generally obtains value based on key. When saving, just save the key-value. In a NoSQL database, data is constantly updated, and all the latest customer data can be obtained in real time. However, it is impossible to obtain the real-time change in data, that is, the increment. Moreover, if the increment is recorded in a table, then two tables need to be established for the same data at the same time, one for recording data and one for recording data increments. In this case, the advantages of key-value storage are not available, and more memory is occupied, which is easy to affect the efficiency of system operation. Summary of the invention

[0004] In view of the above problems, the present invention is proposed to provide an incremental generation method and device and a data update method and device that overcome the above problems or at least partially solve the above problems.

[0005] According to one aspect of the present invention, there is provided an incremental generation method, comprising:

[0006] Monitor whether changes to the key-value database are received from external systems;

[0007] If the change operation is received, the original key and the corresponding original value corresponding to the change operation are recorded in the special value corresponding to the preset special key.

[0008] Optionally, before the step of monitoring whether a modification operation of the key-value database is received from an external system, the step further includes:

[0009] Create the special key-special value pair in the key-value database.

[0010] Optionally, the step of recording the original key and the corresponding original value corresponding to the change operation into a special value corresponding to a preset special key includes:

[0011] When the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key;

[0012] When the modification operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key.

[0013] Optionally, the step of recording the original key and the corresponding original value corresponding to the change operation into a special value corresponding to a preset special key includes:

[0014] For the same original key, add the version number in the order in which the corresponding original key and original value are written.

[0015] Optionally, the step of recording the original key and the corresponding original value corresponding to the change operation into a special value corresponding to a preset special key includes:

[0016] Determine whether there is a record of the original key in the special value;

[0017] If there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule.

[0018] According to another aspect of the present invention, there is provided a data updating method, characterized by comprising:

[0019] Receive data update requests from external systems;

[0020] The original key and the corresponding original value are read from the special value of the special key and returned to the external system for updating by the external system; the special value of the special key records the original key and the corresponding original value corresponding to the modification operation on the key-value database.

[0021] Optionally, before the step of receiving the data update request from the external system, the method further includes:

[0022] Monitor whether changes to the key-value database are received from external systems;

[0023] If the change operation is received, the original key and the corresponding original value corresponding to the change operation are recorded in the special value corresponding to the preset special key.

[0024] Optionally, before the step of monitoring whether a modification operation of the key-value database is received from an external system, the step further includes:

[0025] Create the special key-special value pair in the key-value database.

[0026] Optionally, the step of recording the original key and the corresponding original value corresponding to the change operation into a special value corresponding to a preset special key includes:

[0027] When the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key;

[0028] When the modification operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key.

[0029] Optionally, the step of recording the original key and the corresponding original value corresponding to the change operation into a special value corresponding to a preset special key includes:

[0030] For the same original key, add the version number in the order in which the corresponding original key and original value are written.

[0031] Optionally, the step of recording the original key and the corresponding original value corresponding to the change operation into a special value corresponding to a preset special key includes:

[0032] Determine whether there is a record of the original key in the special value;

[0033] If there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule.

[0034] Optionally, when the data update request includes the current version number of the external system, the step of reading the original key and the corresponding original value from the special value of the special key and returning them to the external system for the external system to update includes:

[0035] Find the original key and original value whose version number is after the current version number;

[0036] The original key and the original value after the current version number are returned to the external system so that the external system can update them in the order of the version numbers.

[0037] Optionally, when the data update request includes the current version number of the external system, the step of reading the original key and the corresponding original value from the special value of the special key and returning them to the external system for the external system to update includes:

[0038] In the special value, find the value whose version number is after the current version number;

[0039] The original key and the original value including the value after the current version number are returned to the external system so that the external system can update in the order of the version numbers.

[0040] According to another aspect of the present invention, there is provided an incremental generation device, comprising:

[0041] The change operation monitoring module is used to monitor whether the change operation of the key-value database is received from the external system;

[0042] The change operation recording module is used to record the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received.

[0043] Optionally, before the changing operation monitoring module, the method further includes:

[0044] The special key-value creation module is used to create the special key-special value pair in the key-value database.

[0045] Optionally, the change operation record module includes:

[0046] A first change operation recording submodule is used for, when the change operation is a new operation or a modification operation, writing the original key and the corresponding original value corresponding to the new operation or the modification operation into the special value corresponding to the special key;

[0047] The second change operation recording submodule is used to create the original key corresponding to the deletion operation as the original value of the null value when the change operation is a deletion operation, and write the original key and the original value into the special value corresponding to the special key.

[0048] Optionally, the change operation recording module is also used to add a version number to the same original key according to the writing order of the corresponding original key and original value.

[0049] Optionally, the change operation record module includes:

[0050] The original key record judgment submodule is used to judge whether there is a record of the original key in the special value;

[0051] The original value merging submodule is used to merge the original value of the original key corresponding to the current change operation into the original value of the previous original key if there is a record of the original key in the special value, and add a version number to the value according to a preset rule.

[0052] According to another aspect of the present invention, there is provided a data updating device, characterized in that it comprises:

[0053] A data update request receiving module, used for receiving a data update request from an external system;

[0054] The key-value return module is used to read the original key and the corresponding original value from the special value of the special key and return them to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the change operation on the key-value database.

[0055] Optionally, before the data update request receiving module, it also includes:

[0056] The change operation monitoring module is used to monitor whether the change operation of the key-value database is received from the external system;

[0057] The change operation recording module is used to record the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received.

[0058] Optionally, before the changing operation monitoring module, the method further includes:

[0059] The special key-value creation module is used to create the special key-special value pair in the key-value database.

[0060] Optionally, the change operation record module includes:

[0061] A first change operation recording submodule is used for, when the change operation is a new operation or a modification operation, writing the original key and the corresponding original value corresponding to the new operation or the modification operation into the special value corresponding to the special key;

[0062] The second change operation recording submodule is used to create the original key corresponding to the deletion operation as the original value of the null value when the change operation is a deletion operation, and write the original key and the original value into the special value corresponding to the special key.

[0063] Optionally, the change operation recording module is also used to add a version number to the same original key according to the writing order of the corresponding original key and original value.

[0064] Optionally, the change operation record module includes:

[0065] The original key record judgment submodule is used to judge whether there is a record of the original key in the special value;

[0066] The original value merging submodule is used to merge the original value of the original key corresponding to the current change operation into the original value of the previous original key if there is a record of the original key in the special value, and add a version number to the value according to a preset rule.

[0067] Optionally, when the data update request includes the current version number of the external system, the Key-value returning module includes:

[0068] The original key-value search submodule is used to search for the original key and original value whose version number is after the current version number;

[0069] The first original key-value returning submodule is used to return the original key and original value after the current version number to the external system so that the external system can update them in the order of the version numbers.

[0070] Optionally, when the data update request includes the current version number of the external system, the Key-value returning module includes:

[0071] A value search submodule is used to search for a value whose version number is after the current version number in the special value;

[0072] The second original key-value returning submodule is used to return the original key and the original value including the value after the current version number to the external system, so that the external system can update according to the version number sequence.

[0073] The embodiment of the present invention further discloses a device, including:

[0074] Memory, loaded with multiple executable instructions;

[0075] The processor executes the plurality of executable instructions; the plurality of executable instructions include the aforementioned incremental generation method or data update method.

[0076] According to an incremental generation method of the present invention, it is possible to monitor whether a change operation of a key-value database is received from an external system; if the change operation is received, the original key and the corresponding original value corresponding to the change operation are recorded in a special value corresponding to a preset special key. This solves the problem that the existing incremental recording method cannot record increments under the advantageous conditions of the key-value storage format, and achieves the beneficial effect of recording increments under the advantageous conditions of the key-value storage format, avoiding occupying more memory and easily affecting the system.

[0077] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0079] Figure 1 A flowchart of the steps of an incremental generation method according to an embodiment of the present invention is shown;

[0080] Figure 2 A flowchart of the steps of an incremental generation method according to an embodiment of the present invention is shown;

[0081] Figure 3 A flowchart of a data updating method according to an embodiment of the present invention is shown;

[0082] Figure 4 A flowchart of a data updating method according to an embodiment of the present invention is shown;

[0083] Figure 5 A schematic diagram of the structure of an incremental generation device according to an embodiment of the present invention is shown;

[0084] Figure 6 A schematic diagram of the structure of an incremental generation device according to an embodiment of the present invention is shown;

[0085] Figure 7 A schematic diagram showing the structure of a data updating device according to an embodiment of the present invention is shown; and

[0086] Figure 8 A schematic structural diagram of a data updating device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0087] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0088] Embodiment 1

[0089] An incremental generation method provided by an embodiment of the present invention is introduced in detail.

[0090] Reference Figure 1 , showing a step flow chart of an incremental generation method in an embodiment of the present invention.

[0091] Step 110: monitor whether a modification operation on the key-value database is received from an external system.

[0092] With the rise of web2.0 (second generation internet) websites, traditional relational databases have become unable to cope with web2.0 websites, especially the ultra-large-scale and highly concurrent SNS (Social Networking Services) type web2.0 purely dynamic websites, exposing many difficult-to-overcome problems. Non-relational databases have developed very rapidly due to their own characteristics. The emergence of NoSQL (NoSQL = Not Only SQL) databases is to solve the challenges brought by large-scale data sets with multiple data types, especially the application of big data. NoSQL refers to non-relational databases.

[0093] There are four major categories of NoSQL databases:

[0094] (1) Key-Value storage database. This type of database mainly uses a hash table. In this table, there is a specific key and a pointer to specific data. The key can be used to obtain the value corresponding to the key, that is, the specific data corresponding to the key. The advantage of the Key / value model is that it is simple and easy to deploy. However, if the DBA (Database Administrator) only queries or updates part of the value, Key / value becomes inefficient. For example: Tokyo Cabinet / Tyrant, Redis, Voldemort, OracleBDB, etc.

[0095] (2) Column-store databases. These databases are usually used to handle massive amounts of data in distributed storage. Keys still exist, but their characteristic is that they point to multiple columns. These columns are arranged by column family. Examples include Cassandra, HBase, Riak, etc.

[0096] (3) Document database. The inspiration of document database comes from Lotus Notes office software, and it is similar to the first type of key-value storage. The data model of this type is versioned documents, and semi-structured documents are stored in a specific format, such as JSON. Document database can be regarded as an upgraded version of key-value database, allowing nested keys and values. Moreover, document database has higher query efficiency than key-value database. For example: CouchDB, MongoDb. There is also a document database SequoiaDB in China, which has been open sourced.

[0097] (4) Graph database. Graph-structured databases are different from other row-column and rigid-structured SQL databases. They use a flexible graph model and can be expanded to multiple servers. NoSQL databases do not have a standard query language (SQL (Structured Query Language)), so a data model needs to be developed to perform database queries. Many NoSQL databases have REST (Representational State Transfer)-style data interfaces or query APIs (Application Programming Interfaces). For example: Neo4J, InfoGrid, Infinite Graph, etc.

[0098] In the embodiment of the present invention, in order to obtain the increment of the value change, the above-mentioned key-value storage database can be used, that is, the key-value database saves data, and the key-value database in the embodiment of the present invention can be any key-value database, which is not limited by the embodiment of the present invention.

[0099] Then, for the key-value database, it is possible to monitor whether the modification operation of the key-value database by the external system is received. The external system may be any system other than the system where the current key-value database is located, or any system other than the current key-value database, which is not limited in the embodiment of the present invention. The modification operation of the key-value database by the external system may include the addition operation for key-value pairs, the deletion operation for key-value pairs, the modification operation for key-value pairs, etc., which is not limited in the embodiment of the present invention.

[0100] If any change is detected in the key-value database relative to the initial state, and the change is not caused by the key-value database itself, it can be determined that the key-value database has received the change operation.

[0101] Step 120: If the modification operation is received, the original key and the corresponding original value corresponding to the modification operation are recorded in the special value corresponding to the preset special key.

[0102] If a change operation is received on the key-value database, then in order to generate an increment, the original key and the corresponding original value corresponding to the change operation can be recorded in the special value corresponding to the preset special key. The generation rules of the special key-special value are the same as any other key-value in the key-value database, but the special value corresponding to the special key is used to store the original key and the corresponding original value corresponding to the received change operation. If no change operation is received on the key-value database from an external system, no operation needs to be performed.

[0103] For example, if the currently received change operation is for a change to a key_1-value_1 pair in a key-value database, and if the preset special key is key_n, key_1 and value_1 can be recorded as special values ​​of key_n in the special value corresponding to key_n.

[0104] In the embodiment of the present invention, a special value and a special value corresponding to the special value may be set according to requirements before this step or before any step before this step, and the embodiment of the present invention is not limited to this.

[0105] The process of writing data to a key-value database requires a write operation. The following is a write operation process:

[0106] 1. Execute a tree (disk directory structure display command) search to locate the location where the inserted data is located;

[0107] 2. Lock the parent node of this position;

[0108] 3. Create a new leaf node;

[0109] 4. Write the leaf node. This write operation occurs in memory and returns a number (label), which determines the location where the leaf node is written to the hard disk.

[0110] 5. Modify the reference of the parent node to the leaf node. The parent node holds both the reference to the leaf node in memory and the number of the disk location;

[0111] 6. Mark the parent node as dirty (meaning that the version in memory does not appear on disk);

[0112] 7. Unlock the parent node.

[0113] The read operation of reading data from the data table of the key-value database is much simpler. Just search the tree, locate the leaf node, and retrieve the data.

[0114] The write operation mentioned above does not affect the read operation in memory, because, in order to speed up the read operation, the content of the hard disk data file can be preloaded into the memory at startup. Since only leaf nodes store data, the entire B+ tree needs to be restored based on the loaded leaf nodes. This is undoubtedly a time-consuming operation, but it is worth it. Among them, the B+ tree is a variant of the B-tree required by the file system. The B-tree is a balanced multi-way search tree that is used in the file system.

[0115] Optionally, in the embodiment of the present invention, the step 120 may further include:

[0116] Sub-step 121, when the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key.

[0117] Furthermore, if the change operation is a new operation or a modification operation, then in the embodiment of the present invention, the original key and the corresponding original value corresponding to the new operation or the modification operation can be directly written into the special value corresponding to the special key. The new operation can include adding one or more key-value pairs to the key-value database, and the modification operation can include modifying the value of the key-value pair already in the key-value database. If there is a special need, it can also include modifying the key, which is not limited by the embodiment of the present invention.

[0118] Sub-step 122, when the modification operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value with a null value, and the original key and the original value are written into the special value corresponding to the special key.

[0119] The deletion operation may include deleting a key-value pair, or deleting a value corresponding to a key, etc. If the received change operation is a deletion operation, the original key corresponding to the deletion operation may be created as an original value of a null value, and the original key and the original value may be written into the special value corresponding to the special key.

[0120] For example, if the current deletion operation corresponds to key_2-value_2, then value_2 corresponding to key_2 can be modified to a null value, and the values ​​corresponding to the original key_2 and value_2 can be written into a special key, that is, the special value_n corresponding to the above-mentioned key_n.

[0121] Optionally, in the embodiment of the present invention, step 120 may further include: for the same original key, adding a version number in the order in which the corresponding original key and original value are written.

[0122] In addition, in actual applications, multiple change operations may be performed on the same key-value pair, and the multiple change operations may include different change operations. For example, two modification operations and one deletion operation may be performed on the same key-value pair in sequence, and the specific contents of the two modification operations may be different. In the embodiment of the present invention, in order to record each change operation corresponding to the key-value and the order corresponding to each change operation, the same original key may also be given a version number according to the writing order of the corresponding original key and original value.

[0123] For example, if two modification operations and one deletion operation are performed on the original key_1-value_1 pair respectively, the modification operation and the deletion operation will not change key_1, but will change the value of value_1. Assume that after the first modification operation, the value corresponding to key_1 changes from value_1 to value_2, and after the second modification operation, the value corresponding to key_1 changes from value_2 to value_3. For key_1, the original key and original value written in the value corresponding to the special key in accordance with the above-mentioned modification operation are as follows: key_1 and value_1, key_1 and value_2, key_1 and value_3. In the embodiment of the present invention, the version number can be added according to the writing order of the above-mentioned original key and original value. For example, the version numbers of the key_1 and value_1 written above can be 001, the version numbers of key_1 and value_2 can be 002, and the version numbers of key_1 and value_3 can be 003. If the version number for key_1 is subsequently read as 003, it can be known that it corresponds to the third change operation on the original value corresponding to key_1.

[0124] In the embodiment of the present invention, the specific format and rules of the version number can be set before this step or before any step before this step according to needs, and this embodiment of the present invention does not limit this.

[0125] In the embodiment of the present invention, it is possible to monitor whether a modification operation of the key-value database is received from an external system; if the modification operation is received, the original key and the corresponding original value corresponding to the modification operation are recorded in the special value corresponding to the preset special key. This achieves the beneficial effect of recording increments under the advantageous conditions of the key-value storage form, avoiding occupying a large amount of memory and easily affecting the system.

[0126] In addition, in an embodiment of the present invention, when the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation can be written into the special value corresponding to the special key. When the change operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key. In this way, the increments can be recorded in a corresponding manner for different change operations, thereby improving the accuracy of the increments.

[0127] Embodiment 2

[0128] An incremental generation method provided by an embodiment of the present invention is introduced in detail.

[0129] Reference Figure 2 , showing a step flow chart of an incremental generation method in an embodiment of the present invention.

[0130] Step 210: Create the special key-special value pair in the key-value database.

[0131] In an embodiment of the present invention, in order to record the original key and the corresponding original value corresponding to the change operation, a special key-special value pair can be created in the key-value database in advance. Among them, the original key and the corresponding original value corresponding to the change operation can be recorded in the special value corresponding to the special key. In an embodiment of the present invention, any available method for creating key-value pairs can be used to create special key-special value pairs in the key-value database, and the embodiment of the present invention is not limited to this, but it is necessary to ensure that the specific value of the special key is different from any other key value, and if multiple special key-special value pairs are created, it is also necessary to ensure that the special keys are not completely consistent with each other.

[0132] Step 220: monitor whether a modification operation on the key-value database is received from an external system.

[0133] Step 230: If the modification operation is received, determine whether there is a record of the original key in the special value.

[0134] In the embodiment of the present invention, when recording the modification operation of the key-value pair, the modification operation records for the same key can be merged. Then, when receiving the modification operation of the key-value database from the external system, it is necessary to first determine whether there is a record of the original key corresponding to the currently received modification operation in the special value used to record the original key and the corresponding original value corresponding to the modification operation.

[0135] For example, if the original key and the corresponding original value corresponding to the currently received change operation are key_1-value_1, then it will be determined whether there is a record of key_1 in the special value.

[0136] Step 240: If there is a record of the original key in the special value, the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and a version number is added to the value according to a preset rule.

[0137] If there is a record of the original key corresponding to the currently received change operation in a special value, then in order to generate multiple records in the value for the same original key, the value of the original value of the original key corresponding to the current change operation can be merged into the original value of the previous original key, and the corresponding value is added with a version number according to the preset rule. In this embodiment of the present invention, the specific content of the preset rule can be set before this step or before any step before this step according to needs, and this embodiment of the present invention is not limited to this.

[0138] For example, if two modification operations are performed on the original key_1-value_1 pair, the modification operation and the deletion operation will not change key_1, but will change the value of value_1. Assume that after the first modification operation, the value corresponding to key_1 changes from value_1 to value_2, and after the second modification operation, the value corresponding to key_1 changes from value_2 to value_3. Then suppose that the second change operation for key_1 is currently received. At this time, the original key and the corresponding original value of the first change operation, i.e., key_1 and value_1, have been recorded in the special value, and the version number is 001. Then, the original value of the original key corresponding to the second change operation currently received, i.e., value_2, can be merged into the value_1 of key_1 recorded in the special value. Specifically, value_2 and value_1 can be added together and the summed value can be used as the new value corresponding to key_1, or value_2 and value_1 can be used as the new value corresponding to key_1 in the form of an array or sequence, and so on. In an embodiment of the present invention, the specific merging rule for merging the original value of the original key corresponding to the current change operation into the original value of the previous original key can be set before this step or before any step before this step as needed. This embodiment of the present invention is not limited to this.

[0139] After the merge, in order to identify the change operation corresponding to the original value corresponding to the original key currently recorded in the special value, the version number can be added to the value of the merged original value according to the preset rules. For example, for the merged value recorded in the special value after the second change operation mentioned above, the version number 002 can be added to identify the original key corresponding to the value at this time, that is, key_1 has received two change operations.

[0140] In the embodiment of the present invention, it is possible to monitor whether a modification operation of the key-value database is received from an external system; if the modification operation is received, the original key and the corresponding original value corresponding to the modification operation are recorded in the special value corresponding to the preset special key. This achieves the beneficial effect of recording increments under the advantageous conditions of the key-value storage form, avoiding occupying a large amount of memory and easily affecting the system.

[0141] Moreover, in the embodiment of the present invention, the special key-special value pair can be created in the key-value database before monitoring whether a modification operation of the key-value database is received from an external system, so that the special value used to record the original key corresponding to the modification operation and the corresponding original value can be clearly recorded.

[0142] In addition, in an embodiment of the present invention, for the same original key, a version number can be added according to the writing order of the corresponding original key and original value. Alternatively, it is determined whether there is a record of the original key in the special value; if there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the value is added with a version number according to a preset rule. Thereby, the accuracy of the original key and original value of the record can be improved respectively, and at the same time, the original value of the record is added with a version number, so it is convenient to obtain the change operation order of the original value of each record.

[0143] Embodiment 3

[0144] A data updating method provided by an embodiment of the present invention is introduced in detail.

[0145] Reference Figure 3 , shows a step flow chart of a data updating method in an embodiment of the present invention.

[0146] Step 310: Receive a data update request from an external system.

[0147] In an embodiment of the present invention, a method for updating data in a key-value database is disclosed. First, a data update request sent by an external system needs to be received. In an embodiment of the present invention, the external system can use any available method or device to send a data update request, and the key-value database can also use any available method or device to receive a data update request from the external system, which is not limited in the embodiment of the present invention.

[0148] Moreover, in actual applications, there may be multiple data tables (tables) for storing key-value data in NoSQL, and the key-value pairs stored in each data table are different. In this case, in an embodiment of the present invention, a data table identifier may be set in advance for each data table to uniquely characterize each data table. Then, the data update request may also include the identifier of the data table that needs to be updated. Then, the data table that needs to obtain the original key-original value pair may be determined in the key-value database according to the identifier of the data table, and then the original key and the corresponding original value may be read from the special value corresponding to the special key of the data table and returned to the external system. This embodiment of the present invention is not limited to this.

[0149] Step 320, read the original key and the corresponding original value from the special value of the special key and return them to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the modification operation on the key-value database.

[0150] After receiving the data update request, the original key and the corresponding original value can be read from the special value of the special key in the key-value database and returned to the external system for the external system to update. Specifically, the special value corresponding to the special key can be searched in the key-value database according to the special key, and then the original key and the corresponding original value can be read from the special value. Specifically, all the original keys and the corresponding original values ​​contained in the special value can be obtained, or part of the original keys and the corresponding original values ​​contained in the special value can be obtained, which is not limited in this embodiment of the present invention.

[0151] In an embodiment of the present invention, the data update request may include the original key that needs to be obtained, and then the original key and the corresponding original value corresponding to the original key may be obtained from the special value according to the original key included in the received data update request. Moreover, as in Embodiment 1 and Embodiment 2, the original value of different version numbers corresponding to the same original key may be recorded in the special value, and then the data update request may also include the original key and the version number that need to be obtained, and further, the original key and the corresponding original value corresponding to the original key and the version number may be obtained from the special value according to the original key and the version number included in the received data update request.

[0152] The specific processes of the steps in this embodiment are similar to those of the similar steps in the aforementioned embodiment 1 and embodiment 2, and are not described again here.

[0153] In the embodiment of the present invention, a data update request from an external system can be received; the original key and the corresponding original value can be read from the special value of the special key and returned to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the change operation on the key-value database. Thus, the original key and the corresponding original value can be accurately obtained, and the data of the external system can be updated.

[0154] Embodiment 4

[0155] A data updating method provided by an embodiment of the present invention is introduced in detail.

[0156] Reference Figure 4 , shows a step flow chart of a data updating method in an embodiment of the present invention.

[0157] Step 410: Create the special key-special value pair in the key-value database.

[0158] Step 420: monitor whether a modification operation on the key-value database is received from an external system.

[0159] Step 430: If the modification operation is received, the original key and the corresponding original value corresponding to the modification operation are recorded in the special value corresponding to the preset special key.

[0160] Optionally, in the embodiment of the present invention, step 430 may further include:

[0161] Sub-step A431, when the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key.

[0162] Sub-step A432, when the modification operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value with a null value, and the original key and the original value are written into the special value corresponding to the special key.

[0163] Optionally, in the embodiment of the present invention, step 430 may further include: for the same original key, adding a version number in the order in which the corresponding original key and original value are written.

[0164] Optionally, in the embodiment of the present invention, step 430 may further include:

[0165] Sub-step B431, determine whether there is a record of the original key in the special value.

[0166] Sub-step B432, if there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule.

[0167] Substeps A431 and A432, and substeps B431 and B432 are in parallel. For the same key-value database, only one of the groups may be executed. Of course, if there is a special requirement, both groups may be executed. In the embodiment of the present invention, the specific execution content may be set according to the requirement, which is not limited by the embodiment of the present invention.

[0168] Step 440: Receive a data update request from an external system.

[0169] Step 450, read the original key and the corresponding original value from the special value of the special key and return them to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the modification operation on the key-value database.

[0170] Optionally, in the embodiment of the present invention, when the data update request includes the current version number of the external system, step 450 may further include:

[0171] Sub-step A451, searching for the original key and original value whose version number is after the current version number.

[0172] In an embodiment of the present invention, if the current version number of the external system is included in the data update request, then when the original key and the corresponding original value are read from the special value of the special key and returned to the external system, the original key and original value whose version number is after the current version number can be searched in the special value based on the version number of the original key and original value recorded in the special value.

[0173] For example, if the current version number of the external system included in the data update request is 001, then the original key and original value with a version number after the current version number can be found from the special value of the special key. Assuming that the version number after 001 is 002, the original key and original value with a version number of 002 can be obtained from the special value of the special key.

[0174] Sub-step A452, returning the original key and original value after the current version number to the external system, so that the external system can update according to the version number sequence.

[0175] After finding the original key and original value after the current version number, the original key and original value after the current version number can be returned to the external system for the external system to update in the version number sequence. When the external system updates in the version number sequence, it needs to update the value corresponding to the same original key value in the external system according to the version number sequence of the obtained original key and original value for each original key value.

[0176] Optionally, in the embodiment of the present invention, when the data update request includes the current version number of the external system, step 450 may further include:

[0177] Sub-step B451, searching for a value whose version number follows the current version number in the special value.

[0178] In addition, when the data update request includes the current version number of the external system, in an embodiment of the present invention, when reading the original key and the corresponding original value from the special value of the special key and returning them to the external system, it is also possible to search for the value whose version number is after the current version number in the special value.

[0179] For example, if the current version number is 001, and the version number sequence is 001, 002, 003, and so on, then you can search for the value whose version number is after the current version number in the special value, that is, first search for version number 002. If version number 002 is found, you can stop the search; if version number 002 is not found, you can further search for version number 003, and so on until you find a value whose version number is after the current version number in the special value.

[0180] Sub-step B452, returning the original key and the original value including the value after the current version number to the external system, so that the external system can update according to the version number sequence.

[0181] In the special value, after finding the value whose version number is after the current version number, the original key and the original value including the value after the current version number can be returned to the external system for the external system to update in the order of the version numbers.

[0182] For example, assuming that for the current version number 001, the value corresponding to the version number 002 after the current version number is found to be value_2, and the original value corresponding to value_2 is value_1, then value_1 and value_2 including version number 002 can be returned to the external system for the external system to update in the order of version numbers.

[0183] In the embodiment of the present invention, a data update request from an external system can be received; the original key and the corresponding original value can be read from the special value of the special key and returned to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the change operation on the key-value database. Thus, the original key and the corresponding original value can be accurately obtained, and the data of the external system can be updated.

[0184] Moreover, in the embodiment of the present invention, the special key-special value pair can be created in the key-value database in advance, and monitoring is performed to determine whether a modification operation of the key-value database is received from an external system. If the modification operation is received, the original key and the corresponding original value corresponding to the modification operation are recorded in the special value corresponding to the preset special key, thereby improving the accuracy of the recorded original key and the corresponding original value.

[0185] In addition, in an embodiment of the present invention, when the change operation is a new operation or a modification operation, the original key and the original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key; when the change operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key. Or for the same original key, the version number is added in the order in which the corresponding original key and original value are written. Or it is determined whether there is a record of the original key in the special value; if there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule. And when the current version number of the external system is included in the data update request, the original key and the original value whose version number is after the current version number are searched; the original key and the original value after the current version number are returned to the external system for the external system to update in the order of the version number. When the data update request includes the current version number of the external system, the value whose version number is after the current version number is searched in the special value; the original key and the original value including the value after the current version number are returned to the external system, so that the external system can update according to the version number sequence. This can further improve the accuracy of the original key and original value obtained, and then the external system can be updated according to the version number sequence.

[0186] For the method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.

[0187] Embodiment 5

[0188] An incremental generation device provided by an embodiment of the present invention is introduced in detail.

[0189] Reference Figure 5 , showing a schematic structural diagram of an incremental generation device in an embodiment of the present invention.

[0190] The modification operation monitoring module 510 is used to monitor whether a modification operation on the key-value database is received from an external system.

[0191] The change operation recording module 520 is used to record the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received.

[0192] Optionally, in the embodiment of the present invention, the change operation recording module 520 may further include:

[0193] The first change operation recording submodule is used to write the original key and the corresponding original value corresponding to the new operation or the modification operation into the special value corresponding to the special key when the change operation is a new operation or a modification operation.

[0194] The second change operation recording submodule is used to create the original key corresponding to the deletion operation as the original value of the null value when the change operation is a deletion operation, and write the original key and the original value into the special value corresponding to the special key.

[0195] Optionally, in an embodiment of the present invention, the change operation recording module 520 is further used to add a version number to the same original key according to the writing order of the corresponding original key and original value.

[0196] In the embodiment of the present invention, it is possible to monitor whether a modification operation of the key-value database is received from an external system; if the modification operation is received, the original key and the corresponding original value corresponding to the modification operation are recorded in the special value corresponding to the preset special key. This achieves the beneficial effect of recording increments under the advantageous conditions of the key-value storage form, avoiding occupying a large amount of memory and easily affecting the system.

[0197] In addition, in an embodiment of the present invention, when the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation can be written into the special value corresponding to the special key. When the change operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key. In this way, the increments can be recorded in a corresponding manner for different change operations, thereby improving the accuracy of the increments.

[0198] Embodiment 6

[0199] An incremental generation device provided by an embodiment of the present invention is introduced in detail.

[0200] Reference Figure 6 , showing a schematic structural diagram of an incremental generation device in an embodiment of the present invention.

[0201] The special key-value creation module 610 is used to create the special key-special value pair in the key-value database.

[0202] The modification operation monitoring module 620 is used to monitor whether a modification operation on the key-value database is received from an external system.

[0203] The change operation recording module 630 is used to record the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received.

[0204] Optionally, in the embodiment of the present invention, the change operation recording module 630 may further include:

[0205] The original key record determination submodule 631 is used to determine whether there is a record of the original key in the special value.

[0206] The original value merging submodule 632 is used to merge the original value of the original key corresponding to the current change operation into the original value of the previous original key if there is a record of the original key in the special value, and add a version number to the value according to a preset rule.

[0207] In the embodiment of the present invention, it is possible to monitor whether a modification operation of the key-value database is received from an external system; if the modification operation is received, the original key and the corresponding original value corresponding to the modification operation are recorded in the special value corresponding to the preset special key. This achieves the beneficial effect of recording increments under the advantageous conditions of the key-value storage form, avoiding occupying a large amount of memory and easily affecting the system.

[0208] Moreover, in the embodiment of the present invention, the special key-special value pair can be created in the key-value database before monitoring whether a modification operation of the key-value database is received from an external system, so that the special value used to record the original key corresponding to the modification operation and the corresponding original value can be clearly recorded.

[0209] In addition, in an embodiment of the present invention, for the same original key, a version number can be added according to the writing order of the corresponding original key and original value. Alternatively, it is determined whether there is a record of the original key in the special value; if there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the value is added with a version number according to a preset rule. Thereby, the accuracy of the original key and original value of the record can be improved respectively, and at the same time, the original value of the record is added with a version number, so it is convenient to obtain the change operation order of the original value of each record.

[0210] Embodiment 7

[0211] A data updating device provided by an embodiment of the present invention is introduced in detail.

[0212] Reference Figure 7 , shows a schematic structural diagram of a data updating device in an embodiment of the present invention.

[0213] The data update request receiving module 710 is used to receive a data update request from an external system.

[0214] The key-value return module 720 is used to read the original key and the corresponding original value from the special value of the special key and return them to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the modification operation on the key-value database.

[0215] In the embodiment of the present invention, a data update request from an external system can be received; the original key and the corresponding original value can be read from the special value of the special key and returned to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the change operation on the key-value database. Thus, the original key and the corresponding original value can be accurately obtained, and the data of the external system can be updated.

[0216] Embodiment 8

[0217] A data updating device provided by an embodiment of the present invention is introduced in detail.

[0218] Reference Figure 8 , shows a schematic structural diagram of a data updating device in an embodiment of the present invention.

[0219] The special key-value creation module 810 is used to create the special key-special value pair in the key-value database.

[0220] The modification operation monitoring module 820 is used to monitor whether a modification operation on the key-value database is received from an external system.

[0221] The change operation recording module 830 is used to record the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received.

[0222] Optionally, in the embodiment of the present invention, the change operation recording module 830 may further include:

[0223] The first change operation recording submodule is used to write the original key and the corresponding original value corresponding to the new operation or the modification operation into the special value corresponding to the special key when the change operation is a new operation or a modification operation.

[0224] The second change operation recording submodule is used to create the original key corresponding to the deletion operation as the original value of the null value when the change operation is a deletion operation, and write the original key and the original value into the special value corresponding to the special key.

[0225] Optionally, in an embodiment of the present invention, the change operation recording module 830 is further used to add a version number to the same original key according to the writing order of the corresponding original key and original value.

[0226] Optionally, in the embodiment of the present invention, the change operation recording module 830 may further include:

[0227] The original key record judgment submodule is used to judge whether there is a record of the original key in the special value.

[0228] The original value merging submodule is used to merge the original value of the original key corresponding to the current change operation into the original value of the previous original key if there is a record of the original key in the special value, and add a version number to the value according to a preset rule.

[0229] The data update request receiving module 840 is used to receive a data update request from an external system.

[0230] The key-value return module 850 is used to read the original key and the corresponding original value from the special value of the special key and return them to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the modification operation on the key-value database.

[0231] When the data update request includes the current version number of the external system, the Key-value returning module 850 includes:

[0232] The original key-value search submodule is used to search for the original key and original value whose version number is after the current version number.

[0233] The first original key-value returning submodule is used to return the original key and original value after the current version number to the external system so that the external system can update them in the order of the version numbers.

[0234] When the data update request includes the current version number of the external system, the Key-value returning module 850 includes:

[0235] The value search submodule is used to search for a value whose version number is after the current version number in the special value.

[0236] The second original key-value returning submodule is used to return the original key and the original value including the value after the current version number to the external system, so that the external system can update according to the version number sequence.

[0237] In the embodiment of the present invention, a data update request from an external system can be received; the original key and the corresponding original value can be read from the special value of the special key and returned to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the change operation on the key-value database. Thus, the original key and the corresponding original value can be accurately obtained, and the data of the external system can be updated.

[0238] Moreover, in the embodiment of the present invention, the special key-special value pair can be created in the key-value database in advance, and monitoring is performed to determine whether a modification operation of the key-value database is received from an external system. If the modification operation is received, the original key and the corresponding original value corresponding to the modification operation are recorded in the special value corresponding to the preset special key, thereby improving the accuracy of the recorded original key and the corresponding original value.

[0239] In addition, in an embodiment of the present invention, when the change operation is a new operation or a modification operation, the original key and the original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key; when the change operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key. Or for the same original key, the version number is added in the order in which the corresponding original key and original value are written. Or it is determined whether there is a record of the original key in the special value; if there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule. And when the current version number of the external system is included in the data update request, the original key and the original value whose version number is after the current version number are searched; the original key and the original value after the current version number are returned to the external system for the external system to update in the order of the version number. When the data update request includes the current version number of the external system, the value whose version number is after the current version number is searched in the special value; the original key and the original value including the value after the current version number are returned to the external system, so that the external system can update according to the version number sequence. This can further improve the accuracy of the original key and original value obtained, and then the external system can be updated according to the version number sequence.

[0240] An embodiment of the present invention further provides a device comprising: a memory loaded with a plurality of executable instructions;

[0241] The processor executes the plurality of executable instructions; the plurality of executable instructions include the aforementioned incremental generation method or data update method.

[0242] The memory may be a readable storage medium, such as a magnetic disk, a hard disk, etc.

[0243] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0244] The algorithm and display provided herein are not inherently related to any particular computer, virtual system or other device. Various general purpose systems can also be used together with the teachings based on this. According to the above description, it is obvious that the structure required for constructing such systems. In addition, the present invention is not directed to any specific programming language either. It should be understood that various programming languages ​​can be utilized to realize the content of the present invention described herein, and the description of the above specific languages ​​is for disclosing the best mode of the present invention.

[0245] In the description provided herein, a large number of specific details are described. However, it is understood that embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures and techniques are not shown in detail so as not to obscure the understanding of this description.

[0246] Similarly, it should be understood that in order to streamline the present disclosure and aid in understanding one or more of the various inventive aspects, in the above description of exemplary embodiments of the present invention, various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, this disclosed method should not be interpreted as reflecting the intention that the claimed invention requires more features than those explicitly recited in each claim. More specifically, as reflected in the claims below, inventive aspects lie in less than all the features of the individual embodiments disclosed above. Therefore, the claims that follow the specific embodiment are hereby expressly incorporated into the specific embodiment, with each claim itself serving as a separate embodiment of the present invention.

[0247] Those skilled in the art will appreciate that the modules in the devices in the embodiments may be adaptively changed and arranged in one or more devices different from the embodiments. The modules or units or components in the embodiments may be combined into one module or unit or component, and in addition they may be divided into a plurality of submodules or subunits or subcomponents. Except that at least some of such features and / or processes or units are mutually exclusive, all features disclosed in this specification (including the accompanying claims, abstracts and drawings) and all processes or units of any method or device disclosed in this manner may be combined in any combination. Unless otherwise expressly stated, each feature disclosed in this specification (including the accompanying claims, abstracts and drawings) may be replaced by an alternative feature providing the same, equivalent or similar purpose.

[0248] In addition, those skilled in the art will appreciate that, although some embodiments described herein include certain features included in other embodiments but not other features, the combination of features of different embodiments is meant to be within the scope of the present invention and form different embodiments. For example, in the claims below, any one of the claimed embodiments may be used in any combination.

[0249] The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. It should be understood by those skilled in the art that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the incremental generation device and data update device according to an embodiment of the present invention. The present invention may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for executing part or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.

[0250] It should be noted that the above embodiments illustrate the present invention rather than limit it, and that those skilled in the art may devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be construed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present invention may be implemented by means of hardware comprising a number of different elements and by means of a suitably programmed computer. In a unit claim enumerating a number of devices, several of these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc., does not indicate any order. These words may be interpreted as names.

[0251] The present application discloses A1, an incremental generation method, comprising:

[0252] Monitor whether changes to the key-value database are received from external systems;

[0253] If the change operation is received, the original key and the corresponding original value corresponding to the change operation are recorded in the special value corresponding to the preset special key.

[0254] A2. The method described in A1, before the step of monitoring whether a modification operation of the key-value database is received from an external system, further comprises:

[0255] Create the special key-special value pair in the key-value database.

[0256] A3. As described in A1, the step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key comprises:

[0257] When the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key;

[0258] When the modification operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key.

[0259] A4. The method as described in any one of A1-A3, wherein the step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key comprises:

[0260] For the same original key, add the version number in the order in which the corresponding original key and original value are written.

[0261] A5. The method as described in any one of A1-A3, wherein the step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key comprises:

[0262] Determine whether there is a record of the original key in the special value;

[0263] If there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule.

[0264] The present application also discloses B6, a data updating method, comprising:

[0265] Receive data update requests from external systems;

[0266] The original key and the corresponding original value are read from the special value of the special key and returned to the external system for updating by the external system; the special value of the special key records the original key and the corresponding original value corresponding to the modification operation on the key-value database.

[0267] B7. The method as described in B6, before the step of receiving the data update request from the external system, further comprising:

[0268] Monitor whether changes to the key-value database are received from external systems;

[0269] If the change operation is received, the original key and the corresponding original value corresponding to the change operation are recorded in the special value corresponding to the preset special key.

[0270] B8. The method as described in B7, before the step of monitoring whether the modification operation of the key-value database is received from the external system, further includes:

[0271] Create the special key-special value pair in the key-value database.

[0272] B9. As described in B7, the step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key comprises:

[0273] When the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key;

[0274] When the modification operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key.

[0275] B10. The method as described in any one of B7-B9, wherein the step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key comprises:

[0276] For the same original key, add the version number in the order in which the corresponding original key and original value are written.

[0277] B11. The method as described in any one of B7-B9, wherein the step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key comprises:

[0278] Determine whether there is a record of the original key in the special value;

[0279] If there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule.

[0280] B12. As described in the method of B10, when the data update request includes the current version number of the external system, the step of reading the original key and the corresponding original value from the special value of the special key and returning them to the external system for the external system to update includes:

[0281] Find the original key and original value whose version number is after the current version number;

[0282] The original key and the original value after the current version number are returned to the external system so that the external system can update them in the order of the version numbers.

[0283] B13. As described in the method of B11, when the data update request includes the current version number of the external system, the step of reading the original key and the corresponding original value from the special value of the special key and returning them to the external system for the external system to update includes:

[0284] In the special value, find the value whose version number is after the current version number;

[0285] The original key and the original value including the value after the current version number are returned to the external system so that the external system can update in the order of the version numbers.

[0286] The present application also discloses C14, an incremental generation device, comprising:

[0287] The change operation monitoring module is used to monitor whether the change operation of the key-value database is received from the external system;

[0288] The change operation recording module is used to record the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received.

[0289] C15. The device as described in C14, before changing the operation monitoring module, further includes:

[0290] The special key-value creation module is used to create the special key-special value pair in the key-value database.

[0291] C16. The device as described in C14, wherein the change operation record module comprises:

[0292] A first change operation recording submodule is used for, when the change operation is a new operation or a modification operation, writing the original key and the corresponding original value corresponding to the new operation or the modification operation into the special value corresponding to the special key;

[0293] The second change operation recording submodule is used to create the original key corresponding to the deletion operation as the original value of the null value when the change operation is a deletion operation, and write the original key and the original value into the special value corresponding to the special key.

[0294] C17. In the device as described in any one of C14-C16, the change operation recording module is also used to add a version number to the same original key according to the writing order of the corresponding original key and original value.

[0295] C18. The device as described in any one of C14-C16, wherein the change operation record module comprises:

[0296] The original key record judgment submodule is used to judge whether there is a record of the original key in the special value;

[0297] The original value merging submodule is used to merge the original value of the original key corresponding to the current change operation into the original value of the previous original key if there is a record of the original key in the special value, and add a version number to the value according to a preset rule.

[0298] The present application also discloses D19, a data updating device, comprising:

[0299] A data update request receiving module, used for receiving a data update request from an external system;

[0300] The key-value return module is used to read the original key and the corresponding original value from the special value of the special key and return them to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the change operation on the key-value database.

[0301] D20. The device as described in D19, before the data update request receiving module, further includes:

[0302] The change operation monitoring module is used to monitor whether the change operation of the key-value database is received from the external system;

[0303] The change operation recording module is used to record the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received.

[0304] D21. The device as described in D20, before the changing operation monitoring module, further includes:

[0305] The special key-value creation module is used to create the special key-special value pair in the key-value database.

[0306] D22. The device as described in D20, wherein the change operation recording module comprises:

[0307] A first change operation recording submodule is used for, when the change operation is a new operation or a modification operation, writing the original key and the corresponding original value corresponding to the new operation or the modification operation into the special value corresponding to the special key;

[0308] The second change operation recording submodule is used to create the original key corresponding to the deletion operation as the original value of the null value when the change operation is a deletion operation, and write the original key and the original value into the special value corresponding to the special key.

[0309] D23. In the device as described in any one of D20-D22, the change operation recording module is also used to add a version number to the same original key according to the writing order of the corresponding original key and original value.

[0310] D24. In the device as described in any one of D20-D22, the change operation record module comprises:

[0311] The original key record judgment submodule is used to judge whether there is a record of the original key in the special value;

[0312] The original value merging submodule is used to merge the original value of the original key corresponding to the current change operation into the original value of the previous original key if there is a record of the original key in the special value, and add a version number to the value according to a preset rule.

[0313] D25. The device as described in D23, when the data update request includes the current version number of the external system, the Key-value returning module includes:

[0314] The original key-value search submodule is used to search for the original key and original value whose version number is after the current version number;

[0315] The first original key-value returning submodule is used to return the original key and original value after the current version number to the external system so that the external system can update them in the order of the version numbers.

[0316] D26. The device as described in D24, when the data update request includes the current version number of the external system, the Key-value returning module includes:

[0317] A value search submodule is used to search for a value whose version number is after the current version number in the special value;

[0318] The second original key-value returning submodule is used to return the original key and the original value including the value after the current version number to the external system, so that the external system can update according to the version number sequence.

[0319] E27. A device comprising:

[0320] Memory, loaded with multiple executable instructions;

[0321] A processor executes the multiple executable instructions; the multiple executable instructions include the method described in any one of claims A1-A5 and B6-B13.

Claims

1. An incremental generation method, comprising: Create special key-special value pairs in the key-value database; Monitor whether changes to the key-value database are received from external systems; If the change operation is received, the original key and the corresponding original value corresponding to the change operation are recorded in the special value corresponding to the preset special key; The step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key includes: When the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key; When the modification operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key.

2. The method according to claim 1, characterized in that: The step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key includes: For the same original key, add the version number in the order in which the corresponding original key and original value are written.

3. The method according to claim 1, characterized in that The step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key includes: Determine whether there is a record of the original key in the special value; If there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule.

4. A data updating method, characterized in that: include: Create special key-special value pairs in the key-value database; Monitor whether changes to the key-value database are received from external systems; If the change operation is received, the original key and the corresponding original value corresponding to the change operation are recorded in the special value corresponding to the preset special key; Receive data update requests from external systems; From the special value of the special key, the original key and the corresponding original value are read and returned to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the modification operation on the key-value database; The step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key includes: When the change operation is a new operation or a modification operation, the original key and the corresponding original value corresponding to the new operation or the modification operation are written into the special value corresponding to the special key; When the modification operation is a deletion operation, the original key corresponding to the deletion operation is created as an original value of a null value, and the original key and the original value are written into the special value corresponding to the special key.

5. The method according to claim 4, characterized in that The step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key includes: For the same original key, add the version number in the order in which the corresponding original key and original value are written.

6. The method according to claim 4, characterized in that The step of recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key includes: Determine whether there is a record of the original key in the special value; If there is a record of the original key in the special value, the value of the original value of the original key corresponding to the current change operation is merged into the original value of the previous original key, and the version number is added to the value according to the preset rule.

7. The method according to claim 5, characterized in that When the data update request includes the current version number of the external system, the step of reading the original key and the corresponding original value from the special value of the special key and returning them to the external system for the external system to update includes: Find the original key and original value whose version number is after the current version number; The original key and the original value after the current version number are returned to the external system so that the external system can update them in the order of the version numbers.

8. The method according to claim 6, characterized in that When the data update request includes the current version number of the external system, the step of reading the original key and the corresponding original value from the special value of the special key and returning them to the external system for the external system to update includes: In the special value, find the value whose version number is after the current version number; The original key and the original value including the value after the current version number are returned to the external system so that the external system can update in the order of the version numbers.

9. An incremental generation device, comprising: Special key-value creation module, used to create special key-special value pairs in the key-value database; The change operation monitoring module is used to monitor whether the change operation of the key-value database is received from the external system; A change operation recording module, for recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received; The modification operation record module includes: A first change operation recording submodule is used for, when the change operation is a new operation or a modification operation, writing the original key and the corresponding original value corresponding to the new operation or the modification operation into the special value corresponding to the special key; The second change operation recording submodule is used to create the original key corresponding to the deletion operation as the original value of the null value when the change operation is a deletion operation, and write the original key and the original value into the special value corresponding to the special key.

10. The device according to claim 9, characterized in that The change operation recording module is also used to add a version number to the same original key according to the writing order of the corresponding original key and original value.

11. The device according to claim 9, characterized in that The modification operation record module includes: The original key record judgment submodule is used to judge whether there is a record of the original key in the special value; The original value merging submodule is used to merge the original value of the original key corresponding to the current change operation into the original value of the previous original key if there is a record of the original key in the special value, and add a version number to the value according to a preset rule.

12. A data updating device, characterized in that: include: A special key-value creation module, used to create the special key-special value pair in the key-value database; The change operation monitoring module is used to monitor whether the change operation of the key-value database is received from the external system; A change operation recording module, for recording the original key and the corresponding original value corresponding to the change operation into the special value corresponding to the preset special key if the change operation is received; A data update request receiving module, used for receiving a data update request from an external system; A key-value return module is used to read the original key and the corresponding original value from the special value of the special key and return them to the external system for the external system to update; the special value of the special key records the original key and the corresponding original value corresponding to the modification operation on the key-value database; The modification operation record module includes: A first change operation recording submodule is used for, when the change operation is a new operation or a modification operation, writing the original key and the corresponding original value corresponding to the new operation or the modification operation into the special value corresponding to the special key; The second change operation recording submodule is used to create the original key corresponding to the deletion operation as the original value of the null value when the change operation is a deletion operation, and write the original key and the original value into the special value corresponding to the special key.

13. The device according to claim 12, characterized in that The change operation recording module is also used to add a version number to the same original key according to the writing order of the corresponding original key and original value.

14. The device according to claim 12, characterized in that The modification operation record module includes: The original key record judgment submodule is used to judge whether there is a record of the original key in the special value; The original value merging submodule is used to merge the original value of the original key corresponding to the current change operation into the original value of the previous original key if there is a record of the original key in the special value, and add a version number to the value according to a preset rule.

15. The device according to claim 13, characterized in that When the data update request includes the current version number of the external system, the Key-value returning module includes: The original key-value search submodule is used to search for the original key and original value whose version number is after the current version number; The first original key-value returning submodule is used to return the original key and original value after the current version number to the external system so that the external system can update them in the order of the version numbers.

16. The device according to claim 14, characterized in that When the data update request includes the current version number of the external system, the Key-value returning module includes: A value search submodule is used to search for a value whose version number is after the current version number in the special value; The second original key-value returning submodule is used to return the original key and the original value including the value after the current version number to the external system, so that the external system can update according to the version number sequence.