CN112559632A - Method, device, electronic equipment and medium for synchronizing state of distributed graph database - Google Patents
Method, device, electronic equipment and medium for synchronizing state of distributed graph database Download PDFInfo
- Publication number
- CN112559632A CN112559632A CN202011480908.9A CN202011480908A CN112559632A CN 112559632 A CN112559632 A CN 112559632A CN 202011480908 A CN202011480908 A CN 202011480908A CN 112559632 A CN112559632 A CN 112559632A
- Authority
- CN
- China
- Prior art keywords
- node
- state
- sending
- graph database
- identifier
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 39
- 230000008859 change Effects 0.000 claims abstract description 43
- 238000012545 processing Methods 0.000 claims abstract description 17
- 230000005540 biological transmission Effects 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 12
- 230000004044 response Effects 0.000 claims description 3
- 238000013473 artificial intelligence Methods 0.000 abstract description 11
- 238000005516 engineering process Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 9
- 238000004891 communication Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 4
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000006399 behavior Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010225 co-occurrence analysis Methods 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013135 deep learning Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 230000003924 mental process Effects 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000010076 replication Effects 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000011144 upstream manufacturing Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 238000012800 visualization Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/23—Updating
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a state synchronization method and device of a distributed graph database, electronic equipment and a medium, and relates to the technical field of computers, in particular to the technical fields of artificial intelligence such as knowledge graphs, distributed storage and big data processing. The specific implementation scheme is as follows: determining a changed state of a first node in a distributed graph database; generating a state change message according to the changed state; determining the identification of the second node which is registered currently; and sending the state change message to the second node to which the identifier of the second node belongs, so that the timeliness of the state synchronization of the distributed graph database can be effectively improved, and the operation stability of the distributed graph database is guaranteed.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to the field of artificial intelligence technologies such as a knowledge graph, distributed storage, and big data processing, and in particular, to a method, an apparatus, an electronic device, and a medium for synchronizing states of a distributed graph database.
Background
Artificial intelligence is the subject of research that makes computers simulate some human mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), both at the hardware level and at the software level. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, machine learning/deep learning, a big data processing technology, a knowledge map technology and the like.
In a distributed graph database, the storage cluster at the bottom layer may change its state at any time, for example, a master node in a replication group changes, a cluster member node changes, and the like, and these changed states all affect the routing information when the upper layer reads and writes data, and thus these changed states need to be timely acquired by upstream data.
Disclosure of Invention
A method, an apparatus, an electronic device, a storage medium, and a computer program product for state synchronization of a distributed graph database are provided.
According to a first aspect, there is provided a method of state synchronization for a distributed graph database, comprising: determining a changed state of a first node in a distributed graph database; generating a state change message according to the changed state; determining the identification of the second node which is registered currently; and sending the state change message to the second node to which the identifier of the second node belongs.
According to a second aspect, there is provided a state synchronization apparatus for a distributed graph database, comprising: a first determining module for determining a changed state of a first node in a distributed graph database; the generating module is used for generating a state change message according to the changed state; a second determining module, configured to determine an identifier of a currently registered second node; and the first sending module is used for sending the state change message to the second node to which the identifier of the second node belongs.
According to a third aspect, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method for state synchronization of a distributed graph database according to embodiments of the present application.
According to a fourth aspect, a non-transitory computer-readable storage medium is provided, having stored thereon computer instructions for causing a computer to execute a method for state synchronization of a distributed graph database as disclosed in embodiments of the present application.
According to a fifth aspect, a computer program product is presented, comprising a computer program which, when executed by a processor, implements the method for state synchronization of a distributed graph database as disclosed in embodiments of the present application.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present application, nor do they limit the scope of the present application. Other features of the present application will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not intended to limit the present application. Wherein:
FIG. 1 is a schematic diagram according to a first embodiment of the present application;
FIG. 2 is a schematic diagram according to a second embodiment of the present application;
FIG. 3 is a schematic illustration according to a third embodiment of the present application;
FIG. 4 is a schematic illustration according to a fourth embodiment of the present application;
FIG. 5 is a block diagram of an electronic device for implementing a method for state synchronization of a distributed graph database according to an embodiment of the present application.
Detailed Description
The following description of the exemplary embodiments of the present application, taken in conjunction with the accompanying drawings, includes various details of the embodiments of the application for the understanding of the same, which are to be considered exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram according to a first embodiment of the present application.
It should be noted that the execution subject of the state synchronization method for a distributed graph database in this embodiment is a state synchronization device for a distributed graph database, and the device may be implemented in a software and/or hardware manner, and the device may be configured in an electronic device, and the electronic device may include, but is not limited to, a terminal, a server, and the like.
The embodiment of the application relates to the technical field of artificial intelligence such as knowledge graph, distributed storage, big data processing and the like.
Wherein, Artificial Intelligence (Artificial Intelligence), english is abbreviated as AI. The method is a new technical science for researching and developing theories, methods, technologies and application systems for simulating, extending and expanding human intelligence.
The knowledge graph is a modern theory which achieves the aim of multi-discipline fusion by combining theories and methods of applying subjects such as mathematics, graphics, information visualization technology, information science and the like with methods such as metrology introduction analysis, co-occurrence analysis and the like and utilizing a visualized graph to vividly display the core structure, development history, frontier field and overall knowledge framework of the subjects.
Distributed storage is the storage of data in a distributed manner on a plurality of independent machine devices.
The big data processing refers to a process of analyzing and processing large-scale data in an artificial intelligence mode, and the big data can be summarized into 5V, and has large data Volume (Volume), high speed (Velocity), multiple types (Velocity), Value (Value) and authenticity (Veracity).
As shown in fig. 1, the method for synchronizing the states of a distributed graph database includes:
s101: a post-change status of a first node in a distributed graph database is determined.
The execution subject in the embodiment of the present application may be, for example, a configuration center, and the configuration center may be specifically deployed on a node in the distributed graph database, or may also be deployed on a device independent of the distributed graph database, which is not limited to this.
It is understood that Graph databases are usually based on Graph theory (Graph) in data structures, and the core elements constituting the Graph are two: nodes (also called points) and attributes on nodes, edges (also called relationships) and attributes on edges.
In this embodiment of the application, the first node may be any node in the distributed graph database, and the state of the first node, for example, the first node is a master node or the first node is a slave node, which is not limited to this.
In this embodiment, if the state of the first node is changed, the changed state is obtained, and the changed state is sent to the configuration center in real time, that is, the configuration center monitors the state change condition of each node in the distributed graph database, and synchronizes the changed state accordingly.
And after the first node acquires the changed state and sends the changed state to the configuration center in real time, the configuration center can receive the changed state of the first node in the distributed graph database and then trigger the subsequent steps.
S102: and generating a state change message according to the changed state.
After receiving the changed state of the first node in the distributed graph database, the configuration center may generate a state change message according to the changed state, for example, may maintain a variable according to the changed state, and when it is determined that the changed state is different from the current state of the first node, the configuration center may update the variable accordingly to obtain a new variable, and then generate the state change message, so that the state change message carries the new variable.
S103: an identity of a currently registered second node is determined.
In this embodiment of the present application, after the configuration center determines that the state of the first node is changed, it may be to search for an identifier of the currently registered second node.
The second node is a node in the distributed graph database, and the second node is registered in the configuration center in advance.
Optionally, in some embodiments, before determining the changed state of the first node in the distributed graph database, a registration request sent by the second node is further received, where the registration request carries an identifier and a current state of the second node; the second node is registered according to the identification and the current state of the second node, and the second node is registered in the configuration center in advance, so that the on-demand distribution and synchronization of the changed state of the first node are realized in an auxiliary manner, and hardware and software operation resources consumed by the operation of the distributed graph database can be saved while the operation stability of the distributed graph database is guaranteed.
The identifier of the second node can be used to uniquely identify the second node, the second node may be a node different from the first node, and the first node may also be a node registered in the configuration center, so that the configuration center not only registers part or all of the nodes, but also stores the current state of each registered node.
After obtaining the identifier of the second node and the current state of the second node, the configuration center may call a preset registration processing logic to register the second node, so that the registered second node plays a role as an observer.
S104: and sending the state change message to the second node to which the identifier of the second node belongs.
After determining the identifier of the second node that is currently registered, the configuration center may determine the registered second node accordingly, and then the configuration center may send the state change message to the second node to which the identifier of the second node belongs in real time.
The state change message at this time is used to notify the second node that: the current state of the first node is changed and may not include the particular changed state of the first node.
Therefore, in the embodiment of the application, the state change message is sent to the second node to which the identifier of the second node belongs, and the synchronous data volume is reduced, so that the timeliness of the state synchronization of the distributed graph database is effectively improved.
Optionally, in some embodiments, if the number of the second nodes that are currently registered is multiple, the state change message may be sent to the second node to which the identifier of the second node belongs, or the state change message may be sent to the second nodes to which the identifiers of the respective second nodes belong at the same time, so that timeliness of state synchronization is comprehensively improved, and a possible fault of the distributed graph database is effectively avoided.
In the embodiment, the changed state of the first node in the distributed graph database is determined; generating a state change message according to the changed state; determining the identification of the second node which is registered currently; and sending the state change message to the second node to which the identifier of the second node belongs, so that the timeliness of the state synchronization of the distributed graph database can be effectively improved, and the operation stability of the distributed graph database is guaranteed.
Fig. 2 is a schematic diagram according to a second embodiment of the present application.
As shown in fig. 2, the method for synchronizing the states of a distributed graph database includes:
s201: a post-change status of a first node in a distributed graph database is determined.
S202: and generating a state change message according to the changed state.
S203: an identity of a currently registered second node is determined.
S204: and sending the state change message to the second node to which the identifier of the second node belongs.
For the descriptions of S201 to S204, reference may be made to the above embodiments specifically, which are not described herein again.
S205: and receiving a state acquisition request sent by the second node.
After the status change message is sent to the second node to which the identifier of the second node belongs, whether a status acquisition request sent by the second node is received or not can be monitored in real time.
That is to say, after receiving the state change message sent by the configuration center, the second node may learn that the state of the first node has changed, and then the second node may determine whether the full amount of state change data needs to be acquired according to the requirements of the actual application, and if the full amount of state change data needs to be acquired, may generate a state acquisition request and send the state acquisition request to the configuration center.
S206: and responding to the state acquisition request, and sending the changed state to the second node.
After receiving the state acquisition request sent by the second node, the configuration center can respond to the state acquisition request and send the changed state to the second node, so that the second node can acquire the changed state of the first node as required in time.
Optionally, in some embodiments, the changed state may be added to the asynchronous message transmission queue in response to the state obtaining request; and sending the changed state in the asynchronous message transmission queue to a second node to which the identifier of the second node belongs by adopting an asynchronous sending mode.
It can be understood that, based on the operation characteristics of the distributed graph database, the state of each node may be changed once or many times, in this embodiment, in order to send the changed state to the second node according to the time sequence of the state change, so as to ensure that the second node obtains the latest changed state, the changed state may be added to the asynchronous message transmission queue, and the changed state in the asynchronous message transmission queue is sent to the second node to which the identifier of the second node belongs in an asynchronous sending manner.
In the embodiment, the changed state of the first node in the distributed graph database is determined; generating a state change message according to the changed state; determining the identification of the second node which is registered currently; and sending the state change message to the second node to which the identifier of the second node belongs, so that the timeliness of the state synchronization of the distributed graph database can be effectively improved, and the operation stability of the distributed graph database is guaranteed. The changed state is sent to the second node by receiving the state acquisition request sent by the second node and responding to the state acquisition request, so that the second node can acquire the changed state of the first node in time as required. By adding the changed state into the asynchronous message transmission queue and adopting an asynchronous sending mode, the changed state in the asynchronous message transmission queue is sent to the second node to which the identifier of the second node belongs, the changed state can be sent to the second node according to the time sequence of state change occurrence, and the latest changed state obtained by the second node is guaranteed.
Fig. 3 is a schematic diagram according to a third embodiment of the present application.
As shown in fig. 3, the state synchronization device 30 for a distributed map database includes:
a first determining module 301, configured to determine a changed state of a first node in a distributed graph database;
a generating module 302, configured to generate a state change message according to the changed state;
a second determining module 303, configured to determine an identifier of a currently registered second node; and
a first sending module 304, configured to send the status change message to the second node to which the identifier of the second node belongs.
In some embodiments of the present application, as shown in fig. 4, fig. 4 is a schematic diagram of a state synchronization apparatus 40 for a distributed map database according to a fourth embodiment of the present application, including: the first determining module 401, the generating module 402, the second determining module 403, and the first sending module 404 further include:
a first receiving module 405, configured to receive a status obtaining request sent by a second node;
a second sending module 406, configured to send the changed state to the second node in response to the state obtaining request.
In some embodiments of the present application, as shown in fig. 4, further comprising:
a second receiving module 407, configured to receive a registration request sent by a second node, where the registration request carries an identifier and a current state of the second node;
and the registering module 408 is configured to perform registration processing on the second node according to the identifier and the current state of the second node.
In some embodiments of the present application, the number of the currently registered second nodes is multiple, where the first sending module 404 is specifically configured to:
and simultaneously sending the state change message to the second nodes to which the identifiers of the second nodes belong.
In some embodiments of the present application, the second sending module 406 is specifically configured to:
responding to the state acquisition request, and adding the changed state into the asynchronous message transmission queue; and sending the changed state in the asynchronous message transmission queue to a second node to which the identifier of the second node belongs by adopting an asynchronous sending mode.
It is understood that the state synchronization device 40 of the distributed map database in fig. 4 of the present embodiment and the state synchronization device 30 of the distributed map database in the above-described embodiment, the first determination module 401 and the first determination module 301 in the above-described embodiment, the generation module 402 and the generation module 302 in the above-described embodiment, the second determination module 403 and the second determination module 303 in the above-described embodiment, and the first sending module 404 and the first sending module 304 in the above-described embodiment may have the same functions and structures.
It should be noted that the explanation of the state synchronization method for the distributed graph database is also applicable to the state synchronization device for the distributed graph database in this embodiment, and is not repeated here.
In the embodiment, the changed state of the first node in the distributed graph database is determined; generating a state change message according to the changed state; determining the identification of the second node which is registered currently; and sending the state change message to the second node to which the identifier of the second node belongs, so that the timeliness of the state synchronization of the distributed graph database can be effectively improved, and the operation stability of the distributed graph database is guaranteed.
There is also provided, in accordance with an embodiment of the present application, an electronic device, a readable storage medium, and a computer program product.
FIG. 5 is a block diagram of an electronic device for implementing a method for state synchronization of a distributed graph database according to an embodiment of the present application. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application that are described and/or claimed herein.
As shown in fig. 5, the apparatus 500 comprises a computing unit 501 which may perform various appropriate actions and processes in accordance with a computer program stored in a Read Only Memory (ROM)502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data required for the operation of the device 500 can also be stored. The calculation unit 501, the ROM 502, and the RAM503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in the device 500 are connected to the I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, or the like; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508, such as a magnetic disk, optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general-purpose and/or special-purpose processing components having processing and computing capabilities. Some examples of the computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 501 performs the respective methods and processes described above, for example, the state synchronization method of the distributed map database.
For example, in some embodiments, the state synchronization method of a distributed graph database may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into the RAM503 and executed by the computing unit 501, one or more steps of the method for state synchronization of a distributed graph database described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured in any other suitable way (e.g., by means of firmware) to perform the state synchronization method of the distributed graph database.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the state synchronization method for a distributed graph database of the present application may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), the internet, and blockchain networks.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service ("Virtual Private Server", or simply "VPS"). The server may also be a server of a distributed system, or a server incorporating a blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above-described embodiments should not be construed as limiting the scope of the present application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims (13)
1. A method for state synchronization of a distributed graph database, comprising:
determining a changed state of a first node in a distributed graph database;
generating a state change message according to the changed state;
determining the identification of the second node which is registered currently; and
and sending the state change message to the second node to which the identifier of the second node belongs.
2. The method of claim 1, further comprising, after said sending the status change message to the second node to which the identity of the second node belongs:
receiving a state acquisition request sent by the second node;
and responding to the state acquisition request, and sending the changed state to the second node.
3. The method of claim 1, further comprising, prior to said determining the post-change state of the first node in the distributed graph database:
receiving a registration request sent by the second node, wherein the registration request carries the identifier and the current state of the second node;
and performing registration processing on the second node according to the identifier of the second node and the current state.
4. The method of claim 3, wherein the number of the currently registered second nodes is multiple, and wherein the sending the status change message to the second node to which the identity of the second node belongs comprises:
and simultaneously sending the state change message to the second nodes to which the identifiers of the second nodes belong.
5. The method of claim 2, wherein said sending the changed state to the second node in response to the state acquisition request comprises:
responding to the state acquisition request, and adding the changed state into an asynchronous message transmission queue;
and sending the changed state in the asynchronous message transmission queue to a second node to which the identifier of the second node belongs by adopting an asynchronous sending mode.
6. A state synchronization apparatus for a distributed graph database, comprising:
a first determining module for determining a changed state of a first node in a distributed graph database;
the generating module is used for generating a state change message according to the changed state;
a second determining module, configured to determine an identifier of a currently registered second node; and
and the first sending module is used for sending the state change message to the second node to which the identifier of the second node belongs.
7. The apparatus of claim 6, further comprising:
a first receiving module, configured to receive a status acquisition request sent by the second node;
and the second sending module is used for responding to the state acquisition request and sending the changed state to the second node.
8. The apparatus of claim 6, further comprising:
a second receiving module, configured to receive a registration request sent by the second node, where the registration request carries an identifier and a current state of the second node;
and the registration module is used for performing registration processing on the second node according to the identifier of the second node and the current state.
9. The apparatus according to claim 8, where the number of the currently registered second nodes is multiple, and the first sending module is specifically configured to:
and simultaneously sending the state change message to the second nodes to which the identifiers of the second nodes belong.
10. The apparatus of claim 7, wherein the second sending module is specifically configured to:
responding to the state acquisition request, and adding the changed state into an asynchronous message transmission queue;
and sending the changed state in the asynchronous message transmission queue to a second node to which the identifier of the second node belongs by adopting an asynchronous sending mode.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011480908.9A CN112559632B (en) | 2020-12-15 | 2020-12-15 | State synchronization method and device of distributed graph database, electronic equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011480908.9A CN112559632B (en) | 2020-12-15 | 2020-12-15 | State synchronization method and device of distributed graph database, electronic equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112559632A true CN112559632A (en) | 2021-03-26 |
CN112559632B CN112559632B (en) | 2024-09-03 |
Family
ID=75063886
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011480908.9A Active CN112559632B (en) | 2020-12-15 | 2020-12-15 | State synchronization method and device of distributed graph database, electronic equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112559632B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113590574A (en) * | 2021-09-29 | 2021-11-02 | 北京海致星图科技有限公司 | Distributed graph database data processing method, medium and electronic equipment |
CN118093614A (en) * | 2024-04-28 | 2024-05-28 | 深圳市小赢信息技术有限责任公司 | Data consistency and query method, device and system for multiple Neo4j |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120278815A1 (en) * | 2011-04-26 | 2012-11-01 | Sap Ag | High-load business process scalability |
US20150006606A1 (en) * | 2013-06-29 | 2015-01-01 | Google Inc. | Asynchronous message passing for large graph clustering |
CN108322533A (en) * | 2018-01-31 | 2018-07-24 | 广州鼎甲计算机科技有限公司 | Configuration and synchronization method between distributed type assemblies node based on operation log |
CN108833131A (en) * | 2018-04-25 | 2018-11-16 | 北京百度网讯科技有限公司 | System, method, equipment and the computer storage medium of distributed data base cloud service |
CN109634800A (en) * | 2018-10-19 | 2019-04-16 | 深圳平安财富宝投资咨询有限公司 | Data processing method, system, terminal and readable storage medium storing program for executing |
CN110413418A (en) * | 2019-06-25 | 2019-11-05 | 北京三快在线科技有限公司 | Cache synchronization device and method, cache synchronization system, electronic equipment |
CN111159233A (en) * | 2019-12-18 | 2020-05-15 | 金蝶软件(中国)有限公司 | Distributed caching method, system, computer device and storage medium |
-
2020
- 2020-12-15 CN CN202011480908.9A patent/CN112559632B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120278815A1 (en) * | 2011-04-26 | 2012-11-01 | Sap Ag | High-load business process scalability |
US20150006606A1 (en) * | 2013-06-29 | 2015-01-01 | Google Inc. | Asynchronous message passing for large graph clustering |
CN108322533A (en) * | 2018-01-31 | 2018-07-24 | 广州鼎甲计算机科技有限公司 | Configuration and synchronization method between distributed type assemblies node based on operation log |
CN108833131A (en) * | 2018-04-25 | 2018-11-16 | 北京百度网讯科技有限公司 | System, method, equipment and the computer storage medium of distributed data base cloud service |
CN109634800A (en) * | 2018-10-19 | 2019-04-16 | 深圳平安财富宝投资咨询有限公司 | Data processing method, system, terminal and readable storage medium storing program for executing |
CN110413418A (en) * | 2019-06-25 | 2019-11-05 | 北京三快在线科技有限公司 | Cache synchronization device and method, cache synchronization system, electronic equipment |
CN111159233A (en) * | 2019-12-18 | 2020-05-15 | 金蝶软件(中国)有限公司 | Distributed caching method, system, computer device and storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113590574A (en) * | 2021-09-29 | 2021-11-02 | 北京海致星图科技有限公司 | Distributed graph database data processing method, medium and electronic equipment |
CN113590574B (en) * | 2021-09-29 | 2022-02-08 | 北京海致星图科技有限公司 | Distributed graph database data processing method, medium and electronic equipment |
CN118093614A (en) * | 2024-04-28 | 2024-05-28 | 深圳市小赢信息技术有限责任公司 | Data consistency and query method, device and system for multiple Neo4j |
Also Published As
Publication number | Publication date |
---|---|
CN112559632B (en) | 2024-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN113343803A (en) | Model training method, device, equipment and storage medium | |
CN112559631B (en) | Data processing method and device of distributed graph database and electronic equipment | |
CN112866391A (en) | Message pushing method and device, electronic equipment and storage medium | |
CN112559632B (en) | State synchronization method and device of distributed graph database, electronic equipment and medium | |
CN113193947B (en) | Method, apparatus, medium, and program product for implementing distributed global ordering | |
CN115457810B (en) | Method, device, electronic equipment and storage medium for merging flight operation data | |
CN115150471A (en) | Data processing method, device, equipment, storage medium and program product | |
CN114448802B (en) | Gateway configuration method, device, electronic equipment and storage medium | |
CN113344074B (en) | Model training method, device, equipment and storage medium | |
CN114186680A (en) | Network structure processing method and device, electronic equipment and storage medium | |
CN115481594B (en) | Scoreboard implementation method, scoreboard, electronic equipment and storage medium | |
CN113868254B (en) | Method, device and storage medium for removing duplication of entity node in graph database | |
CN113360689B (en) | Image retrieval system, method, related device and computer program product | |
CN115544653A (en) | Rigidity simulation test method and device, electronic equipment and storage medium | |
CN114817003A (en) | Test information processing method, device, equipment and storage medium | |
CN114579311A (en) | Method, apparatus, device and storage medium for executing distributed computing task | |
CN113887101A (en) | Visualization method and device of network model, electronic equipment and storage medium | |
CN115700487A (en) | Method, device and equipment for processing messages in message queue and storage medium | |
CN112835007B (en) | Point cloud data conversion method and device, electronic equipment and storage medium | |
CN112988507B (en) | Service monitoring method, device, equipment, storage medium and computer program product | |
US11772681B2 (en) | Method and apparatus for processing autonomous driving simulation data, and electronic device | |
CN113792117B (en) | Method and device for determining data update context, electronic equipment and storage medium | |
CN112818060B (en) | Data synchronization method, device, electronic equipment and readable storage medium | |
CN117331994A (en) | Real-time processing method and device for data, electronic equipment and storage medium | |
CN116382852A (en) | Micro-service deployment method and device, electronic equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |