Graph data importing method, electronic equipment and graph data importing system

By embedding the graph database serialization module and schema management module in the computing engine, graph data is directly imported into the graph database storage end, which solves the problem of low efficiency of the graph database server and enables efficient import and flexible writing of massive graph data. .

CN118568142APending Publication Date: 2024-08-30GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1

Patent Information

Application Number
CN202310190224.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-28
Publication Date
2024-08-30

AI Technical Summary

Technical Problem

In the existing technology, when importing graph data into a graph database, the HTTP interface is inefficient and cannot support efficient writing of massive graph data, and the single-node processing efficiency is limited, mainly due to the checksum serialization and deserialization logic of the graph database server. Too many, leading to bottlenecks.

Method used

By embedding the graph database serialization module in the computing engine, the graph data is directly serialized and imported into the graph database storage end in batches, skipping the graph database server, reducing performance consumption, and adding a schema management module to the computing engine for schema verification. and data conversion, dynamically updating the graph database storage structure.

Benefits of technology

It achieves real-time and efficient import of massive graph data, improves the efficiency of graph data import, reduces the performance consumption of the graph database server, and supports the flexibility and efficient writing of graph data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118568142A
    Figure CN118568142A
Patent Text Reader

Abstract

The embodiment of the invention relates to the technical field of data processing, and discloses a graph data importing method, electronic equipment and a graph data importing system.The graph data importing method comprises the steps that multiple pieces of graph data are obtained; performing serialization operation on each piece of graph data through a calculation engine to obtain original graph data information corresponding to each piece of graph data; and importing the original graph data information into a graph database storage end in batches. Serialization operation is conducted on the graph data through the calculation engine, then the graph data subjected to serialization operation are directly imported into the graph database storage end in batches, the graph database server side can be skipped, the graph data are stored into the graph database storage end, and therefore the efficiency of importing the graph data into the graph database is improved, and the user experience is improved. And massive graph data can be efficiently imported into the graph database in real time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of data processing technology, and in particular, to a graph data importing method, an electronic device, and a graph data importing system. Background Art

[0002] HugeGraph is an open source graph database system developed by Baidu. It supports the rapid import of more than 10 billion vertices and edges, provides millisecond-level association query capabilities, and can be integrated with big data platforms for offline analysis.

[0003] The existing technology imports graph data into HugeGraph through the HTTP interface provided by the graph database server (HugeGraph Server). However, for scenarios with large amounts of graph data, the HTTP interface will become a bottleneck, and due to the large amount of verification and serialization and deserialization logic in HugeGraphServer, the efficiency of processing graph data by a single-node HugeGraph Server is very limited, and it cannot support the efficient writing of massive graph data. Summary of the invention

[0004] The embodiments of the present application aim to provide a graph data importing method, an electronic device and a graph data importing system, so as to improve the efficiency of importing graph data into a graph database and realize real-time and efficient import of massive graph data into the graph database.

[0005] The embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, an embodiment of the present application provides a method for importing graph data, including:

[0007] Get multiple graph data;

[0008] Perform serialization operations on each graph data through the computing engine to obtain the original graph data information corresponding to each graph data;

[0009] Import the original graph data information into the graph database storage end in batches.

[0010] In some embodiments, obtaining a plurality of graph data includes:

[0011] Collect multiple graph data from the business system into the message queue, where the message queue is decoupled from the business system;

[0012] Use the computing engine to batch obtain graph data in the message queue.

[0013] In some embodiments, the computing engine includes a graph database serialization module, and the graph database serialization module is used to perform serialization operations on graph data;

[0014] The computing engine performs serialization operations on each graph data to obtain the original graph data information corresponding to each graph data, including:

[0015] Determine a plurality of graph data information corresponding to the graph data, wherein each type of graph data information corresponds to a data type, and the graph data information includes one or more of an alias, an attribute, and an index of the graph data;

[0016] Converting a data type corresponding to the graph data information into a first data type, wherein the data type corresponding to the graph data information is different from the first data type, and the first data type matches a data structure of a graph database storage end;

[0017] The graph data information converted into the first data type is determined as the original graph data information.

[0018] In some embodiments, after obtaining the graph data in the message queue in batches through the computing engine, the method further includes:

[0019] Perform pattern verification on each graph data through the calculation engine to obtain the pattern verification result;

[0020] If the mode verification result is a mode change, an update request is sent to the graph database server through the computing engine to update the first graph data information stored in the graph database server.

[0021] In some embodiments, the computing engine further includes a mode management module, the mode management module being used to perform mode verification on the graph data;

[0022] The graph data is schema-checked through the computing engine to obtain schema-check results, including:

[0023] Obtaining first graph data information stored in the graph database server through a computing engine, and storing the first graph data information in a mode management module;

[0024] If the graph data information corresponding to the graph data is different from the first graph data information, then the mode check result is determined to be a mode change.

[0025] In some embodiments, if the mode check result is a mode change, the method further includes:

[0026] Record the update log and issue an alarm prompt to perform change verification and obtain the change verification result;

[0027] If the change verification result is the first verification result, a rollback operation is performed on the graph data corresponding to the graph data information;

[0028] If the change verification result is the second verification result, the first graph data information stored in the graph database server is updated.

[0029] In some embodiments, the graph data includes vertex data and edge data;

[0030] Import the original graph data information into the graph database storage end in batches, including:

[0031] If the graph database storage end receives the original graph data information corresponding to the edge data, but does not receive the original graph data information of the source node and / or the target node corresponding to the edge data, the computing engine creates the first version of the original graph data information corresponding to the source node and the target node respectively and records the first version time;

[0032] After the graph database storage end receives the original graph data information corresponding to the source node and / or the target node respectively, the computing engine stores the original graph data information corresponding to the source node and / or the target node respectively as the second version of the original graph data information to the graph database storage end and records the second version time, wherein the first version time is earlier than the second version time.

[0033] In some embodiments, the original graph data information includes attributes;

[0034] Importing raw graph data information into the graph database storage end in batches also includes:

[0035] If the data stored in the graph database storage end is updated, the latest original graph data information corresponding to the data is inserted into the graph database storage end through the computing engine, and each version of the data obtained after each update and the update time of the attributes are saved;

[0036] If a deletion operation is performed on the data stored in the graph database storage end, the deletion data information corresponding to the data is inserted into the graph database storage end through the computing engine, wherein the deletion data information includes a deletion mark attribute and a deletion time.

[0037] In some embodiments, after the original graph data information is imported into the graph database storage end in batches, the method further includes:

[0038] Query the graph database storage end and return the latest version of the data corresponding to the attribute based on the update time of the attribute;

[0039] And / or, query the graph database storage end to determine whether the deletion operation is completed based on the deletion mark attribute of the latest version of the data, wherein the update time of the latest version of the data is later than the deletion time corresponding to the deletion operation;

[0040] If the delete mark attribute is false, the deletion operation is determined to be complete;

[0041] If the delete flag attribute is true, then it is determined that the delete operation is not complete.

[0042] In a second aspect, an embodiment of the present application provides an electronic device, including:

[0043] at least one processor, and

[0044] a memory communicatively coupled to at least one processor, wherein:

[0045] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor to enable the at least one processor to execute the graph data importing method of the first aspect.

[0046] In a third aspect, an embodiment of the present application provides a graph data importing system, applying the graph data importing method of the first aspect, and the graph data importing system includes:

[0047] Business system, used to generate graph data;

[0048] Message queue, used to receive graph data from the business system;

[0049] The computing engine is used to obtain graph data from the message queue and import the graph data into the graph database;

[0050] Graph database, used to store graph data.

[0051] In some embodiments, the computing engine includes a graph database serialization module and a schema management module. The graph database serialization module is used to perform serialization operations on graph data, and the schema management module is used to perform schema verification on graph data.

[0052] In some embodiments, the graph database includes a graph database storage end and a graph database server end, the graph database storage end is used to store original graph data information, and the graph database server end is used to store first graph data information.

[0053] In a fourth aspect, an embodiment of the present application provides a non-volatile computer-readable storage medium, which stores computer-executable instructions, and the computer-executable instructions are used to enable an electronic device to execute the image data importing method of the first aspect.

[0054] Beneficial effects of the embodiments of the present application: Different from the prior art, the embodiments of the present application provide a method for importing graph data, including: obtaining multiple graph data; performing serialization operations on each graph data through a computing engine to obtain the original graph data information corresponding to each graph data; and importing the original graph data information in batches into the graph database storage end. By performing serialization operations on the graph data through a computing engine, and then directly importing the serialized graph data in batches into the graph database storage end, the present application can skip the graph database server end and store the graph data into the graph database storage end, thereby improving the efficiency of importing graph data into the graph database and realizing real-time and efficient import of massive graph data into the graph database. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0056] Figure 1 It is a structural schematic diagram of a graph data import system provided in an embodiment of the present application;

[0057] Figure 2 is a structural diagram of a computing engine provided in an embodiment of the present application;

[0058] Figure 3 It is a structural schematic diagram of a graph database provided in an embodiment of the present application;

[0059] Figure 4 It is an interaction sequence diagram of a business system, a message queue, a computing engine, a graph database server, and a graph database storage end provided in an embodiment of the present application;

[0060] Figure 5 It is an interaction sequence diagram of a business system, a message queue, a computing engine, and a graph database storage end provided in an embodiment of the present application;

[0061] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0062] Figure 7 It is a flowchart of a method for importing graph data provided in an embodiment of the present application;

[0063] Figure 8 yes Figure 7 A detailed flow chart of step S701 in FIG.

[0064] Fig. 9 yes Figure 7 A detailed flow chart of step S702 in FIG.

[0065] Fig.10 This is a schematic diagram of a process for updating first graph data information stored in a graph database server provided by an embodiment of the present application;

[0066] Fig.11 yes Fig.10 A detailed flow chart of step S101 in FIG.

[0067] Fig.12 It is a schematic diagram of a process of rolling back graph data corresponding to graph data information provided by an embodiment of the present application;

[0068] Fig.13 yes Figure 7 A detailed flow chart of step S703 in FIG.

[0069] Fig.14 yes Figure 7 Another detailed flow chart of step S703 in FIG.

[0070] Fig.15 It is a schematic diagram of a process of querying a graph database storage end provided in an embodiment of the present application;

[0071] Fig.16 yes Fig.15 A detailed flowchart of step S1502 in FIG.

[0072] Description of Figure Numbers:

[0073]

[0074] DETAILED DESCRIPTION

[0075] The present application is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present application, but do not limit the present application in any form. It should be noted that, for those of ordinary skill in the art, several variations and improvements can also be made without departing from the concept of the present application. These all belong to the protection scope of the present application.

[0076] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0077] It should be noted that, if there is no conflict, the various features in the embodiments of the present application can be combined with each other, all within the scope of protection of the present application. In addition, although the functional module division is performed in the device schematic diagram and the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in a sequence different from the module division in the device or the flow chart. In addition, the words "first", "second", "third", etc. used herein do not limit the data and execution order, but only distinguish the same items or similar items with basically the same functions and effects.

[0078] Unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used in this specification and in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used in this specification includes any and all combinations of one or more of the related listed items.

[0079] In addition, the technical features involved in each embodiment of the present application described below can be combined with each other as long as they do not conflict with each other.

[0080] Before explaining the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations:

[0081] (1) Graph data consists of a finite non-empty set of nodes and a set of edges between nodes. Nodes are also called vertices or entities, and edges are used to connect two different nodes. Edges are also called relationships.

[0082] (2) Schema refers to a group of related database objects, including tables, fields, field types, indexes, foreign keys, etc. These objects are connected through SQL syntax, where tables are composed of fields and foreign keys point to tables and fields.

[0083] The technical solution of the present application is described in detail below in conjunction with the accompanying drawings.

[0084] See also Figure 1 , Figure 1 It is a structural schematic diagram of a graph data import system provided in an embodiment of the present application;

[0085] like Figure 1 As shown, the graph data import system 100 includes: a business system 10, a message queue 20, a computing engine 30 and a graph database 40.

[0086] The business system 10 is used to generate graph data. In the embodiment of the present application, the business system 10 includes a management system for storing company business data.

[0087] The message queue 20 is used to receive the graph data in the business system 10. A message queue is a distributed message container that uses a queue as an underlying storage data structure to solve the communication between different processes and applications, and can also be called a message middleware. In the embodiment of the present application, the message queue 20 includes but is not limited to message queues such as ActiveMQ, RabbitMQ, Kafka, RocketMQ, and Redis.

[0088] The computing engine 30 is used to obtain the graph data in the message queue 20 and import the graph data into the graph database 40. In the embodiment of the present application, the computing engine 30 includes but is not limited to a distributed computing engine (Apache Flink).

[0089] Among them, Apache Flink is an open source distributed real-time computing engine that supports real-time consumption of massive graph data from message queues, and executes the computing logic of custom code in memory to parse the graph data and write the data into the graph database.

[0090] For details, please refer to Figure 2 , Figure 2 is a structural diagram of a computing engine provided in an embodiment of the present application;

[0091] like Figure 2 As shown, the computing engine 30 includes: a graph database serialization module 31 and a pattern management module 32.

[0092] The graph database serialization module 31 is used to perform serialization operations on the graph data to obtain the original graph data information corresponding to each graph data, for example: determine a number of graph data information corresponding to the graph data, wherein each graph data information corresponds to a data type, and the graph data information includes one or more of the alias, attribute, and index of the graph data; convert the data type corresponding to the graph data information into a first data type, wherein the data type corresponding to the graph data information is different from the first data type, and the first data type matches the data structure of the graph database storage end; determine the graph data information converted to the first data type as the original graph data information.

[0093] The mode management module 32 is used to perform mode verification on the graph data, and / or store the first graph data information, for example: obtaining the first graph data information stored in the graph database server, and storing the first graph data information in the mode management module; if the graph data information corresponding to the graph data is different from the first graph data information, then determining that the mode verification result is a mode change.

[0094] The graph database 40 is used to store graph data. In the embodiment of the present application, the graph database 40 includes but is not limited to an open source graph database (HugeGraph), wherein HugeGraph is a graph database system open sourced by Baidu, which can store a large number of vertices (Vertex) and edges (Edge), supports multi-user parallel operation, and users can input query statements and obtain graph query results in a timely manner.

[0095] For details, please refer to Figure 3 , Figure 3 It is a structural schematic diagram of a graph database provided in an embodiment of the present application;

[0096] like Figure 3 As shown, the graph database 40 includes: a graph database server 41 and a graph database storage 42.

[0097] The graph database server 41 is used to store first graph data information, wherein the first graph data information includes one or more of an alias, an attribute, and an index of the graph data.

[0098] The graph database storage end 42 is used to store original graph data information, wherein the original graph data information includes graph data information converted into the first data type. In the embodiment of the present application, the graph database storage end 42 includes a distributed database cluster (HBase C l uster), wherein HBase C l uster is a cluster composed of multiple distributed databases (HBase), HBase is an open source non-relational scalable distributed database, which is column-oriented and suitable for storing ultra-large loose data. HBase is suitable for business environments that perform real-time and random read and write operations on big data.

[0099] See also Figure 4 , Figure 4 It is an interaction sequence diagram of a business system, a message queue, a computing engine, a graph database server, and a graph database storage end provided in an embodiment of the present application;

[0100] Understandably, Figure 4 It represents the technical solution adopted in the prior art for importing graph data.

[0101] like Figure 4 As shown in the figure, the interaction process among the business system, message queue, computing engine, graph database server, and graph database storage includes:

[0102] Step S401: the business system sends multiple graph data to the message queue;

[0103] Specifically, the processor of the server collects multiple graph data from the business system into a message queue, wherein the message queue is decoupled from the business system, and the graph data includes edge data and point data.

[0104] Step S402: the message queue sends multiple graph data to the computing engine;

[0105] Specifically, the server processor obtains graph data in batches from the message queue through the computing engine.

[0106] Step S403: Send a write request;

[0107] Specifically, the processor of the server obtains the graph data in the message queue through the computing engine, and sends a write request to the graph database server to send the graph data to the graph database server.

[0108] Step S404: receiving a write request and performing a serialization operation on the graph data;

[0109] Specifically, the server processor converts graph data information (points, edges, attributes, etc.) of several different types (int type, string type, list type, etc.) corresponding to the graph data into a byte array (byte[]) structure through the graph database server.

[0110] Step S405: Sending graph data information in a byte array structure;

[0111] Specifically, the processor of the server transmits the graph data information in the byte array structure to the graph database storage end through the graph database server end.

[0112] Step S406: Receive graph data information in a byte array structure and perform structure conversion to store data.

[0113] Specifically, the server processor receives the graph data information in the byte array structure transmitted by the graph database server through the graph database storage end, converts the graph data information in the byte array structure into the original graph data information, and adjusts the storage structure of the original graph data information according to the different underlying database types, and then writes the data into the corresponding distributed database cluster.

[0114] It is understandable that although the computing engine can support real-time processing of billions of data without any pressure, the bottleneck of the entire graph data import process will appear on the graph database server. This is because the HTTP interface and API interface provided by the graph database server are not efficient and cannot support efficient writing of batch data. In addition, there are a lot of unnecessary verification and serialization and deserialization logic in the graph database server, and the efficiency of single-node graph database server processing is also relatively limited. Therefore, the process of interactive storage of data between the graph database server and the distributed database cluster of the graph database storage end includes multiple network IO and serialization and deserialization logic.

[0115] In view of this, an embodiment of the present application provides a method for importing graph data to improve the efficiency of importing graph data into a graph database.

[0116] Embodiment 1

[0117] In an embodiment of the present application, the serialization logic originally on the graph database server is streamlined to form a graph database serialization module, which is embedded in the computing engine. The graph database serialization module can directly convert several different types of graph data information into a data structure suitable for the graph database storage end, and then can directly connect to the distributed database cluster of the graph database storage end to write data into the cluster in batches.

[0118] See also Figure 5 , Figure 5 It is an interaction sequence diagram of a business system, a message queue, a computing engine, and a graph database storage end provided in an embodiment of the present application;

[0119] like Figure 5 As shown in the figure, the interaction process between the business system, message queue, computing engine, and graph database storage end includes:

[0120] Step S501: the business system sends multiple graph data to the message queue;

[0121] Specifically, the processor of the server collects multiple graph data from the business system into a message queue, wherein the message queue is decoupled from the business system, and the graph data includes edge data and point data.

[0122] Step S502: the message queue sends multiple graph data to the computing engine;

[0123] Specifically, the server processor obtains graph data in batches from the message queue through the computing engine.

[0124] Step S503: receiving graph data, and performing a serialization operation on each graph data to obtain original graph data information corresponding to each graph data;

[0125] Specifically, the processor of the server obtains the graph data in the message queue through the computing engine, and performs serialization operations on each graph data through the graph database serialization module in the computing engine to obtain the original graph data information corresponding to each graph data.

[0126] Step S504: Import the original graph data information into the graph database storage end in batches.

[0127] Specifically, the server processor imports the original graph data information in batches into the graph database storage end through the computing engine.

[0128] In an embodiment of the present application, by adding a graph database serialization module in the computing engine, the graph database serialization module performs serialization operations on the graph data. The present application can skip the graph database server and directly store the data in the graph database storage end, thereby reducing the performance consumption of the graph database server.

[0129] See also Figure 6 , Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;

[0130] like Figure 6 As shown, the electronic device 600 includes one or at least two processors 601 and a memory 602. Figure 6 A processor 601 is taken as an example.

[0131] The processor 601 and the memory 602 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.

[0132] Processor 601 is used to provide computing and control capabilities to control the electronic device 600 to perform corresponding tasks. For example, the graph data import method in controlling the electronic device 600 to perform any of the following method embodiments includes: obtaining multiple graph data; serializing each graph data through a computing engine to obtain the original graph data information corresponding to each graph data; and importing the original graph data information into the graph database storage end in batches.

[0133] The processor 601 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof; it may also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The above-mentioned PLD may be a complex programmable logic device (CPLD), a field programmable gate array (FPGA), a general array logic (GAL) or any combination thereof.

[0134] The memory 602, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the graph data import method in the embodiment of the present application. The processor 601 can implement the graph data import method in any of the following method embodiments by running the non-transitory software programs, instructions and modules stored in the memory 602. Specifically, the memory 602 may include a volatile memory (VM), such as a random access memory (RAM); the memory 602 may also include a non-volatile memory (NVM), such as a read-only memory (ROM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD) or other non-transitory solid-state storage device; the memory 602 may also include a combination of the above-mentioned types of memory.

[0135] The memory 602 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 602 may optionally include a memory remotely arranged relative to the processor 601, and these remote memories may be connected to the processor 601 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0136] One or more modules are stored in the memory 602, and when executed by one or more processors 601, the graph data import method in any of the following method embodiments is executed, for example, the following described Figure 7 The steps shown.

[0137] In the embodiment of the present application, the electronic device 600 may also have components such as a wired or wireless network interface, an input and output interface, etc., for input and output. The electronic device 600 may also include other components for realizing device functions, which will not be described in detail here.

[0138] The following describes the method for importing graph data provided in the embodiment of the present application in combination with the exemplary application and implementation of the electronic device provided in the embodiment of the present application.

[0139] See also Figure 7 , Figure 7 It is a flowchart of a method for importing graph data provided in an embodiment of the present application;

[0140] The method for importing graph data is applied to electronic devices, such as terminals and servers. Specifically, the execution subject of the method for importing graph data is one or at least two processors in the electronic device. The method for importing graph data is described below using a server as an example.

[0141] like Figure 7 As shown, the graph data import method includes:

[0142] Step S701: Acquire multiple graph data;

[0143] Specifically, the processor of the server obtains multiple graph data, wherein the graph data includes point data and edge data, each graph data corresponds to a number of graph data information, each type of graph data information corresponds to a data type, and the graph data information includes one or more of an alias (l abe l), a property (property), and an index (in ndex) of the graph data, wherein the alias includes a point alias or an edge alias, and the properties include a name (name), an operation (operate), and an update time (update_t ime).

[0144] For details, please refer to Figure 8 , Figure 8 yes Figure 7 A detailed flow chart of step S701 in FIG.

[0145] like Figure 8 As shown, step S701: obtaining multiple graph data, including:

[0146] Step S7011: collect multiple graph data from the business system into the message queue;

[0147] Specifically, the server processor collects multiple graph data from the business system into the message queue, where the business system is the upstream system that generates graph data. For example, in a social scenario, if A follows B, the business system will generate a graph data from A->B. The message queue is used to receive graph data from the business system, and the message queue is decoupled from the business system.

[0148] Among them, the graph data written to the message queue, for example: point data with the point alias person: {"l abe l":"person","name":"s imon","update_time":"2022-10-01

[0149] 00:00:00","operate":"in sert"}; Point data with the point alias movie: {"l abe l":"movie","name":"t itan ic","update_t ime":"2022-09-01

[0150] 00:00:00","operate":"in sert"}; Edge data with edge alias like: {"l abe l":"l ike","source_vertex":"simon","target_vertex":"t ita n ic","update_time":"2022-10-10 00:00:00","operate":"update"}.

[0151] Step S7012: Batch obtain graph data in the message queue through the computing engine.

[0152] Specifically, the server processor obtains graph data in batches from the message queue through the computing engine.

[0153] Step S702: performing serialization operation on each graph data through the computing engine to obtain original graph data information corresponding to each graph data;

[0154] Specifically, the computing engine includes a graph database serialization module, which is used to perform serialization operations on graph data. The server processor performs serialization operations on each graph data through the graph database serialization module in the computing engine to obtain the original graph data information corresponding to each graph data.

[0155] For details, please refer to Fig. 9 , Fig. 9 yes Figure 7 A detailed flow chart of step S702 in FIG.

[0156] like Fig. 9 As shown, step S702: performing serialization operation on each graph data through the computing engine to obtain the original graph data information corresponding to each graph data, including:

[0157] Step S7021: Determine a plurality of graph data information corresponding to the graph data;

[0158] Specifically, the server processor determines several graph data information corresponding to the graph data through the graph database serialization module in the computing engine, where each type of graph data information corresponds to a data type, such as: i nt type, string type, list type, etc. The graph data information includes one or more of the alias, attributes, and index of the graph data.

[0159] Step S7022: converting the data type corresponding to the graph data information into the first data type;

[0160] Specifically, the processor of the server converts the data type corresponding to the graph data information into a first data type through the graph database serialization module in the computing engine, wherein the data type corresponding to the graph data information is different from the first data type, and the first data type matches the data structure of the graph database storage end.

[0161] For example: convert graph data information of different types (i nt type, string type, list type, etc.) into a byte array (byte[]) structure, and then convert the graph data information of the byte array structure into a data type that matches the data structure of the graph database storage end.

[0162] Step S7023: Determine the graph data information converted into the first data type as the original graph data information.

[0163] Specifically, the processor of the server determines the graph data information converted into the first data type as the original graph data information through the graph database serialization module in the computing engine.

[0164] It can be understood that the existing technical solution adopts: sending graph data to the graph database server through the computing engine, the graph database server converts several different types of graph data information (i nt type, string type, list type, etc.) corresponding to the graph data (points, edges, attributes, etc.) into a byte array (byte[]) structure, and transmits the graph data information of the byte array structure to the graph database storage end, and then the graph database storage end converts the graph data information of the byte array structure into the original graph data information, and adjusts the storage structure of the original graph data information according to the different underlying database types, and then writes the data into the corresponding distributed database cluster.

[0165] However, in this way, although the computing engine can support real-time processing of billions of data without pressure, the bottleneck of the entire graph data import process will appear on the graph database server. This is because the HTTP interface and API interface provided by the graph database server are not efficient and cannot support efficient writing of batch data. In addition, there are a lot of unnecessary verification and serialization and deserialization logic on the graph database server, and the efficiency of single-node graph database server processing is also relatively limited. Therefore, the process of interactive storage of data between the graph database server and the distributed database cluster of the graph database storage end includes multiple network IO and serialization and deserialization logic.

[0166] Therefore, the embodiment of the present application simplifies the serialization logic originally on the graph database server to form a graph database serialization module, embeds it into the computing engine, and cooperates with the efficient distributed computing performance of the computing engine to complete the serialization operation of massive graph data. Among them, the serialization logic includes:

[0167] (1) The graph database server converts graph data information (vertices, edges, attributes, etc.) of several different types (int type, string type, list type, etc.) corresponding to the graph data into a byte array (byte[]) structure, and then transmits it to the graph database storage end.

[0168] (2) The graph database storage end converts the graph data information in the byte array structure back into the original graph data information.

[0169] (3) The graph database storage side adjusts the storage structure of the original graph data information according to the different underlying database types.

[0170] In an embodiment of the present application, the above steps (1) and (2) are simplified. The graph database serialization module of the computing engine can directly convert several different types of graph data information into a data structure suitable for the graph database storage end, and then can directly connect to the distributed database cluster of the graph database storage end to write the data into the cluster in batches.

[0171] In an embodiment of the present application, by adding a graph database serialization module in the computing engine, the graph database serialization module performs serialization operations on the graph data. The present application can skip the graph database server and directly store the data in the graph database storage end, thereby reducing the performance consumption of the graph database server.

[0172] In an embodiment of the present application, after the graph data in the message queue is acquired in batches by the computing engine, the method further includes:

[0173] Update the first graph data information stored in the graph database server.

[0174] For details, please refer to Fig.10 , Fig.10 This is a schematic diagram of a process for updating first graph data information stored in a graph database server provided by an embodiment of the present application;

[0175] like Fig.10 As shown, the process of updating the first graph data information stored in the graph database server includes:

[0176] Step S101: Performing a pattern check on each graph data through a computing engine to obtain a pattern check result;

[0177] Specifically, the computing engine further includes a mode management module, which is used to perform mode verification on the graph data to obtain a mode verification result, wherein the mode verification result includes mode changes and mode unchanged. The processor of the server performs mode verification on each graph data through the mode management module in the computing engine to obtain a mode verification result.

[0178] It can be understood that before data is written into the graph database, the graph database predefines a graph schema, namely, first graph data information. The first graph data information is stored in the graph database server. The first graph data information includes one or more of an alias, an attribute, and an index, wherein the alias includes a point alias or an edge alias.

[0179] It is understandable that in the existing technical solutions, the downstream graph database cannot perceive the changes in the upstream data structure in time. In the case of schema mismatch, it can only throw an exception that the data writing fails. It cannot be applied to the scenarios where the number of attributes needs to be determined or the attributes need to be changed frequently, which affects the integrity of the graph data. For example, if the upstream business system needs to add an ID attribute field, the schema of the graph database needs to be updated synchronously, otherwise an error will be reported when the data is written because the ID attribute field cannot be found. For example, if a label that is not defined in the graph database is passed into the point data, an exception will occur when writing to the graph database and the data writing will fail.

[0180] Therefore, in order to realize dynamic schema changes, the embodiment of the present application adds a schema management module to the computing engine. The schema management module is used to perform schema verification on the graph data to obtain schema verification results, thereby dynamically updating the data structure of the downstream graph database according to changes in the upstream data structure, thereby improving the flexibility and efficiency of graph data import.

[0181] See also Fig.11 , Fig.11 yes Fig.10 A detailed flow chart of step S101 in FIG.

[0182] like Fig.11 As shown, step S101: performing pattern verification on each graph data through a computing engine to obtain a pattern verification result, including:

[0183] Step S1011: obtaining first graph data information stored in the graph database server through a computing engine, and storing the first graph data information in a mode management module;

[0184] Specifically, the mode management module is also used to store the first graph data information.

[0185] Step S1012: determining whether the graph data information corresponding to the graph data is the same as the first graph data information;

[0186] Specifically, the processor of the server determines through a computing engine whether the graph data information corresponding to the graph data obtained from the message queue is the same as the first graph data information.

[0187] Further, if the graph data information corresponding to the graph data is the same as the first graph data information, then enter step S1013: determine that the mode verification result is unchanged; if the graph data information corresponding to the graph data is different from the first graph data information, then enter step S1014: determine that the mode verification result is changed.

[0188] Step S1013: Determine that the mode verification result is that the mode is unchanged;

[0189] Specifically, if the graph data information corresponding to the graph data obtained from the message queue is the same as the first graph data information, then the mode verification result is determined to be that the mode is unchanged.

[0190] Step S1014: Determine whether the mode verification result is a mode change.

[0191] Specifically, if the graph data information corresponding to the graph data obtained from the message queue is different from the first graph data information, it is determined that the mode verification result is a mode change.

[0192] It is understandable that each graph data obtained from the message queue needs to be schema-checked when written to the computing engine to determine whether the field name and type in the graph data information are consistent. If there is graph data with added attribute fields in the message queue, that is, a schema change occurs during the comparison process, the schema check result is a schema change.

[0193] Step S102: determining whether the mode verification result is a mode change;

[0194] Specifically, if the pattern verification result is a pattern change, then proceed to step S103: send an update request to the graph database server through the computing engine to update the first graph data information stored in the graph database server; if the pattern verification result is that the pattern remains unchanged, then proceed to step S104: perform serialization operations on each graph data through the computing engine to obtain the original graph data information corresponding to each graph data.

[0195] Step S103: sending an update request to the graph database server through the computing engine to update the first graph data information stored in the graph database server;

[0196] Specifically, if the mode verification result is a mode change, the message queue is blocked by the computing engine, and an update request is sent to the graph database server to update the first graph data information stored in the graph database server.

[0197] Step S104: Perform serialization operations on each graph data through the computing engine to obtain the original graph data information corresponding to each graph data.

[0198] Specifically, if the pattern verification result is that the pattern remains unchanged, it indicates that the upstream data structure has not changed, and there is no need to dynamically update the data structure of the downstream graph database, so the method of importing the graph data into the graph database storage end is continued.

[0199] In an embodiment of the present application, when the pattern verification result is a pattern change, an update request is sent to the graph database server through the computing engine to update the first graph data information stored in the graph database server. The present application can dynamically identify upstream graph data schema changes and act on the downstream graph database, thereby improving the flexibility of graph data access. At the same time, it ensures that the graph data information in the computing engine is synchronized with the first graph data information on the graph database server in real time to avoid data loss.

[0200] In the embodiment of the present application, if the mode check result is a mode change, the method further includes:

[0201] Roll back the graph data corresponding to the graph data information.

[0202] See also Fig.12 , Fig.12It is a schematic diagram of a process of rolling back graph data corresponding to graph data information provided by an embodiment of the present application;

[0203] like Fig.12 As shown, the process of rolling back the graph data corresponding to the graph data information includes:

[0204] Step S1201: record the update log and issue an alarm prompt to perform change verification and obtain the change verification result;

[0205] Specifically, if the schema verification result is a schema change, the server processor blocks the message queue and interacts with the graph database server to complete the schema update, while recording the update log and issuing an alarm to the project leader, so that relevant staff can conduct manual verification and review based on the actual business scenario to determine whether the change is reasonable. If the change is unreasonable, the change verification result is the first verification result; if the change is reasonable, the change verification result is the second verification result.

[0206] Step S1202: if the change verification result is the first verification result, a rollback operation is performed on the graph data corresponding to the graph data information;

[0207] Specifically, if the first verification result is that the change is unreasonable, the rollback operation refers to deleting the erroneously written data and returning to the state before writing. If the change verification result is that the change is unreasonable, the graph data corresponding to the changed graph data information is deleted through the computing engine and returned to the state before writing.

[0208] Step S1203: If the verification result is changed to the second verification result, the first graph data information stored in the graph database server is updated.

[0209] Specifically, if the second verification result shows that the change is reasonable, the first graph data information stored in the graph database server is updated to ensure that the graph data information in the computing engine is consistent with the first graph data information in the graph database server.

[0210] In an embodiment of the present application, after determining that the mode verification result is a mode change, a change verification is performed, and when the change is unreasonable, the graph data corresponding to the graph data information is rolled back. The present application can clear the written abnormal data and avoid the problem of graph data abnormality caused by graph data information abnormality.

[0211] Step S703: Batch import the original graph data information into the graph database storage end.

[0212] Specifically, the server processor imports the original graph data information in batches into the graph database storage end through the computing engine.

[0213] It is understandable that in the existing technical solutions, due to the large amount of data, the batch entry of data into the computing engine may cause timing disorder problems. Although the computing engine has its own watermark feature, which can alleviate the timing problem to a certain extent, after the time exceeds the watermark, the computing engine can no longer guarantee the accuracy of the data time sequence.

[0214] For example: if the edge data arrives at the computing engine earlier than the corresponding point data, the point data corresponding to the edge data cannot be found when the data is stored in the graph database, such as: {"l abe l":"li ke","source_vertex":"s imon","target_vertex":"t itani c","update_time":"2022-10-10 00:00:00","operate":"update"}, this is an edge data, the source node (source_vertex) corresponding to the edge data is s imon, and the target node (target_vertex) is t itani c. The edge data is used to connect these two nodes. If the edge data arrives at the computing engine, its corresponding point data s imon and point data t itani c have not arrived at the computing engine, then the two corresponding point data cannot be found when the edge data is stored in the graph database.

[0215] Alternatively, for multiple data with the operation type (operation) being update, their timing is disordered when they arrive at the computing engine, which may cause the latest graph data to be overwritten by the old graph data.

[0216] Alternatively, the data with the operation type of delete arrives at the computing engine earlier than the data with the operation type of create, which will cause the data deletion to fail.

[0217] Therefore, in order to solve these timing problems, in an embodiment of the present application, each operation performed on the attributes of the original graph data information is recorded in the form of a version and the version time is recorded. Deletion and update operations no longer directly act on the source data, but are replaced by insertion, and the latest version of the attributes is returned when queried.

[0218] For details, please refer to Fig.13 , Fig.13 yes Figure 7 A detailed flow chart of step S703 in FIG.

[0219] In an embodiment of the present application, the original graph data information includes attributes, and the attributes include one or more of name, operation and update time. The update time includes version time, for example: first version time, second version time and other version times.

[0220] like Fig.13 As shown, step S703: batch importing the original graph data information into the graph database storage end includes:

[0221] Step S7031: If the graph database storage end receives the original graph data information corresponding to the edge data, but does not receive the original graph data information of the source node and / or the target node corresponding to the edge data, the computing engine creates the first version of the original graph data information corresponding to the source node and the target node respectively and records the first version time;

[0222] For example: the original graph data information corresponding to the edge data is {"l abe l":"li ke","source_vertex":"s imon","target_vertex":"t ita n ic","update_time":"2022-10-10 00:00:00","operate":"update"}, where the source node (source_vertex) corresponding to the edge data is simon, and the target node (target_vertex) is t itanic, and the edge data is used to connect these two nodes.

[0223] If the graph database storage end receives the original graph data information corresponding to the edge data, but has not received the original graph data information of the source node Simon and / or the target node Titanic corresponding to the edge data, then the computing engine creates the first version of the original graph data information corresponding to the source node Simon and / or the first version of the original graph data information corresponding to the target node Titanic and records the first version time.

[0224] Step S7032: After receiving the original graph data information corresponding to the source node and / or the target node respectively at the graph database storage end, the original graph data information corresponding to the source node and / or the target node respectively is stored as the second version of the original graph data information to the graph database storage end through the computing engine and the second version time is recorded.

[0225] For example: Continuing with the above example, after creating the first version of the original graph data information corresponding to the target node t itanic and recording the first version time, the graph database storage end receives the original graph data information corresponding to the target node t itanic, and then stores the original graph data information corresponding to the target node t itanic as the second version of the original graph data information to the graph database storage end and records the second version time, wherein the first version time is earlier than the second version time.

[0226] Alternatively, after creating the first version of the original graph data information corresponding to the source node Simon and recording the first version time, the graph database storage end receives the original graph data information corresponding to the source node Simon, and then stores the original graph data information corresponding to the source node Simon as the second version of the original graph data information to the graph database storage end and records the second version time.

[0227] See also Fig.14 , Fig.14 yes Figure 7 Another detailed flow chart of step S703 in FIG.

[0228] like Fig.14 As shown, step S703: batch importing the original graph data information into the graph database storage end also includes:

[0229] Step S7033: if the data stored in the graph database storage end is updated, the latest original graph data information corresponding to the data is inserted into the graph database storage end through the computing engine, and each version of the data obtained after each update and the update time of the attribute are saved;

[0230] Specifically, database operations can be divided into: query, delete, insert, and update. In the embodiment of the present application, in order to retain data operated at different times, the update operation is not used, and the insert operation is used instead of the update operation. The data of each version obtained after each update and the update time of the attribute are saved, and the update time of the attribute is used to distinguish whether it is the latest data.

[0231] Step S7034: If a deletion operation is performed on the data stored in the graph database storage end, the deletion data information corresponding to the data is inserted into the graph database storage end through the computing engine.

[0232] Specifically, an insert operation is used instead of a delete operation, and the deleted data information includes a delete mark attribute and a delete time. For example: if you need to delete a piece of data with name=simon, insert the following data: {"name":"simon","i s_de l ete":"true","update_time":"2023-01-01 00:00:00"}, where "i s_de l ete":"true" is the delete mark attribute, and "update_time":"2023-01-01 00:00:00" is the delete time. In an embodiment of the present application, after the original graph data information is imported into the graph database storage end in batches, the method further includes:

[0233] Query the graph database storage end.

[0234] See also Fig.15 , Fig.15 It is a schematic diagram of a process of querying a graph database storage end provided in an embodiment of the present application;

[0235] like Fig.15 As shown in the figure, the process of querying the graph database storage end includes:

[0236] Step S1501: query the graph database storage end, and return the latest version of the data corresponding to the attribute according to the update time of the attribute;

[0237] It can be understood that when each operation on the attributes of the original graph data information is recorded in the form of a version, the version time, that is, the update time of the attribute, is recorded. The creation time of the new version is later than the creation time of the old version. Therefore, when querying the graph database storage end, the latest version of the data corresponding to the returned attribute is the most recently written data.

[0238] Step S1502: and / or, query the graph database storage end to determine whether the deletion operation is completed based on the deletion mark attribute of the latest version of the data.

[0239] It is understandable that the update time of the latest version of the data is later than the deletion time corresponding to the deletion operation. When querying the graph database storage end, all versions with time (i.e., update time) earlier than the deletion time corresponding to the deletion operation are filtered out. Regardless of whether the actual arrival time of the data is later than the deletion time, it is only necessary to determine whether the deletion operation is completed based on the deletion mark attribute of the latest version of the data.

[0240] See also Fig.16 , Fig.16 yes Fig.15 A detailed flow chart of step S1502 in FIG.

[0241] like Fig.16 As shown, step S1502: and / or, querying the graph database storage end, and determining whether the deletion operation is completed according to the deletion mark attribute of the latest version of the data, including:

[0242] Step S1521: Obtain the deletion mark attribute of the latest version of data;

[0243] Specifically, the deletion mark attribute is, for example: “i s_delete”: “true” or “i s_delete”: “false”.

[0244] Step S1522: Determine whether the delete mark attribute is true;

[0245] Specifically, the deletion mark attribute is "i s_delete": "true" indicates that the deletion mark attribute is true (true); the deletion mark attribute is "i s_delete": "false" indicates that the deletion mark attribute is false (false).

[0246] Further, if the delete mark attribute is true, then proceed to step S1523: determine that the delete operation is not completed; if the delete mark attribute is false, then proceed to step S1524: determine that the delete operation is completed.

[0247] Step S1523: Determine that the deletion operation is not completed;

[0248] Specifically, if the deletion mark attribute of the latest version of the data is "is_delete": "true", it is determined that the deletion operation is not completed.

[0249] Step S1524: Determine that the deletion operation is completed.

[0250] Specifically, if the deletion mark attribute of the latest version of the data is "is_delete": "false", it is determined that the deletion operation is completed.

[0251] For example: when it is necessary to delete a piece of data with name=Simon, the following data is inserted: {"name":"simon","is_delete":"true","update_time":"2023-01-0100:00:00"}. When querying the graph database storage end, if the deletion mark attribute of the latest version of the data is "is_delete":"false", it means that the deleted data with name=Simon is filtered out, and the deletion operation is completed.

[0252] In an embodiment of the present application, each operation performed on the attributes of the original graph data information is recorded in the form of a version and the version time is recorded. The deletion and update operations no longer directly act on the source data, but are replaced by insertion, and the latest version of the attributes is returned when queried. This application can solve the problem of global timing disorder and ensure the accuracy of the graph data in the scenario where massive graph data is accessed to the graph database in real time.

[0253] In an embodiment of the present application, a graph data import method is provided, including: obtaining multiple graph data; performing serialization operations on each graph data through a computing engine to obtain the original graph data information corresponding to each graph data; and batch importing the original graph data information into the graph database storage end. The graph data is serialized by a computing engine, and then the serialized graph data is directly batch imported into the graph database storage end. The present application can skip the graph database service end and store the graph data into the graph database storage end, thereby improving the efficiency of importing graph data into the graph database and realizing real-time and efficient import of massive graph data into the graph database.

[0254] Embodiment 2

[0255] The present application also provides a computer-readable storage medium, which stores computer-executable instructions for enabling an electronic device to execute the method for importing graph data provided in the above embodiment, for example, Figure 7 The graph data import method shown.

[0256] In the embodiment of the present application, the storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EE PROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be various devices including one or any combination of the above memories.

[0257] In an embodiment of the present application, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as an independent program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0258] As an example, executable instructions may, but need not necessarily, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0259] As an example, executable instructions may be deployed to be executed on one computing device (including devices such as smart terminals and servers), or on multiple computing devices located in one location, or on multiple computing devices distributed in multiple locations and interconnected by a communication network.

[0260] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by an electronic device, the electronic device executes the graph data importing method in the above embodiment.

[0261] The present application also provides a computer program product, which includes one or more program codes stored in a computer-readable storage medium. The processor of the electronic device reads the program code from the computer-readable storage medium, and the processor executes the program code to complete the method steps of the graph data import method provided in the above embodiment.

[0262] A person skilled in the art will appreciate that all or part of the steps for implementing the above embodiments may be accomplished by hardware or by hardware associated with a program code, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0263] Through the description of the above implementation methods, ordinary technicians in this field can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, it can also be implemented by hardware. Ordinary technicians in this field can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0264] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Under the concept of the present application, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other changes in different aspects of the present application as above, which are not provided in detail for the sake of simplicity. Although the present application has been described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some of the technical features can be replaced by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for importing graph data, characterized in that: The method comprises: Get multiple graph data; Performing a serialization operation on each of the graph data through a computing engine to obtain original graph data information corresponding to each of the graph data; Import the original graph data information in batches into the graph database storage end.

2. The method according to claim 1, characterized in that The obtaining of multiple graph data includes: Collecting the plurality of graph data from the business system into a message queue, wherein the message queue is decoupled from the business system; The graph data in the message queue is acquired in batches through the computing engine.

3. The method according to claim 2, characterized in that The computing engine includes a graph database serialization module, and the graph database serialization module is used to perform serialization operations on graph data; The serialization operation is performed on each of the graph data by the computing engine to obtain the original graph data information corresponding to each of the graph data, including: Determine a plurality of graph data information corresponding to the graph data, wherein each type of graph data information corresponds to a data type, and the graph data information includes one or more of an alias, an attribute, and an index of the graph data; Converting a data type corresponding to the graph data information into a first data type, wherein the data type corresponding to the graph data information is different from the first data type, and the first data type matches a data structure of the graph database storage end; The graph data information converted into the first data type is determined as the original graph data information.

