Data synchronization method and device

By obtaining and verifying the change information of the graph data model, the graph database is updated automatically, which solves the problem of time-consuming, labor-intensive and error-prone traditional manual updates, and realizes the accuracy and flexibility of the graph database and improves the user experience.

CN119577035BActive Publication Date: 2025-08-22BEIJING PACTERA JINXIN TECH LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411733899.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-08-22
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

When traditional manual update of graph databases, it is time-consuming and labor-intensive and prone to errors, resulting in inaccurate query results and cannot meet the flexibility and accuracy requirements of modern business scenarios.

Method used

By obtaining the most recently updated graph data model, performing constraint verification, updating the graph data model in response to model change information, and synchronizing the graph database based on the update content, generating structured query statements for updating.

Benefits of technology

Ensure the accuracy and consistency of graph database updates, reduce manual operations, improve the timeliness and flexibility of updates, provide accurate query results, and improve user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577035B_ABST
    Figure CN119577035B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a data synchronization method and device, which include: obtaining a graph data model obtained from the most recent update; when model change information is obtained, performing constraint verification on the model change information; in response to the model change information passing the constraint verification, updating the graph data model according to the model change information; based on the updated content in the graph data model, updating the graph database synchronized with the graph data model. Thus, before updating the graph data model, strict constraint verification is performed on the model change information to avoid data inconsistency and erroneous updates. When updating the graph data model, the graph database is synchronously updated to ensure the correctness and completeness of the update operation, avoid confusion or omissions during the update process, improve the accuracy and timeliness of graph database updates, thereby providing users with accurate query results and improving user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to a data synchronization method and device. Background Art

[0002] With the advent of the big data era, the scale of data processed by various industries continues to grow, and the complexity and interdependence of this data are also increasing. Traditional relational databases cannot meet the requirements for efficient storage and querying of this highly interconnected and complex data. Graph databases, with their unique graph structure, can efficiently store and query complex relational data, making them the optimal choice for processing this type of data. However, business scenarios are constantly changing, and to meet evolving business needs, graph databases need to be updated as application scenarios change.

[0003] In the related art, when updating a graph database, it is necessary to manually update the graph database; however, manually updating the graph database consumes a lot of time and energy, especially when the data volume is large and complex. Manual operations are prone to errors, such as missed updates, input errors, etc., which makes it impossible to provide users with accurate query results, reducing the user experience. Summary of the Invention

[0004] The present disclosure provides a data synchronization method and apparatus to at least partially resolve one of the technical problems in the related art. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a data synchronization method is provided, comprising: obtaining a graph data model obtained from the most recent update; in a case where model change information is obtained, performing constraint verification on the model change information; in response to the model change information passing the constraint verification, updating the graph data model according to the model change information; and based on the updated content in the graph data model, updating a graph database synchronized with the graph data model.

[0006] According to a second aspect of an embodiment of the present disclosure, a data synchronization device is provided, including: an acquisition module for acquiring a graph data model obtained from the most recent update; a verification module for performing constraint verification on the model change information when the model change information is acquired; a first update module for updating the graph data model according to the model change information in response to the model change information passing the constraint verification; and a second update module for updating the graph database synchronized with the graph data model based on the updated content in the graph data model.

[0007] According to a third aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the data synchronization method as described in the embodiment of the first aspect of the present disclosure.

[0008] According to the fourth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by the processor of an electronic device, the electronic device can execute the data synchronization method as described in the embodiment of the first aspect of the present disclosure.

[0009] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, comprising: a computer program, which, when executed by a processor, implements the data synchronization method as described in the embodiment of the first aspect of the present disclosure.

[0010] The technical solutions provided by the embodiments of the present disclosure bring at least the following beneficial effects:

[0011] In this technical solution, the graph data model obtained by the latest update is obtained; when the model change information is obtained, the model change information is subjected to constraint verification; in response to the model change information passing the constraint verification, the graph data model is updated according to the model change information; based on the updated content in the graph data model, the graph database synchronized with the graph data model is updated. Thus, before updating the graph data model, the model change information is subjected to strict constraint verification to avoid data inconsistency and erroneous updates. When updating the graph data model, the graph database is updated synchronously to ensure the correctness and completeness of the update operation and avoid confusion or omissions during the update process, thereby improving the accuracy and timeliness of graph database updates, thereby providing users with accurate query results and improving Improved user experience; wherein, when updating the graph database synchronized with the graph data model, a first structured query statement for updating the graph database is generated according to the updated content in the graph data model; executing the first structured query statement to update the graph database synchronized with the graph data model ensures that the data in the graph database is consistent with the graph data model, thereby improving the accuracy of the graph database; in addition, when performing constraint verification on the model change information, constraint verification is performed on the model change information in the model configuration information sent by the client, thereby ensuring that the update of the graph data model is based on the user's specific configuration operations, reducing the time and effort of manual operations, and supporting batch configuration and dynamic adjustment, thereby improving the flexibility and accuracy of data synchronization and enhancing the user experience.

[0012] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.

[0014] Figure 1 is a flowchart of a data synchronization method according to the first embodiment of the present disclosure;

[0015] Figure 2 is a flowchart of a data synchronization method according to the second embodiment of the present disclosure;

[0016] Figure 3 is a flowchart of a data synchronization method according to the third embodiment of the present disclosure;

[0017] Figure 4 is a flowchart of a data synchronization method according to a fourth embodiment of the present disclosure;

[0018] Figure 5 is a structural diagram of a data synchronization device shown in the fifth embodiment of the present disclosure;

[0019] Figure 6 It is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present disclosure. DETAILED DESCRIPTION

[0020] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.

[0021] It should be noted that the terms "first," "second," and the like in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure as detailed in the appended claims.

[0022] It should be noted that in the technical solutions disclosed herein, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are all carried out with the user's consent, and are in compliance with relevant laws and regulations and do not violate public order and good morals.

[0023] Traditional graph database modeling methods often require predefined data schemas, which is inflexible when dealing with complex and ever-changing application scenarios. In modern applications, data models frequently change, particularly in areas like social networks, the Internet of Things, and configuration repositories. Data structures and relationships frequently change, requiring synchronous updates to the graph database. Therefore, how to synchronize graph database updates has become a pressing issue.

[0024] In response to the above problems, the present disclosure proposes a data synchronization method and device.

[0025] The data synchronization method and apparatus according to the embodiments of the present disclosure will be described below with reference to the accompanying drawings.

[0026] Figure 1 It is a flowchart of the data synchronization method shown in the first embodiment of the present disclosure.

[0027] like Figure 1 As shown, the data synchronization method includes the following steps:

[0028] Step 101: Obtain the graph data model obtained by the most recent update.

[0029] To improve the accuracy of graph database updates, one possible implementation involves synchronously updating the graph database based on the updated data model. Therefore, as an example, each time the graph data model is updated, the updated graph data model is archived. This allows the most recently updated graph data model to be retrieved when the graph database is synchronously updated based on the graph data model. The graph data model includes nodes, relationships between nodes, and node attributes. Nodes represent entities or objects in the graph data model, relationships between nodes represent connections or associations between entities, and node attributes represent specific characteristics or attribute information of nodes.

[0030] Step 102: When the model change information is obtained, constraint verification is performed on the model change information.

[0031] To improve the accuracy of graph data model updates, one possible implementation involves using set constraints to validate model change information, ensuring its correctness and legitimacy. It's important to note that model change information includes the addition, deletion, and attribute modification of nodes in the graph data model, as well as changes to the relationships between nodes. Constraints can be set based on actual needs, for example, they can be generated based on historical model change records and user feedback.

[0032] As a first possible implementation manner, uniqueness verification is performed on the node identification information of the changed node in the model change content.

[0033] That is to say, in order to avoid conflicts and errors in the data structure in the graph data model and ensure the consistency and integrity of the data, the node identification information of the node that needs to be changed (that is, the unique identifier of each node) needs to be verified to ensure that the identifier is unique in the graph data model, so that different nodes can be accurately distinguished and located, avoiding confusion and errors caused by duplicate identifiers.

[0034] As a second possible implementation manner, reference integrity verification is performed on the node identification information.

