Distributed graph database attribute data updating method and system

By using the RAFT protocol synchronous attribute definition and two-layer bitmap encoding method in the distributed graph database, the problem of transmission of useless data and redundant attribute names is solved, and the data transmission efficiency is improved.

CN120144596APending Publication Date: 2025-06-13GLOBAL ENERGY INTERCONNECTION RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311713338.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-12-13
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

In the communication process of property data changes in distributed graph database, the unchanged attribute data is transmitted and the attribute name is transmitted multiple times, resulting in inefficient data transmission.

Method used

The synchronous transmission mechanism based on the RAFT distributed protocol is adopted to keep the attribute definitions of both parties in the transmission, and the property data of the graph database is incrementally updated and only the changed attribute data is transmitted.

Benefits of technology

It avoids the transmission of unchanged attribute data and the transmission of redundant attribute names, improves the efficiency of attribute data transmission, and reduces the cost of data transmission.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144596A_ABST
    Figure CN120144596A_ABST
Patent Text Reader

Abstract

The invention provides a distributed graph database attribute data updating method and system, and the method comprises the steps: carrying out the synchronous transmission of attribute definition lists of two parties based on an RAFT distributed protocol, and maintaining the consistent attribute definition of the two transmission parties; and updating the attribute data increment of the graph database by adopting a modified attribute coding mode of a double-layer bitmap based on the attribute definition lists of the two parties participating in the graph database. According to the method, the consistency data updating capacity based on a distributed graph database RAFT protocol is introduced, an incremental transmission mode for changing graph data attributes is provided, a technology for assigning and transmitting the changed attributes in a bitmap mode based on point and edge attributes is provided, transmission of redundant keys is avoided, and the attribute data transmission efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed graph databases, and particularly to a method and system for updating attribute data of a distributed graph database. Background Art

[0002] With the explosive development of the Internet, mobile Internet, social networks, Internet of Things, and industrial domain-related networks such as power networks, there is a great demand for the storage of relational graphs and applications such as network topology analysis and functional analysis based on relational graphs, which has also contributed to the research and development boom of graph databases.

[0003] A graph database is a data management system that uses points and edges as basic storage units and is designed to efficiently store and query graph data.

[0004] In a distributed database management system, it means that data is stored in different local databases respectively, managed by different local database management systems, runs on different machines, is connected by different communication networks, and is presented as an overall database management system in terms of product form. A distributed database is logically a unified whole, but physically stored on different physical nodes. From the user's perspective, a distributed database system is the same as a centralized database system logically, and users can execute global applications at any site. It seems that the data is stored on the same computer and managed by a single database management system (DBMS), and users don't feel any difference.

[0005] For a distributed graph database, in addition to read-only queries that do not change graph data, graph data modification operations are also common data operations, including:

[0006] 1) Creation operations for point and edge data;

[0007] 2) Update operations for point and edge data;

[0008] 3) Deletion operations for point and edge data.

[0009] For the change operations of point and edge data in a graph instance, one type involves operations on the point and edge elements themselves, such as creating or deleting a point or an edge. Another type involves change operations on the attributes of point and edge elements, such as updating the value of an attribute for a certain point or edge. These two operations together form the basic data operations of a graph database.

[0010] For the change operations of point and edge element attributes, in addition to the actual "change" operation, the creation operations of point and edge elements also involve changes in attribute data:

[0011] When creating point and edge elements, certain attribute values are explicitly specified, and these attribute values belong to the "changed" data;

[0012] When creating point and edge elements, the values of some attributes may not be specified. These attributes with "unspecified values" can be considered as null values / NULL values (some databases will set default values for these attributes).

[0013] In a distributed system, a consensus algorithm allows a group of machines to work as a whole and continue to work even if some of the machines fail. Because of this, consensus algorithms (such as Paxos, RAFT, etc.) play an important role in building reliable large-scale distributed software systems. The Raft protocol splits the core content of the consensus protocol into several key phases, including leader selection and log replication, thus simplifying the process and improving the understandability of the protocol.

[0014] Point and edge change operations in a typical distributed graph database usually involve multiple server nodes in a distributed cluster. Since distributed graph databases usually provide redundant backups of partitioned data through a consensus protocol, point and edge update operations will involve updates to multiple redundant backup node servers in the cluster.

[0015] After the attributes of points and edges in a distributed graph database are updated, when performing such cross-network node updates, when changing the attributes of a specific point or edge and communicating among distributed server nodes to notify the change of attribute values, the communication methods of attribute data usually include the following:

[0016] Send all attributes of a certain point (or edge), including the attributes updated by this change operation and the unupdated attributes, from one node to another or multiple server nodes for update;

[0017] Send the values of one or more attributes changed to a certain point (or edge) in the form of key-value pairs from one server node to another or multiple nodes. In this case, the "key" of the key-value pair specifies the name of the attribute that the point (or edge) is changed to, and the "value" specifies the changed attribute value of the point (or edge). When communicating between nodes in this way, only the updated partial attributes are involved, and the unupdated attributes are not involved.

[0018] Analyzing the inter-node data communication during the above common attribute data changes in a distributed graph database, we can see that the problems with these methods are:

[0019] For the communication method that transmits "all attributes of a point (or an edge)", the data transmitted includes both the data of the attributes changed in the current operation and the data of the attributes that have not been changed. The values of these "unchanged" attributes will not be used ultimately. Therefore, useless data is actually transmitted during the communication process of attribute data change;

[0020] When transmitting the attributes changed to a point (or an edge) through "key-value pairs", both the "key" and the "value" need to be transmitted for each involved attribute, where the "key" is the attribute name. In this case, for points (or edges) of the same Schema (i.e., the same type), when multiple points or edges change to the value of the same attribute, the same "key" - that is, the attribute name - will be transmitted multiple times. For a database system with a point and edge scale that may reach tens of billions, hundreds of billions, or even trillions in a graph database, the "keys" (attribute names) of the attributes of the points (or edges) transmitted repeatedly bring a large amount of redundancy and increase the data transmission cost. Summary of the Invention

[0021] To solve the problems that the existing technology transmits the data of the attributes that have not been changed during the communication process of attribute data change and also transmits the attribute names multiple times, the present invention proposes a method for updating attribute data of a distributed graph database, including:

[0022] Synchronously transmit the attribute definition lists of both participating parties based on the RAFT distributed protocol to keep the attribute definitions of both transmitting parties consistent;

[0023] Update the incremental attribute data of the graph database by using a two-layer bitmap-based changed attribute encoding method based on the attribute definition lists of both participating parties.

[0024] Optionally, the updating the incremental attribute data of the graph database by using a two-layer bitmap-based changed attribute encoding method based on the attribute definition lists of both participating parties includes:

[0025] Use the first-layer bitmap to mark the changed attributes in the ordered attribute list in the graph database Schema;

[0026] Based on the changed attributes marked by the first-layer bitmap, use the second-layer bitmap to mark the attributes that are set to null values or default values in the ordered attribute list in the graph database Schema;

[0027] Update the attribute data of the points or edges in the graph database based on the changed attributes marked by the first-layer bitmap and the attributes marked by the second-layer bitmap.

[0028] Optionally, using the first - layer change bitmap to mark the changed attributes in the ordered attribute list in the graph database Schema includes:

[0029] According to the number of all attributes in the Schema, representing one attribute with one bit, calculating the number of bits, and aligning with one byte to obtain the minimum number of bytes representing all attribute numbers;

[0030] Set subscripts for each bit starting from 0 from left to right, and each bit represents one attribute;

[0031] If a certain attribute has changed during the update operation, the value of the bit corresponding to the certain attribute is 1, otherwise it is 0.

[0032] Optionally, using the second - layer bitmap to mark the attributes set to null values or default values in the ordered attribute list in the graph database Schema based on the changed attributes marked by the first - layer bitmap includes:

[0033] For each bit set to 1 in the first - layer bitmap, introduce a subscript, and the subscript starts from 0;

[0034] According to the number of bits set to 1 in the first - layer bitmap, align with 8 bits and calculate the number of bytes as the number of bytes of the second - layer bitmap;

[0035] Corresponding to the bits set to 1 in the first - layer bitmap, when the updated value of a certain bit is set to null / NULL value, set the value of the bit corresponding to the subscript of the first - layer bitmap in the second - layer bitmap to 1.

[0036] Optionally, updating the attribute data of the points or edges of the graph database based on the changed attributes marked by the first - layer bitmap and the attributes marked by the second - layer bitmap includes:

[0037] Only update the attribute data of the points or edges of the graph database that are marked as changed attributes by the first - layer bitmap and not marked in the second - layer bitmap.

[0038] Optionally, synchronously transmitting the attribute definition lists of both participating parties based on the RAFT distributed protocol to keep the attribute definitions of both transmitting parties consistent, including:

[0039] The distributed graph database obtains the attribute list of the Schema corresponding to a certain type of point or edge through the synchronization operation of the attribute list in the RAFT distributed protocol;

[0040] All parties participating in the operation of the distributed graph database update the attribute list in the synchronization manner in the RAFT distributed protocol to keep the attribute definitions of both transmitting parties consistent.

[0041] On the other hand, the present invention also provides a distributed graph database attribute data update system, including:

[0042] A consistency definition module, configured to synchronously transmit the attribute definition lists of both participating parties based on the RAFT distributed protocol, and keep the attribute definitions of both transmitting parties consistent;

[0043] A marker update module, configured to update the increment of the attribute data of the graph database by using a two-layer bitmap change attribute coding method based on the attribute definition lists of both participating parties.

[0044] Optionally, it is characterized in that the marker update module includes:

[0045] A first marker sub-module, configured to mark the changed attributes in the ordered attribute list in the graph database Schema by using the first-layer bitmap;

[0046] A second marker sub-module, configured to mark the attributes set to null values or default values in the ordered attribute list in the graph database Schema by using the second-layer bitmap based on the changed attributes marked by the first-layer bitmap;

[0047] An update sub-module, configured to update the attribute data of the points or edges in the graph database based on the changed attributes marked by the first-layer bitmap and the attributes marked by the second-layer bitmap.

[0048] Optionally, the first marker sub-module is specifically configured to:

[0049] According to the number of all attributes in the Schema, using one bit to represent one attribute, calculate the number of bits, and align with one byte to obtain the minimum number of bytes representing the number of all attributes;

[0050] Set subscripts for each bit starting from 0 from left to right, and each bit represents one attribute;

[0051] If a certain attribute has changed during the update operation, the value of the bit of the certain attribute is 1, otherwise it is 0.

[0052] Optionally, the second marker sub-module is specifically configured to:

[0053] For the first-layer bitmap, introduce subscripts for each bit set to 1, and the subscripts start from 0;

[0054] Align with 8 bits according to the number of bits set to 1 in the first-layer bitmap, calculate the number of bytes, and use it as the number of bytes of the second-layer bitmap;

[0055] Corresponding to the bits set to 1 in the first-layer bitmap, when the update value of a certain bit is set to null / NULL value, set the value of the corresponding bit in the second-layer bitmap to 1.

[0056] Optionally, the update sub-module is specifically configured to:

[0057] Only update the changed attributes of the first-layer bitmap markers and the attribute data of the points or edges in the second-layer bitmap that are not marked in the graph database.

[0058] Optionally, the consistency definition module is specifically configured to:

[0059] The distributed graph database obtains the attribute list of the Schema corresponding to a certain type of point or edge through the synchronization operation of the attribute list in the RAFT distributed protocol;

[0060] All parties participating in the operation of the distributed graph database update the attribute list in the synchronization manner in the RAFT distributed protocol to keep the attribute definitions of both parties in transmission consistent.

[0061] On the other hand, the present application also provides a computing device, including: one or more processors;

[0062] The processor is configured to execute one or more programs;

[0063] When the one or more programs are executed by the one or more processors, a method for updating attribute data of a distributed graph database as described above is implemented.

[0064] On the other hand, the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed, a method for updating attribute data of a distributed graph database as described above is implemented.

[0065] Compared with the prior art, the beneficial effects of the present invention are:

[0066] The present invention provides a method for updating attribute data of a distributed graph database, including: synchronously transmitting the attribute definition lists of both parties participating in the transmission based on the RAFT distributed protocol to keep the attribute definitions of both parties in transmission consistent; updating the increment of the attribute data of the graph database by using a double-layer bitmap change attribute coding method based on the attribute definition lists of both parties. The present invention introduces the consistency data update ability based on the RAFT protocol of the distributed graph database, proposes an incremental transmission method for changing the attributes of the graph data, provides a bitmap method based on point and edge attributes to specify and transmit the changed attributes, avoids the transmission of redundant keys, and improves the transmission efficiency of attribute data. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 It is a flowchart of a method for updating attribute data of a distributed graph database according to the present invention;

[0068] Figure 2Flowchart of the method for updating attribute data of a distributed graph database based on RAFT of the present invention. Detailed implementation mode

[0069] The present invention proposes a method and system for updating attribute data of a distributed graph database. Based on the RAFT protocol in a distributed environment, a consistent incremental update mechanism for updating attribute data of a distributed graph database is proposed; a two-layer bitmap communication method for updating attribute data of a graph database is also proposed. For the scenario of updating graph structure data with multiple attributes, this communication method only transmits the value data of the attributes with data changes, avoiding the transmission of unchanged attribute data, the transmission of attribute keys / attribute names, and the transmission of attribute values set to NULL / empty values.

[0070] Example 1:

[0071] A method for updating attribute data of a distributed graph database, as Figure 1 shown, includes:

[0072] Step S1: Synchronously transmit the attribute definition lists of both participating parties based on the RAFT distributed protocol to keep the attribute definitions of both transmitting parties consistent;

[0073] Step S2: Update the incremental attribute data of the graph database by using the changed attribute coding method of a two-layer bitmap based on the attribute definition lists of the participating parties.

[0074] The present invention introduces an incremental update mechanism for vertex and edge attribute data based on the RAFT distributed protocol. This mechanism only transmits the changed attributes and does not transmit the unchanged attributes, so it is a consistent attribute change incremental transmission method;

[0075] Introduce a method for specifying "changed" attributes based on "bitmap" to specify the list of attributes changed during the transmission process, providing clear and consistent attribute change coding information.

[0076] The following combines Figure 2 to introduce the present invention in detail:

[0077] Introduce a consistent data operation and "incremental" transmission mode for graph vertex and edge data based on the RAFT distributed protocol.

[0078] For a database system, ACID (A - atomicity, C - consistency, I - isolation, D - durability) are the characteristics that the system needs to ensure during data operations. Data consistency and isolation operations are one of its core requirements. The present invention introduces the incremental update of attribute data of a graph database based on the RAFT distributed protocol to provide processing characteristics that meet consistency and isolation. Specifically:

[0079] Introduce RAFT to ensure the consistency of data among multiple nodes. The introduction of RAFT provides the characteristics of ordered replication and execution among multiple nodes. When the initial states of multiple nodes are the same, it ensures the consistency of states among nodes. In this way, when there are updates to attribute data among different nodes in a partition, RAFT ensures the consistency of different operations among nodes at the micro level;

[0080] On the basis of introducing RAFT, when performing attribute data updates for vertex and edge elements on each single - partition server, incremental updates are introduced:

[0081] On the same node, each update of vertex and edge attribute data must be based on the previous update of the attribute data of the same vertex and edge, which is ensured by RAFT;

[0082] For the "creation" of vertices and edges, the concept of "previous update" is a state of "non - existence" in terms of concept. Therefore, on a single server, there will always be a data state corresponding to a so - called "previous update" operation for the attribute operation of a single vertex or edge;

[0083] In this case where there is a "previous update" state, for a single vertex or edge, when there is an update to the attribute data, only the updated attributes need to be sent, and the unchanged attributes do not need to be sent. Furthermore:

[0084] For the creation of vertex and edge elements, the "updated attributes" refer to all the attributes of this vertex and edge. In this case, when creating this vertex (or edge), some of the attribute values are not specified, and the corresponding values are null values (or default values);

[0085] For update operations, the end - user specifies which "updated attributes" at the user interface level or the application algorithm interface level. Therefore, this is also clear, and the other attributes that are not updated will maintain their original values.

