Data synchronization method and device
By obtaining and verifying the model change information of the graph database and synchronously updating the graph database, the problem of manual operation time-consuming and high error rate in graph database updates is solved, and high accuracy and timely graph database updates are achieved, improving user experience.
Patent Information
- Application Number
- CN202411733899.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-28
AI Technical Summary
When updating the graph database, the existing technology requires manual operation, which leads to high consumption of time and energy, and is prone to errors such as omitted updates or input errors, which cannot provide accurate query results and reduce user experience.
Provide a data synchronization method and device, by obtaining the graph data model obtained by the latest update, obtaining the model change information, and performing constraint verification on it. In response to the verified model change information, the graph data model is updated, and the graph database is updated simultaneously based on the update content.
Through strict constraint verification and synchronous update mechanisms, avoid data inconsistency and erroneous updates, ensure the correctness and completeness of update operations, improve the accuracy and timeliness of graph database updates, thereby providing accurate query results and improving user experience.
Smart Images

Figure CN119577035A_ABST
Abstract
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 correlation of data are also increasing. Traditional relational databases cannot meet the needs of efficient storage and query when processing such highly correlated and complex data. Graph databases, with their unique graph structure, can efficiently store and query complex relational data, making them the best choice for processing such data. However, business scenarios are constantly changing. In order to meet the evolving business needs, graph databases need to be updated when 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 missing 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 device to solve one of the technical problems in the related art at least to a certain extent. 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, used to obtain a graph data model obtained by the most recent update; a verification module, used to perform constraint verification on the model change information when the model change information is obtained; a first update module, used to update 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, used to update 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 a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When instructions in the computer-readable storage medium are executed by a 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, wherein when the computer program is executed by a processor, the data synchronization method as described in the embodiment of the first aspect of the present disclosure is implemented.
[0010] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0011] In the technical scheme, the graph data model obtained by the most recent 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 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; the first structured query statement is executed to update the graph database synchronized with the graph data model, ensuring 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, thereby 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 present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] The 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 improper limitations on the present disclosure.
[0014] Figure 1 is a flowchart of a data synchronization method shown in the first embodiment of the present disclosure;
[0015] Figure 2 is a flowchart of a data synchronization method shown in the second embodiment of the present disclosure;
[0016] Figure 3 is a flowchart of a data synchronization method shown in the third embodiment of the present disclosure;
[0017] Figure 4 is a flowchart of a data synchronization method shown in the 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 in conjunction with the accompanying drawings.
[0021] It should be noted that the terms "first", "second", etc. 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 sequence. It should be understood that the data used in this way can be interchanged 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 devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0022] It should be noted that in the technical solution of the present disclosure, 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 pre-defined data schemas, which are not flexible enough when facing complex and ever-changing application scenarios. In modern applications, data models change frequently, especially in the fields of social networks, the Internet of Things, configuration libraries, etc., where data structures and relationships often change. After the data model changes, the graph database needs to be updated synchronously. Therefore, how to synchronize and update the graph database has become an urgent problem to be solved.
[0024] In view of the above problems, the present disclosure proposes a data synchronization method and device.
[0025] The data synchronization method and device according to the embodiments of the present disclosure are 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] In order to improve the accuracy of graph database updates, as a possible implementation method, the graph database is updated synchronously 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, so that when the graph database is synchronously updated based on the graph data model, the graph data model obtained by the most recent update can be obtained. Among them, the graph data model includes nodes, relationships between nodes, node attributes, etc. Among them, nodes are used to represent entities or objects in the graph data model, the relationships between nodes are used to represent the connection or association between entities, and node attributes are used to represent the specific characteristics or attribute information of the nodes.
[0030] Step 102: When the model change information is obtained, constraint verification is performed on the model change information.
[0031] In order to improve the accuracy of graph data model updates, as a possible implementation method, the set constraint rules are used to perform constraint verification on the model change information to ensure the correctness and legality of the model change information. It should be noted that the model change information includes the addition, deletion, attribute modification of nodes in the graph data model, and the change of the relationship between nodes; the constraint rules can be set according to actual needs, for example, the constraint rules can be generated based on historical model change records and user feedback.
[0032] As a first possible implementation manner, uniqueness verification is performed on node identification information of a 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 as to accurately distinguish and locate different nodes and avoid 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 is verified. By verifying the reference 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 related to it 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 manner, the relationship integrity verification is performed on the association relationship between the change 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 relationship integrity verification is performed on the association relationships between the changed nodes in the model change content. The 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 constraint verification, the graph data model is updated according to the model change information.
[0041] As a possible implementation method, when the model change information passes the constraint verification, the graph data model is updated based on the change type and change content in the model change information. The change types include: node changes, changes in the relationship between nodes, attribute changes, and structural changes, etc. The change content includes: changes in node information, changes in relationship information, changes in attribute information, and structural changes.
[0042] As an example, in response to the model change information passing 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 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.
[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 a 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; 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 accuracy in graph database updates, 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 most recent 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 embodiments, the present disclosure proposes another data synchronization method.
[0052] Figure 2 It is a flowchart of a 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 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 data consistency and integrity, 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 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 manner 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.
[0063] In summary, based on the updated content in the graph data model, a first structured query statement for updating the graph database is generated; 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, it is ensured that the data in the graph database is 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, when the model change information is obtained, the model change information is subjected to constraint verification, the present disclosure proposes another data synchronization method.
[0065] Figure 3 It is a flowchart of a 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 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 constraint verification is performed on the model change content under the model change type by setting constraint rules.
[0076] That is to say, 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 change nodes, attribute information of change nodes, and adjustment of the association relationship between 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 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, when the model change information is obtained, the model change information is subjected to constraint verification, the present disclosure proposes another data synchronization method.
[0082] Figure 4 It is a flowchart of a 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 from a user or other related system is received through an interface (such as an API, a Web service, a message queue, etc.); wherein the model change request may exist in various forms, such as, but not limited to, data in formats such as JSON and XML, and then the model change request is 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, the type of change (such as add, delete, update), etc.
[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 constraint verification is performed on the model change content under the model change type 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 manner 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 the received model change request, parsing the model change request to obtain the model change information, and performing constraint verification on the model change information, the legitimacy and accuracy of the change request 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-mentioned 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-mentioned 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 model change information passing the constraint verification; 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 the 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; extracting model change information from the model configuration information; and performing constraint verification on the model change information.
[0099] As a possible implementation of the embodiment of the present disclosure, the verification module 520 is used to parse the model change request in response to receiving the model change request to obtain the model change information in the model change request; and perform constraint verification on the model change information.
[0100] As a possible implementation method of the 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 the 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 the version information; wherein the version information is used for version rollback.
[0106] The data synchronization device of the disclosed embodiment obtains the graph data model obtained by the most recent update; 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. Thus, 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 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 schematic diagram of the structure 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. By way of example, 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, usually 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 disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 630 via one or more data medium interfaces. The memory 610 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the 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 the memory 610, such program modules 670 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 670 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0118] The electronic device 600 may also communicate with one or more external devices 690 (e.g., keyboard, pointing device, display 691, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 692. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or 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 in the figure, other hardware and / or software modules may 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 the 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 refer to 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, and the above instructions can be executed by a processor of an electronic device to complete the data synchronization method proposed in any of the above embodiments. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0122] In an exemplary embodiment, a computer program product is also provided, including a computer program / instruction, characterized in that when the computer program / instruction is executed by a processor, the data synchronization method proposed in any of the above embodiments is implemented.
[0123] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present 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 that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are 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 may 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 most recent update; When the model change information is obtained, constraint verification is performed on the model change 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, a graph database synchronized with the graph data model is updated.
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: Generate a first structured query statement for updating the graph database according to the updated content in the graph data model; Execute the first structured query statement to update the graph database synchronized with the graph data model.
3. The method according to claim 1, characterized in that When the model change information is obtained, constraint verification is performed on the model change information, including: Receiving model configuration information sent by a client; wherein the model configuration information is obtained by the client configuring an interactive component associated with the graph data model in response to a model configuration operation; extracting the model change information from the model configuration information; Constraint verification is performed on the model change information.
4. The method according to claim 1, characterized in that: When the model change information is obtained, constraint verification is performed on the model change information, including: In response to receiving the model change request, parsing the model change request to obtain model change information in the model change request; Constraint verification is performed on the model change information.
5. The method according to claim 3 or 4, characterized in that: 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 a change node, and an association relationship between change nodes; By setting constraint rules, constraint verification is performed on the model change content under the model change type.
6. The method according to claim 5, characterized in that The adopting of setting 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 nodes 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 of the association relationship between the changed nodes in the model change content is verified.
7. The method according to claim 1, characterized in that 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 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, generate a second structured query statement adapted to the model change type; Execute the second structured query statement to update the graph database model.
8. The method according to claim 7, 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.
9. The method according to claim 1, characterized in that: In response to the model change information passing the 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.
10. 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, used for performing constraint verification on the model change information when the model change information is obtained; 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; The second updating module is used to update the graph database synchronized with the graph data model based on the updated content in the graph data model.
Citation Information
Patent Citations
A fast storage and query method of time-varying graph data
CN109145121A
Query processing method and device applied to code change
CN117931672A
Knowledge graph automatic updating method based on natural language processing technology
CN118607623A
System and method for supporting xquery update language
KR100691261B1
Real-time saved-query updates for a large graph
US20150363461A1