[0035] That is to say, in order to ensure the consistency and integrity of the data in the graph data model, the mapping relationship between the node identification information of the node that needs to be changed and the identification information of other nodes will be verified. By verifying the referential integrity of the node identification information, potential data inconsistency problems can be discovered and handled in a timely manner. For example, when the identification information of a node changes, all related information can be automatically checked and updated, thereby simplifying the complexity and workload of data maintenance.

[0036] As a second possible implementation manner, domain integrity verification is performed on the attribute information of the changed nodes in the model change content.

[0037] That is to say, in order to avoid data inaccuracy caused by incorrect attribute information or exceeding the expected range, the attribute information of the changed node is verified for domain integrity to ensure that the attribute information of the changed node meets the preset data type, format or value range requirements.

[0038] As a third possible implementation method, the relationship integrity verification is performed on the association relationship between the changed nodes in the model change content.

[0039] That is to say, in order to avoid data model confusion caused by incorrect or inconsistent association relationships, the association relationships between the changed nodes in the model change content are verified for relationship integrity. Relationship integrity verification can ensure that the association relationships between the changed nodes still meet the design requirements of the data model.

[0040] Step 103: In response to the model change information passing the constraint verification, the graph data model is updated according to the model change information.

[0041] As a possible implementation, if the model change information passes constraint validation, the graph data model is updated based on the change type and content in the model change information. Change types include: node changes, changes to node relationships, attribute changes, and structural changes. Change content includes: changes to node information, changes to relationship information, changes to attribute information, and structural changes.

[0042] As an example, in response to the model change information passing the constraint verification, the model change type indicated by the model change information and the model change content under the model change type are obtained; based on the model change content, a second structured query statement adapted to the model change type is generated; and the second structured query statement is executed to update the graph database model.

[0043] That is to say, when the model change information successfully passes the constraint verification, the specific model change type and the model change content under each model change type are identified from the model change information, such as the addition, deletion, and modification of nodes or the adjustment of association relationships; then, based on the model change content, a second structured query statement matching the model change content is generated; finally, the second structured query statement is executed to achieve the corresponding update of the graph database model.

[0044] As another example, in response to the model change information failing verification, abnormal information in the model change information is obtained; prompt information is generated based on the abnormal information, and the prompt information is sent to the client; wherein the prompt information is used to prompt the abnormal information in the model change information.

[0045] That is to say, when the model change information fails to pass the verification, the exception information is extracted from the model change information, and then a prompt information is generated based on the exception information, and the prompt information is sent to the client, wherein the prompt information is used to prompt the user of the specific problems or errors in the model change information so that the user can make corresponding modifications or resubmit.

[0046] It should be noted that in order to facilitate users to restore the graph data model to the previous version when needed, before updating the graph data model according to the model change information, the version information of the graph data model is obtained, and the graph data model and version information are archived; among them, the version information is used for version rollback.

[0047] Step 104: Based on the updated content in the graph data model, update the graph database synchronized with the graph data model.

[0048] In order to achieve real-time and accurate updates of the graph database, as a possible implementation method, when the graph data model is updated, the graph database synchronized with the graph data model is updated based on the updated content in the graph data model.

[0049] It should be noted that the log is updated according to the graph data model before and after the update to facilitate subsequent auditing and backtracking.

[0050] In summary, the graph data model obtained by the latest update is obtained; when the model change information is obtained, the model change information is constraint verified; in response to the model change information passing the constraint verification, the graph data model is updated according to the model change information; based on the updated content in the graph data model, the graph database synchronized with the graph data model is updated. Therefore, before updating the graph data model, the model change information is strictly constraint verified to avoid data inconsistency and erroneous updates. When updating the graph data model, the graph database is synchronously updated to ensure the correctness and completeness of the update operation, avoid confusion or omissions during the update process, and improve the accuracy and timeliness of graph database updates, thereby providing users with accurate query results and improving user experience.

[0051] In order to clearly illustrate how the graph database synchronized with the graph data model is updated based on the updated content in the graph data model in the above embodiment, the present disclosure proposes another data synchronization method.