[0086] Based on the consistency of the RAFT distributed protocol, this step introduces the operation logic for "updated attributes" based on the attribute data of the point and edge elements in the graph instance according to their "previous update" status, thus enabling the "incremental" attribute data transmission of point and edge attribute data in a distributed environment, that is, data transmission only for updated attributes.

[0087] The following elaborates on each step of the present invention:

[0088] Step S1: Synchronously transmit the attribute definition lists of both parties involved based on the RAFT distributed protocol to ensure that both parties in the transmission have consistent attribute definitions, specifically including:

[0089] The distributed graph database obtains the attribute list of the Schema corresponding to a certain type of point or edge through the synchronization operation of the attribute list in the RAFT distributed protocol;

[0090] All parties involved in the operation of the distributed graph database update the attribute list in a synchronous manner in the RAFT distributed protocol to ensure that both parties in the transmission have consistent attribute definitions.

[0091] The following further introduces step S1:

[0092] To ensure consistent operation semantics for the "incremental" attribute transmission during the update between the two server nodes in the transmission, both parties in the transmission need to clarify which incremental attributes of the point and edge elements have been updated before the transmission.

[0093] In this step, the distributed graph database obtains the "attribute list" of the Schema corresponding to a certain type of point (or edge) through the synchronization operation of the "attribute list". Here, the attribute list refers to the set of multiple attributes of a specific Schema and the order list of these attributes. The ordered list of attributes is identified by subscripts, with the first attribute having a subscript of 0, the second having a subscript of 1, and so on. All parties involved in the operation of the distributed graph database update such an attribute list in a synchronous manner, so that each participating node accurately knows all the attributes of all Schemas and the order and subscripts of the attributes. Specifically:

[0094] When creating the Schema of a point (or edge), all server nodes involved in the attribute data update operation of the graph database update the "attribute list" of the Schema in a synchronous manner;

[0095] When the Schema of a point (or edge) is updated (such as adding new attributes or deleting existing attribute definitions, which both change the order of the attribute list), all parties involved in the distributed update operation synchronously update the subsequent attribute list (including subscript order information).

[0096] Through this step, each participating server node in the property data update of the distributed graph database system maintains runtime consistency in terms of the property list and order information.

[0097] Step S2: Update the incremental property data of the graph database by using a two-layer bitmap change property encoding method based on the property definition lists of the two parties involved, including:

[0098] Use the first-layer bitmap to mark the properties that have changed in the ordered property list in the graph database Schema;

[0099] Based on the properties marked as changed by the first-layer bitmap, use the second-layer bitmap to mark the properties that are set to null values or default values in the ordered property list in the graph database Schema;

[0100] Update the property data of the vertices or edges in the graph database based on the properties marked as changed by the first-layer bitmap and the properties marked by the second-layer bitmap.

[0101] Further, the step of using the first-layer change bitmap to mark the properties that have changed in the ordered property list in the graph database Schema includes:

[0102] According to the number of all properties in the Schema, use one bit to represent one property, calculate the number of bits, and align with one byte to obtain the minimum number of bytes representing the number of all properties;

[0103] Set subscripts for each bit starting from 0 from left to right, and each bit represents one property;

[0104] If a certain property has changed during the update operation, the value of the bit corresponding to the certain property is 1, otherwise it is 0.

[0105] Further, the step of, based on the properties marked as changed by the first-layer bitmap, using the second-layer bitmap to mark the properties that are set to null values or default values in the ordered property list in the graph database Schema includes:

[0106] For each bit set to 1 in the first-layer bitmap, introduce a subscript starting from 0;

[0107] Align with 8 bits according to the number of bits set to 1 in the first-layer bitmap, calculate the number of bytes, which is used as the number of bytes of the second-layer bitmap;

[0108] For the bits set to 1 in the first-layer bitmap, when the updated value of a certain bit is set to null / NULL value, set the value of the corresponding bit in the second-layer bitmap to 1.

[0109] Further, updating the attribute data of the points or edges in the graph database based on the attributes of the changes in the first-layer bitmap markers and the attributes of the second-layer bitmap markers includes:

[0110] Only update the attribute data of the points or edges in the graph database that have changed attributes in the first-layer bitmap markers and are not marked in the second-layer bitmap.

[0111] The following further introduces step S2:

[0112] When the point and edge incremental attribute change values start to be transmitted, a change attribute encoding method based on a two-layer "bitmap" is introduced.

[0113] Based on the above steps, whenever there is an update operation on the point and edge data, the distributed graph database encodes the "updated attributes" based on the "bitmap":

[0114] For a specific graph database Schema, based on its ordered attribute list, a first-layer "change bitmap" is introduced;

[0115] According to the number of all attributes in the Schema, one "bit" represents one attribute, calculate the number of bits, and align with one byte (8 bits) to obtain the minimum number of bytes that can represent all attribute numbers;

[0116] From left to right, each bit represents one attribute, where the leftmost bit (the subscript of the bit can be considered as 0) represents the attribute with subscript 0, the second leftmost bit (the subscript of the bit can be considered as 1) represents the attribute with subscript 1, and so on;

[0117] If an attribute has changed during the update operation, the value of the bit representing this attribute is 1, otherwise it is set to 0. In this way, only one bit (i.e., 1 Bit, 8 bits form one byte / Byte) in this "bitmap" can identify which attribute of the point (or edge) element has been updated.

[0118] It should be noted that setting a null value (or the NULL value in some databases, and some databases may set a default value for the attribute set to the NULL value) is a special operation. For this scenario, the present invention introduces a second-layer "bitmap"

[0119] In the above first-layer bitmap, each bit set to "1" has its order. Conceptually, introduce a subscript for each bit set to "1" in these first-layer bitmaps and start calculating the subscript from 0;

[0120] Align with 8 bits (1 byte) according to the number of bits set to "1" in the first-layer bitmap, calculate the required number of bytes, and use it as the actual required number of bytes for the second-layer bitmap;

[0121] For the bits set to "1" in the first - layer bitmap, if the updated value of a certain bit is set to null / NULL value, then set the value of the corresponding bit in the second - layer bitmap (where the subscript of the bit in the second - layer bitmap corresponds to the bit with a value of "1" in the first - layer bitmap) to "1". That is, a "1" set in the second - layer bitmap means that the updated value of this attribute is a null value;

[0122] Based on the above first - layer and second - layer bitmap data:

[0123] Among the specific updated attributes of a certain point (or edge) being transmitted, only focus on the attributes set to 1 in the first - layer bitmap, and only transmit the corresponding attribute values, without the need to transmit the attribute keys (attribute names) of these attributes;

[0124] If the attribute updated for this point (or edge) is set to 1 in the first - layer bitmap and also set to 1 in the corresponding second - layer bitmap, it indicates that this attribute is set to a NULL value (or default value), and the updated value of such an attribute does not need to be transmitted either;

[0125] The final result is: for the update operation of point (or edge) attributes, only transmit the attributes corresponding to the bits that are 1 in the first - layer bitmap and not 1 in the second - layer bitmap;

[0126] Combined with the above two - layer bitmap and attribute data transmission strategy corresponding to the change of a certain point (or edge) attribute:

[0127] The main data to be transmitted includes: the first - layer bitmap data, the second - layer bitmap data, the binary data of the values of one or more changed attributes (the attributes changed to null values have been removed, and the transmission of attribute names has been avoided)

[0128] And auxiliary information, such as the number of bytes of the first - layer bitmap, the number of bytes of the second - layer bitmap, the byte length of the binary data of the changed attributes, etc.

[0129] Based on the two - layer bitmap technology in this step, when transmitting the data of the changed attributes of a point (or edge), only the changed attributes need to be transmitted, and the transmission of attribute keys / attribute names is avoided. What is introduced is only the identifier of the changed attributes represented by multiple "bits" (one bit represents 1 / 8 of a byte), thus saving the amount of data transmitted.

[0130] A method for updating attribute data of a distributed graph database proposed by the present invention, an incremental attribute transmission mechanism based on the RAFT consensus protocol and a distributed graph database attribute transmission encoding based on bitmaps avoid the transmission of unchanged attribute values and the transmission of redundant "keys" (attribute names) during the process of updating the attributes of graph data points (or edges), improving the efficiency of attribute data transmission.

[0131] The present invention introduces an "incremental" consistency transmission mechanism for graph node and edge attribute data based on the RAFT distributed protocol, avoiding the transmission of unmodified attribute data; and an encoding method for "modified attributes" based on a two-layer "bitmap", ensuring the consistency of both parties involved in processing the modified attributes during the transmission of attribute change data.

[0132] Embodiment 2:

[0133] Based on the same inventive concept, the present invention also provides a distributed graph database attribute data update system, including:

[0134] A consistency definition module, used to synchronously transmit the attribute definition lists of both parties involved based on the RAFT distributed protocol, so as to keep the attribute definitions of both transmitting parties consistent;

[0135] A mark update module, used to update the attribute data increment of the graph database by using the encoding method of modified attributes with a two-layer bitmap based on the attribute definition lists of both parties involved.

[0136] Optionally, it is characterized in that the mark update module includes:

[0137] A first mark sub-module, used to mark the changed attributes in the ordered attribute list in the graph database Schema by using the first-layer bitmap;

[0138] A second mark sub-module, used to mark the attributes set to null values or default values in the ordered attribute list in the graph database Schema by using the second-layer bitmap based on the changed attributes marked by the first-layer bitmap;

[0139] An update sub-module, used to update the attribute data of the nodes or edges in the graph database based on the changed attributes marked by the first-layer bitmap and the attributes marked by the second-layer bitmap.

[0140] Optionally, the first mark sub-module is specifically used for:

[0141] According to the number of all attributes in the Schema, using one bit to represent one attribute, calculating the number of bits, and aligning with one byte to obtain the minimum number of bytes representing all attribute numbers;

[0142] Setting subscripts for each bit starting from 0 from left to right, and each bit represents one attribute;

[0143] If a certain attribute has changed during the update operation, the value of the bit of the certain attribute is 1, otherwise it is 0.

[0144] Optionally, the second mark sub-module is specifically used for:

[0145] For the first-layer bitmap, introduce subscripts for each bit set to 1, and the subscripts are calculated starting from 0;

[0146] Align in 8-bit units according to the number of bits set to 1 in the first-layer bitmap, and calculate the number of bytes as the number of bytes of the second-layer bitmap;

[0147] For the bits set to 1 in the first-layer bitmap, when the update value of a certain bit is set to the empty / NULL value, set the value of the corresponding bit in the second-layer bitmap at the subscript corresponding to the first-layer bitmap to 1.

[0148] Optionally, the update sub-module is specifically used for:

[0149] Only update the change attributes marked in the first-layer bitmap and the attribute data of the points or edges in the graph database not marked in the second-layer bitmap.

[0150] Optionally, the consistency definition module is specifically used for:

[0151] The distributed graph database obtains the attribute list of the Schema corresponding to a certain type of point or edge through the synchronization operation of the attribute list in the RAFT distributed protocol;

[0152] All parties participating in the operation of the distributed graph database update the attribute list in the synchronization manner in the RAFT distributed protocol to keep the two parties in transmission having consistent attribute definitions.

[0153] Embodiment 3:

[0154] Based on the same inventive concept, the present invention further provides a computer device, which includes a processor and a memory. The memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a Central Processing Unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, and is suitable for implementing one or more instructions. Specifically, it is suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function, so as to implement the steps of a method for updating attribute data of a distributed graph database in the above embodiments.

[0155] Embodiment 4:

[0156] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory). The computer-readable storage medium is a memory device in a computer device, used to store programs and data. It can be understood that the computer-readable storage medium here can include both the built-in storage medium in the computer device and, of course, the extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, and this storage space stores the operating system of the terminal. And, in this storage space, one or more instructions suitable for being loaded and executed by the processor are also stored. These instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. One or more instructions stored in the computer-readable storage medium can be loaded and executed by the processor to implement the steps of a distributed graph database attribute data update method in the above embodiment.

[0157] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0158] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0159] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the processesFigure 1 one process or multiple processes and / or blocks Figure 1 the functions specified in one block or multiple blocks.

[0160] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0161] The above are only embodiments of the present invention and are not used to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention are included within the scope of the claims of the present invention pending approval.

Claims