4. The method according to claim 2 or 3, characterized in that: After the graph data in the message queue is acquired in batches by the computing engine, the method further includes: Performing a pattern check on each of the graph data by the computing engine to obtain a pattern check result; If the mode verification result is a mode change, an update request is sent to the graph database server through the computing engine to update the first graph data information stored in the graph database server.

5. The method according to claim 4, characterized in that The computing engine further includes a mode management module, and the mode management module is used to perform mode verification on the graph data; The performing pattern verification on the graph data by the computing engine to obtain a pattern verification result includes: Acquire the first graph data information stored in the graph database server through the computing engine, and store the first graph data information in the mode management module; If the graph data information corresponding to the graph data is different from the first graph data information, it is determined that the mode verification result is a mode change.

6. The method according to claim 4, characterized in that If the mode check result is a mode change, the method further includes: Record the update log and issue an alarm prompt to perform change verification and obtain the change verification result; If the change verification result is the first verification result, a rollback operation is performed on the graph data corresponding to the graph data information; If the change verification result is the second verification result, the first graph data information stored in the graph database server is updated.

7. The method according to any one of claims 1-3, 5-6, characterized in that The graph data includes point data and edge data, and the batch importing of the original graph data information into the graph database storage terminal includes: If the graph database storage end receives the original graph data information corresponding to the edge data, but does not receive the original graph data information of the source node and / or the target node corresponding to the edge data, the computing engine creates the first version of the original graph data information corresponding to the source node and the target node respectively and records the first version time; After the graph database storage end receives the original graph data information corresponding to the source node and / or the target node respectively, the computing engine stores the original graph data information corresponding to the source node and / or the target node respectively as the second version of the original graph data information to the graph database storage end and records the second version time, wherein the first version time is earlier than the second version time.