[0052] Figure 2 It is a flowchart of the data synchronization method shown in the second embodiment of the present disclosure.

[0053] like Figure 2 As shown, the data synchronization method includes the following steps:

[0054] Step 201: Obtain the graph data model obtained by the most recent update.

[0055] Step 202: When the model change information is obtained, constraint verification is performed on the model change information.

[0056] Step 203: In response to the model change information passing the constraint verification, the graph data model is updated according to the model change information.

[0057] Step 204: Generate a first structured query statement for updating the graph database based on the updated content in the graph data model.

[0058] In order to ensure that the updated content in the graph data model is correctly synchronized to the graph database and maintain the consistency and integrity of the data, as an example, based on the updated content in the graph data model, an update instruction for updating the graph database is generated, that is, a first structured query statement for updating the graph database is generated.

[0059] For example, for adding a new node, an INSERT statement is generated to insert the new node information into the graph database; for deleting a node, a DELETE statement is generated to delete the specified node from the graph database.

[0060] Step 205: Execute the first structured query statement to update the graph database synchronized with the graph data model.

[0061] Furthermore, the first structured query statement generated according to the updated content in the graph data model is executed to ensure that the data in the graph database is consistent with the graph data model.

[0062] It should be noted that the execution process of steps 201 to 203 can be implemented in any of the embodiments of the present disclosure, and the embodiments of the present disclosure do not limit this and will not be described in detail.

[0063] In summary, based on the updated content in the graph data model, a first structured query statement is generated for updating the graph database; the first structured query statement is executed to update the graph database synchronized with the graph data model. Thus, by automatically generating and executing the first structured query statement, the data in the graph database is ensured to be consistent with the graph data model, thereby improving the accuracy of the graph database, thereby providing users with accurate query results and enhancing the user experience.

[0064] In order to clearly illustrate that in the above embodiment, constraint verification is performed on the model change information when the model change information is obtained, the present disclosure proposes another data synchronization method.

[0065] Figure 3 It is a flowchart of the data synchronization method shown in the third embodiment of the present disclosure.

[0066] like Figure 3 As shown, the data synchronization method includes the following steps:

[0067] Step 301: Obtain the graph data model obtained by the most recent update.

[0068] Step 302: Receive model configuration information sent by the client.

[0069] The model configuration information is obtained by the client configuring the interactive components associated with the graph data model in response to the model configuration operation.

[0070] In order to reduce the complexity of updating the graph data model, as an example, the user performs model configuration operations on the interactive components associated with the graph data model on the client's visual interface. The client generates model configuration information in response to the model configuration operation and sends the model configuration information to the server. For example, the client sends the model configuration information to the server in a structured format (such as JSON, XML, etc.), where the configuration information includes various configuration operations performed by the user on the graph data model, such as adding nodes, deleting nodes, modifying node properties, adding edges, deleting edges, modifying edge properties, etc.

[0071] It should be noted that for the same graph database, the clients logged in by different users correspond to their own graph data models to ensure data isolation and security between users.

[0072] Step 303: extract model change information from the model configuration information.

[0073] Furthermore, the model configuration information is parsed to extract model change information from the model configuration information, wherein the model change information includes the change type and change content, wherein the change type includes: adding a new node, deleting a node, modifying a node attribute, adding an edge, deleting an edge, modifying an edge attribute, etc., and the change content includes: node ID, node type, attribute value, edge ID, starting node ID, ending node ID, edge type, attribute value, etc.

[0074] Step 304: perform constraint verification on the model change information.

[0075] As an example, the model change information is parsed to obtain the model change content under at least one model change type; wherein the model change content includes: at least one of the change node, the attribute information of the change node, and the association relationship between the change nodes; and the model change content under the model change type is constraint verified by setting constraint rules.

[0076] That is, the model change information is parsed to identify the specific change content under at least one model change type, where the change content may include the change node, the attribute information of the change node, and the adjustment of the relationship between the change nodes; then, the change content is verified using pre-set constraint rules to ensure that the change meets the expected specifications and requirements.

[0077] Step 305 : In response to the model change information passing the constraint verification, the graph data model is updated according to the model change information.