1. A method for updating attribute data of a distributed graph database, characterized in that, it includes: Synchronously transmitting the attribute definition lists of both participating parties based on the RAFT distributed protocol to keep the two transmitting parties have consistent attribute definitions; Updating the incremental attribute data of the graph database by using a two - layer bitmap - based changed attribute encoding method based on the attribute definition lists of the participating parties.

2. The method according to claim 1, characterized in that, The updating the incremental attribute data of the graph database by using a two - layer bitmap - based changed attribute encoding method based on the attribute definition lists of the participating parties includes: Using the first - layer bitmap to mark the changed attributes in the ordered attribute list in the graph database Schema; Based on the changed attributes marked by the first - layer bitmap, using the second - layer bitmap to mark the attributes that are set to null values or default values in the ordered attribute list in the graph database Schema; Updating the attribute data of the vertices or edges in the graph database based on the changed attributes marked by the first - layer bitmap and the attributes marked by the second - layer bitmap.

3. The method according to claim 2, characterized in that, The using the first - layer changed bitmap to mark the changed attributes in the ordered attribute list in the graph database Schema includes: According to the number of all attributes in the Schema, using one bit to represent one attribute, calculating the number of bits, and aligning with one byte to obtain the minimum number of bytes representing all attribute numbers; Setting subscripts for each bit starting from 0 from left to right, and each bit represents one attribute; If a certain attribute has changed during the update operation, the value of the bit of the certain attribute is 1, otherwise it is 0.

4. The method according to claim 3, characterized in that, The based on the changed attributes marked by the first - layer bitmap, using the second - layer bitmap to mark the attributes that are set to null values or default values in the ordered attribute list in the graph database Schema includes: For the first - layer bitmap, introducing subscripts for each bit set to 1, and the subscripts start from 0; Calculating the number of bytes by aligning with 8 bits according to the number of bits set to 1 in the first - layer bitmap, which is used as the number of bytes of the second - layer bitmap; Corresponding to the bits set to 1 in the first - layer bitmap, when the updated value of a certain bit is set to null / NULL value, setting the value of the corresponding bit in the second - layer bitmap to 1.

5. The method according to claim 2, characterized in that, The updating the attribute data of the vertices or edges in the graph database based on the changed attributes marked by the first - layer bitmap and the attributes marked by the second - layer bitmap includes: Only updating the changed attributes marked by the first - layer bitmap and the attribute data of the vertices or edges in the graph database not marked by the second - layer bitmap.

6. The method according to claim 1, characterized in that, The synchronously transmitting the attribute definition lists of both participating parties based on the RAFT distributed protocol to keep the two transmitting parties have consistent attribute definitions includes: The distributed graph database obtains the attribute list of the Schema corresponding to a certain type of vertex or edge through the synchronization operation of the attribute list in the RAFT distributed protocol; The parties involved in the operation of the distributed graph database update the attribute list in a synchronous manner in the RAFT distributed protocol, ensuring that both parties in the transmission have consistent attribute definitions.

7. A distributed graph database attribute data update system, characterized in that, it includes: A consistency definition module, which is used to synchronously transmit the attribute definition lists of both parties involved in the transmission based on the RAFT distributed protocol, ensuring that both parties in the transmission have consistent attribute definitions; A marker update module, which is used to update the increment of the attribute data of the graph database by using a two-layer bitmap change attribute coding method based on the attribute definition lists of both parties involved.

8. The system according to claim 7, characterized in that, the marker update module includes: A first marker sub-module, which is used to mark the changed attributes in the ordered attribute list in the graph database Schema by using the first-layer bitmap; A second marker sub-module, which is used to mark the attributes that are set to null values or default values in the ordered attribute list in the graph database Schema by using the second-layer bitmap based on the changed attributes marked by the first-layer bitmap; An update sub-module, which updates the attribute data of the vertices or edges of the graph database based on the changed attributes marked by the first-layer bitmap and the attributes marked by the second-layer bitmap.

9. A computer device, characterized in that, it includes: One or more processors; The processor is used to store one or more programs; When the one or more programs are executed by the one or more processors, it implements a distributed graph database attribute data update method according to any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that, it stores a computer program, and when the computer program is executed, it implements a distributed graph database attribute data update method according to any one of claims 1 to 6.