8. The method according to claim 7, characterized in that The original graph data information includes attributes, and the batch importing of the original graph data information into the graph database storage end further includes: If an update operation is performed on the data stored in the graph database storage end, the latest original graph data information corresponding to the data is inserted into the graph database storage end through the computing engine, and each version of the data obtained after each update and the update time of the attribute are saved; If a deletion operation is performed on the data stored in the graph database storage end, the deletion data information corresponding to the data is inserted into the graph database storage end through the computing engine, wherein the deletion data information includes a deletion mark attribute and a deletion time.

9. The method according to claim 8, characterized in that After the original graph data information is imported into the graph database storage end in batches, the method further includes: Query the graph database storage end, and return the latest version of data corresponding to the attribute according to the update time of the attribute; And / or, querying the graph database storage end to determine whether the deletion operation is completed based on the deletion mark attribute of the latest version of the data, wherein the update time of the latest version of the data is later than the deletion time corresponding to the deletion operation; If the delete mark attribute is false, determining that the delete operation is completed; If the delete mark attribute is true, it is determined that the delete operation is not completed.

10. An electronic device, characterized in that: include: at least one processor, and a memory communicatively coupled to the at least one processor, wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the graph data importing method described in any one of claims 1-9.

11. A graph data import system, characterized in that: Applying the method described in any one of claims 1 to 9, the graph data importing system comprises: Business system, used to generate graph data; Message queue, used to receive graph data from the business system; A computing engine, used to obtain graph data in a message queue and import the graph data into a graph database; A graph database is used to store the graph data.

12. The system according to claim 11, characterized in that The computing engine includes a graph database serialization module and a mode management module. The graph database serialization module is used to perform serialization operations on graph data, and the mode management module is used to perform mode verification on graph data.

13. The system according to claim 11 or 12, characterized in that The graph database includes a graph database storage end and a graph database server end. The graph database storage end is used to store original graph data information, and the graph database server end is used to store first graph data information.

Citation Information

Patent Citations

  • Method for quickly loading Janusgraph data in batches

    CN114138735A

  • System and method for querying a graph model

    US20190121810A1

  • Handling out-of-order data during stream processing and persisting it in a temporal graph database

    US20220067099A1

Cited By

  • Method and device for realizing concurrent import of graph database data based on dependency tree

    CN118820535A

  • Entity topological graph storage method and device, equipment and storage medium

    CN119759856A

  • Automatic migration method and system for graph database metadata

    CN121350314A