[0078] Step 306: Based on the updated content in the graph data model, update the graph database synchronized with the graph data model.

[0079] It should be noted that the execution process of step 301 and steps 305 to 306 can be implemented in any way in the embodiments of the present disclosure, and the embodiments of the present disclosure do not limit this and will not be described in detail.

[0080] In summary, by receiving the model configuration information sent by the client, extracting the model change information from the model configuration information, and performing constraint verification on the model change information, it is ensured that the update of the graph data model is based on the user's specific configuration operations, reducing the time and effort of manual operations, and supporting batch configuration and dynamic adjustment, thereby improving the flexibility and accuracy of data synchronization and enhancing the user experience.

[0081] In order to clearly illustrate that in the above embodiment, constraint verification is performed on the model change information when the model change information is obtained, the present disclosure proposes another data synchronization method.

[0082] Figure 4 It is a flowchart of the data synchronization method shown in the fourth embodiment of the present disclosure.

[0083] like Figure 4 As shown, the data synchronization method includes the following steps:

[0084] Step 401: Obtain the graph data model obtained by the most recent update.

[0085] Step 402: In response to receiving the model change request, the model change request is parsed to obtain model change information in the model change request.

[0086] As an example, a model change request is received from a user or other related system via an interface (such as an API, web service, or message queue). The model change request may be in various formats, including but not limited to JSON, XML, and other formats. The model change request is then parsed, and after parsing the model change request, specific model change information is extracted from the parsed data structure. The model change information includes the name of the model to be modified, the attributes or fields of the model, and the type of change (such as add, delete, update).

[0087] Step 403: perform constraint verification on the model change information.

[0088] As an example, the model change information is parsed to obtain the model change content under at least one model change type; wherein the model change content includes: at least one of the change node, the attribute information of the change node, and the association relationship between the change nodes; and the model change content under the model change type is constraint verified by setting constraint rules.

[0089] Step 404 : In response to the model change information passing constraint verification, the graph data model is updated according to the model change information.

[0090] Step 405: Based on the updated content in the graph data model, the graph database synchronized with the graph data model is updated.

[0091] It should be noted that the execution process of step 401 and steps 404 to 405 can be implemented in any way in the embodiments of the present disclosure, and the embodiments of the present disclosure do not limit this and will not be described in detail.

[0092] In summary, by responding to received model change requests, parsing the model change requests to obtain model change information, and performing constraint verification on the model change information, the legitimacy and accuracy of the change requests can be ensured, data inconsistency and erroneous updates can be avoided, and the stability and reliability of data synchronization updates can be improved.

[0093] Corresponding to the data synchronization method provided in the above embodiment, the present disclosure also provides a data synchronization device. Since the data synchronization device provided in the embodiment of the present disclosure corresponds to the data synchronization method provided in the above embodiment, the implementation method of the data synchronization method is also applicable to the data synchronization device provided in the embodiment of the present disclosure, and will not be described in detail in the embodiment of the present disclosure.

[0094] Figure 5 It is a structural diagram of a data synchronization device shown in the fifth embodiment of the present disclosure.

[0095] like Figure 5 As shown, the data synchronization device 500 includes: an acquisition module 510 , a verification module 520 , a first update module 530 and a second update module 540 .

[0096] Among them, the acquisition module 510 is used to obtain the graph data model obtained by the most recent update; the verification module 520 is used to perform constraint verification on the model change information when the model change information is obtained; the first update module 530 is used to update the graph data model according to the model change information in response to the constraint verification of the model change information; the second update module 540 is used to update the graph database synchronized with the graph data model based on the updated content in the graph data model.

[0097] As a possible implementation method of an embodiment of the present disclosure, the second update module 540 is used to generate a first structured query statement for updating the graph database based on the updated content in the graph data model; and execute the first structured query statement to update the graph database synchronized with the graph data model.

[0098] As a possible implementation method of the embodiment of the present disclosure, the verification module 520 is used to receive model configuration information sent by the client; wherein the model configuration information is obtained by the client in response to the model configuration operation by configuring the interactive components associated with the graph data model; extract model change information from the model configuration information; and perform constraint verification on the model change information.

[0099] As a possible implementation of the embodiment of the present disclosure, the verification module 520 is configured to, in response to receiving a model change request, parse the model change request to obtain model change information in the model change request; and perform constraint verification on the model change information.

[0100] As a possible implementation method of an embodiment of the present disclosure, the verification module 520 is used to parse the model change information to obtain the model change content under at least one model change type; wherein the model change content includes: at least one of the change node, the attribute information of the change node and the association relationship between the change nodes; and the model change content under the model change type is subjected to constraint verification by setting constraint rules.

[0101] As a possible implementation method of the embodiment of the present disclosure, the verification module 520 is used to verify the uniqueness of the node identification information of the changed nodes in the model change content; to verify the reference integrity of the node identification information; to verify the domain integrity of the attribute information of the changed nodes in the model change content; and to verify the relationship integrity of the association relationship between the changed nodes in the model change content.

[0102] As a possible implementation method of an embodiment of the present disclosure, the first update module 530 is used to obtain the model change type indicated by the model change information and the model change content under the model change type in response to the model change information passing the constraint verification; based on the model change content, generate a second structured query statement adapted to the model change type; execute the second structured query statement to update the graph database model.

[0103] As a possible implementation method of an embodiment of the present disclosure, the first update module 530 is also used to obtain abnormal information in the model change information in response to the model change information failing verification; generate prompt information based on the abnormal information, and send the prompt information to the client; wherein the prompt information is used to prompt the abnormal information in the model change information.

[0104] As a possible implementation of the embodiment of the present disclosure, the data synchronization device 500 further includes: an archiving module.

[0105] Among them, the archiving module is used to obtain the version information of the graph data model; archive the graph data model and version information; and the version information is used for version rollback.

[0106] The data synchronization device of the embodiment of the present disclosure obtains the graph data model obtained by the most recent update; when the model change information is obtained, the model change information is subjected to constraint verification; in response to the model change information passing the constraint verification, the graph data model is updated according to the model change information; based on the updated content in the graph data model, the graph database synchronized with the graph data model is updated. Thus, before updating the graph data model, the model change information is subjected to strict constraint verification to avoid data inconsistency and erroneous updates. When updating the graph data model, the graph database is synchronously updated to ensure the correctness and completeness of the update operation, avoid confusion or omissions during the update process, and improve the accuracy of graph database updates, thereby providing users with accurate query results and improving user experience.

[0107] In an exemplary embodiment, an electronic device is also provided.

[0108] Among them, electronic equipment includes:

[0109] processor;

[0110] a memory for storing processor-executable instructions;

[0111] The processor is configured to execute instructions to implement the data synchronization method proposed in any of the aforementioned embodiments.

[0112] As an example, Figure 6 is a structural diagram of an electronic device 600 shown in an exemplary embodiment of the present disclosure, such as Figure 6 As shown, the electronic device 600 may further include:

[0113] The memory 610 and the processor 620, a bus 630 connecting different components (including the memory 610 and the processor 620), the memory 610 stores a computer program, and when the processor 620 executes the program, the data synchronization method described in the embodiment of the present disclosure is implemented.

[0114] Bus 630 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures. Examples of these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0115] The electronic device 600 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the electronic device 600, including volatile and non-volatile media, removable and non-removable media.

[0116] The memory 610 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 640 and / or cache memory 650. The server 600 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 660 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 Not shown, often called a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 630 via one or more data medium interfaces. Memory 610 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of various embodiments of the present disclosure.

[0117] A program / utility 680 having a set (at least one) of program modules 670 may be stored, for example, in memory 610. Such program modules 670 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may include an implementation of a network environment. Program modules 670 generally implement the functions and / or methods of the embodiments described herein.

[0118] The electronic device 600 can also communicate with one or more external devices 690 (e.g., a keyboard, a pointing device, a display 691, etc.), one or more devices that enable a user to interact with the electronic device 600, and / or any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication can occur via an input / output (I / O) interface 692. Furthermore, the electronic device 600 can communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network such as the Internet) via a network adapter 693. As shown, the network adapter 693 communicates with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown, other hardware and / or software modules can be used in conjunction with the electronic device 600, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0119] The processor 620 executes various functional applications and data processing by running programs stored in the memory 610 .

[0120] It should be noted that the implementation process and technical principles of the electronic device of this embodiment can be found in the aforementioned explanation of the data synchronization method of the embodiment of the present disclosure, and will not be repeated here.

[0121] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory including instructions. The instructions can be executed by a processor of an electronic device to perform the data synchronization method proposed in any of the above embodiments. Alternatively, the computer-readable storage medium can be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.

[0122] In an exemplary embodiment, a computer program product is further provided, including a computer program / instruction, wherein the computer program / instruction, when executed by a processor, implements the data synchronization method proposed in any of the above embodiments.

[0123] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the following claims.

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

Claims

1. A data synchronization method, characterized in that: include: Get the graph data model obtained by the latest update; Receiving model configuration information sent by a client; wherein the model configuration information is obtained by the client configuring the interactive components associated with the graph data model in response to the model configuration operation. For the same graph database, clients logged in by different users correspond to different graph data models; extracting model change information from the model configuration information; In response to the model change information passing constraint verification, updating the graph data model according to the model change information; Based on the updated content in the graph data model, updating the graph database synchronized with the graph data model; The performing constraint verification on the model change information includes: Parsing the model change information to obtain model change content under at least one model change type; wherein the model change content includes at least one of: a change node, attribute information of the change node, and an association relationship between the change nodes; By setting constraint rules, constraint verification is performed on the model change content under the model change type.

2. The method according to claim 1, characterized in that The updating of the graph database synchronized with the graph data model based on the updated content in the graph data model includes: Generating a first structured query statement for updating the graph database according to the updated content in the graph data model; The first structured query statement is executed to update the graph database synchronized with the graph data model.

3. The method according to claim 1, characterized in that The setting of constraint rules to perform constraint verification on the model change content under the model change type includes at least one of the following: Verifying the uniqueness of node identification information of the changed node in the model change content; Performing reference integrity verification on the node identification information; Performing domain integrity verification on attribute information of the changed nodes in the model change content; The relationship integrity verification is performed on the association relationship between the changed nodes in the model change content.

4. The method according to claim 1, wherein In response to the model change information passing the constraint verification, updating the graph data model according to the model change information includes: In response to the model change information passing the constraint verification, obtaining a model change type indicated by the model change information and model change content under the model change type; Based on the model change content, generating a second structured query statement adapted to the model change type; Execute the second structured query statement to update the graph database model.

5. The method according to claim 4, characterized in that The method further comprises: In response to the model change information failing verification, obtaining abnormal information in the model change information; Prompt information is generated according to the abnormal information, and the prompt information is sent to the client; wherein the prompt information is used to prompt the abnormal information in the model change information.

6. The method according to claim 1, characterized in that In response to the model change information passing constraint verification, before updating the graph data model according to the model change information, the method further includes: Obtaining version information of the graph data model; The graph data model and the version information are archived; wherein the version information is used for version rollback.

7. A data synchronization device, characterized in that: include: The acquisition module is used to obtain the graph data model obtained by the latest update; A verification module is configured to receive model configuration information sent by a client; wherein the model configuration information is obtained by the client configuring the interactive components associated with the graph data model in response to a model configuration operation, and for the same graph database, clients logged in by different users correspond to different graph data models; extract model change information from the model configuration information; and perform constraint verification on the model change information; a first updating module, configured to update the graph data model according to the model change information in response to the model change information passing constraint verification; A second updating module, configured to update a graph database synchronized with the graph data model based on updated content in the graph data model; The verification module is specifically used to: Parsing the model change information to obtain model change content under at least one model change type; wherein the model change content includes at least one of: a change node, attribute information of the change node, and an association relationship between the change nodes; By setting constraint rules, constraint verification is performed on the model change content under the model change type.

Citation Information

Patent Citations

  • A fast storage and query method of time-varying graph data

    CN109145121A

  • Knowledge graph automatic updating method based on natural language processing technology

    CN118607623A