Graph database system and query method therefor
Patent Information
- Application Number
- PCT/CN2024/139965
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-04-29
- Filing Date
- 2024-12-17
- Publication Date
- 2025-10-02
AI Technical Summary
Existing graph databases have information missing problems, which affects query accuracy and makes it impossible to return all the query results expected by users.
A graph database system is provided, which includes an interaction module and a processing module. It can automatically complete the missing information of the graph data, obtain the missing information through the prediction module using a pre-trained machine learning model, generate complete graph data and feed it back to the user.
It improves the accuracy of query results, enhances users' trust in graph databases and ease of use, reduces query overhead, and simplifies user operations.
Abstract
Description
Graph database system and query method thereof
[0001] This application claims priority to Chinese patent application No. 202410263169.X, filed on March 7, 2024, entitled “A graph data query method, device and computing device cluster”, and Chinese patent application No. 202410532715.5, filed on April 29, 2024, entitled “Graph database system and query method thereof”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of database technology, and in particular to a graph database system and a query method thereof. Background Art
[0003] With the advent of the big data era, objects, people, and knowledge are becoming increasingly interconnected. By representing people, objects, and knowledge as nodes in a graph, and their relationships as edges, a wide variety of data can be represented using graphs. For example, social networks between people, machine-to-machine communication networks, and knowledge graphs can all be represented using graphs. Graph databases, specialized databases developed specifically for storing, managing, and querying graph-related data, are therefore attracting increasing attention.
[0004] Currently, most graphs suffer from missing information. For example, graphs may lack information about some points, edges, or even edges. Consequently, when users perform graph-based queries in databases, they typically perform queries directly on existing graphs in the database.
[0005] In this way, when the queried graph is missing information, the accuracy of the query on the graph database will be affected. Summary of the Invention
[0006] This application provides a graph database system and a query method thereof. This application helps improve the accuracy of query results in the graph database system. The technical solutions provided by this application are as follows:
[0007] In a first aspect, the present application provides a graph database system. The graph database system includes: an interaction module for receiving a data query request sent by a first user, the data query request instructing to query a specified event in the graph database system; a processing module for obtaining, based on the data query request, first graph data related to the specified event, the first graph data being graph data obtained by supplementing missing information with second graph data, the second graph data being retrieved from graph data stored in the graph database system based on the data query request, the graph data being used to indicate multiple entities and relationships between different entities; and the interaction module for providing feedback to the first user on a response to the data query request based on the first graph data, the response carrying data that matches the specified event.
[0008] Because responses to data query requests are based on graph data with missing information completed, this avoids the inability to obtain all query results due to missing information in the graph data, helping to improve the accuracy of query results. Furthermore, the graph database system of the present application automatically completes missing information in the graph data without the user noticing it, thereby increasing user trust in the graph database and helping to improve its usability and user stickiness.
[0009] In one possible implementation, the response also includes the probability that the data matches a specified event. This allows the graph database system to provide the first user with more detailed query results and more reference information, helping the first user make more appropriate decisions based on the probability indicating the degree to which the entity matches the specified event.
[0010] In one possible implementation, the processing module is used to obtain second graph data related to a specified event and target information missing from the second graph data based on a data query request, obtain the value of the target information based on the association between the second graph data, the target information and the specified event, and add the value of the target information to the second graph data to obtain the first graph data; wherein the target information is used to indicate one or more of the following: an entity identifier, attribute information of an entity, a relationship between different entities, or attribute information of a relationship.
[0011] In one possible implementation, the graph database system also includes: a storage module and a prediction module, the storage module is used to store graph data; the processing module is used to obtain second graph data related to a specified event from the storage module based on a data query request, determine the target information missing from the second graph data, and provide the second graph data and target information to the prediction module; the prediction module is used to predict the value of the target information based on the second graph data and the target information, and add the value of the target information to the second graph data to obtain the first graph data, and provide the first graph data to the processing module; the processing module is used to obtain a response to the data query request based on the first graph data.
[0012] Because the prediction module is built into the graph database system, it can be deeply integrated with the existing functions of the existing graph database system. This allows users to seamlessly query the prediction module while using the graph database system, achieving seamless access to the graph database system with prediction capabilities, thereby improving the user experience. Furthermore, compared to technologies where graph database systems can only use prediction functions through external calls, this prediction function eliminates the need for repeated data migration between the graph database system and the external prediction module, reducing the query overhead of the graph database system and lowering the barrier to entry for using the graph database system, further improving the usability of the graph database system.
[0013] In one possible implementation, the prediction module is implemented based on a pre-trained machine learning model.
[0014] In one possible implementation, the prediction module is used to obtain first calculation data pre-calculated by a pre-trained machine learning model, and predict the value of the target information based on the first calculation data, the second graph data, and the target information. When the first graph data is obtained based on the pre-calculated first calculation data, the calculation process for obtaining the first calculation data based on the second graph data is no longer required during the process of obtaining the first graph data, thereby reducing the amount of calculation required during the process of obtaining the first graph data, accelerating the process of obtaining the first graph data, and further accelerating the query process of the graph database system 60. Moreover, because the machine learning model is pre-trained, the relationship reflected by the first calculation data is likely to satisfy the relationship between various data in the second graph data and the target information. Therefore, even if the first calculation data is not calculated based on the second graph data and the target information, the impact of the first calculation data on the accuracy of the obtained first graph data can be controlled within an acceptable range, thereby ensuring the accuracy of the obtained first graph data.
[0015] In one possible implementation, the machine learning model includes a deep learning model, and the first computational data is the computational result of an embedding layer of the pre-trained deep learning model based on the graph data used for training. The first computational data is stored in the storage module as attribute information of the graph data used for training. This allows the first computational data based on the graph data to be directly obtained when the graph data is acquired.
[0016] In one possible implementation, the interaction module is further configured to receive configuration information set by the second user for the second graph data, the configuration information indicating information that the second graph data needs to include; and the processing module is configured to determine target information missing from the second graph data based on the configuration information. This enables customized completion of the second graph data.
[0017] In one possible implementation, the configuration information is used to indicate the type of information that needs to be recorded in the second graph data, where the type indicates one or more of the following: entity identification, entity attribute information, relationships between different entities, or relationship attribute information.
[0018] In the second aspect, the present application provides a query method for a graph database system. The query method for a graph database system is applied to a graph database system. The graph database method includes: receiving a data query request sent by a first user, the data query request indicates querying a specified event in the graph database system; based on the data query request, obtaining first graph data related to the specified event, the first graph data is the graph data after the second graph data completes the missing information, the second graph data is found in the graph data stored in the graph database system based on the data query request, and the graph data is used to indicate multiple entities and the relationship between different entities; based on the first graph data, a response to the data query request is fed back to the first user, and the response carries data that meets the specified event.
[0019] In one possible implementation, the response also carries the probability that the data corresponds to a specified event.
[0020] In one possible implementation, based on a data query request, first graph data related to a specified event is obtained, including: based on the data query request, second graph data related to the specified event and target information missing from the second graph data are obtained; based on the association between the second graph data, the target information and the specified event, the value of the target information is obtained, and the value of the target information is added to the second graph data to obtain the first graph data; wherein the target information is used to indicate one or more of the following: an entity identifier, attribute information of an entity, a relationship between different entities, or attribute information of a relationship.
[0021] In one possible implementation, based on the association between the second graph data, the target information and the specified event, the value of the target information is obtained, including: based on the second graph data and the target information, using a pre-trained machine learning model to predict the value of the target information.
[0022] In one possible implementation, based on the second graph data and the target information, a pre-trained machine learning model is used to predict the value of the target information, including: obtaining first calculation data pre-calculated by the pre-trained machine learning model, and using the pre-trained machine learning model to predict the value of the target information based on the first calculation data, the second graph data and the target information.
[0023] In one possible implementation, the machine learning model includes a deep learning model, the first computing data is a calculation result of an embedding layer of a pre-trained deep learning model based on graph data used in training, and the first computing data is stored as attribute information of the graph data used in training.
[0024] In one possible implementation, the query method of the graph database system further includes receiving configuration information configured by a second user for the second graph data, the configuration information being used to indicate information to be recorded in the second graph data. Accordingly, obtaining target information missing from the second graph data includes determining the target information missing from the second graph data based on the configuration information.
[0025] In one possible implementation, the configuration information is used to indicate the type of information that needs to be recorded in the second graph data, where the type indicates one or more of the following: entity identification, entity attribute information, relationships between different entities, or relationship attribute information.
[0026] In a third aspect, the present application provides a computing device comprising a memory and a processor, wherein the memory stores program instructions, and the processor executes the program instructions to implement the graph database system provided in the first aspect of the present application and any possible implementation thereof.
[0027] In a fourth aspect, the present application provides a computing device cluster, comprising multiple computing devices, wherein the multiple computing devices include multiple processors and multiple memories, wherein program instructions are stored in the multiple memories, and the multiple processors execute the program instructions, so that the computing device cluster implements the graph database system provided in the first aspect of the present application and any possible implementation thereof.
[0028] In the fifth aspect, the present application provides a computer-readable storage medium, which is a non-volatile computer-readable storage medium. The computer-readable storage medium includes program instructions. When the program instructions are executed on a computing device, the computing device implements the graph database system provided in the first aspect of the present application and any possible implementation thereof.
[0029] In a sixth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to implement the graph database system provided in the first aspect of the present application and any possible implementation thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG1 is a schematic diagram of graph data provided by an embodiment of the present application;
[0031] FIG2 is a schematic diagram of another type of graph data provided in an embodiment of the present application;
[0032] FIG3 is a structural diagram of an implementation scenario involving a graph database system and a query method thereof provided in an embodiment of the present application;
[0033] FIG4 is a structural diagram of another graph database system and its query method according to an embodiment of the present application;
[0034] FIG5 is a schematic diagram of a basic resource deployment method in a data center provided by an embodiment of the present application;
[0035] FIG6 is a schematic diagram of the structure of a graph database system provided in an embodiment of the present application;
[0036] FIG7 is a schematic diagram of the structure of another graph database system provided in an embodiment of the present application;
[0037] FIG8 is a schematic diagram of the structure of another graph database system provided in an embodiment of the present application;
[0038] FIG9 is a schematic diagram of the structure of another graph database system provided in an embodiment of the present application;
[0039] FIG10 is a schematic diagram of a data query process provided by an embodiment of the present application;
[0040] FIG11 is a schematic diagram of a query plan tree provided in an embodiment of the present application;
[0041] FIG12 is a schematic diagram of a training process provided in an embodiment of the present application;
[0042] FIG13 is a schematic diagram of a query plan tree for training provided in an embodiment of the present application;
[0043] FIG14 is a flowchart of a query method for a graph database system provided in an embodiment of the present application;
[0044] FIG15 is a flowchart of another query method for a graph database system provided in an embodiment of the present application;
[0045] FIG16 is a schematic diagram of the structure of a computing device provided in an embodiment of the present application;
[0046] FIG17 is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0047] FIG18 is a schematic diagram of the structure of another computing device cluster provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to make the objectives, technical solutions and advantages of this application clearer, the implementation methods of this application will be further described in detail below with reference to the accompanying drawings.
[0049] With the advent of the big data era, the connections between objects, people, and knowledge are becoming increasingly close. By representing information such as people, objects, and knowledge as nodes in a graph and the relationships between them as edges, a wide variety of data can be represented using graphs. For example, social networks between people, communication networks between machines, and knowledge graphs can all be represented using graphs. Data represented using graphs is called graph data. Currently, graph databases, specialized databases developed specifically for storing, managing, and querying graph-related data, are attracting increasing attention.
[0050] A graph is a data structure that abstractly represents entities and relationships between them in information as vertices and relationships between vertices. A graph consists of at least two vertices and at least one edge. Vertices represent entities. Entities are objectively existing and distinguishable things. In some cases, vertices are also called points, nodes, or endpoints. Edges between vertices represent relationships between entities. When the entities represented by two vertices have an association relationship, the two vertices are connected by an edge. When the entities represented by two vertices do not have an association relationship, the two vertices are not connected. In one implementation, an entity is associated with another entity in one or more of the following situations: one entity actively associates with another entity, or the other entity actively associates with another entity. Both vertices and edges carry information. Vertex information can include the name (also known as an identifier or label) of the entity represented by the vertex and its property information. Edge information can include property information indicating the relationship between the two entities represented by the two vertices connected by the edge. Optionally, the graph can be directed or undirected. When a graph is a directed graph, the edge from one vertex to another vertex is called the out-edge of the vertex, and correspondingly, the edge is called the in-edge of the other vertex.
[0051] In different application scenarios, the vertices and edges in a graph have different practical meanings. For example, in a friend recommendation scenario, each vertex in the graph can represent a user. The vertex identifier indicates the user's identity, such as name. The vertex attribute information indicates the corresponding user's characteristics, such as the user's age, occupation, or hobbies. The edges in the graph represent the social relationship between the two users represented by the vertices connected by the edge, such as the degree of familiarity between the two users. For another example, in a product recommendation scenario, some vertices in the graph represent users, while some represent products. The identifier of the vertex representing a user in the graph indicates the user's identity, such as name. The attribute information of the vertex indicates the corresponding user's characteristics, such as age, occupation, or product preferences. The identifier of the vertex representing a product in the graph indicates the product's identity, such as product name or number. The attribute information of the vertex indicates the corresponding product's characteristics, such as product category and applicable range. The edges between vertices representing users and vertices representing products represent the interactive relationship between users and products, such as purchase relationships or favorite relationships. For another example, in an employee information statistics scenario, some vertices in the graph represent employees, some represent locations, and some represent companies. The identifier of a vertex representing an employee in a graph indicates the employee's identifier, such as their name. The identifier of a vertex representing a location in a graph indicates the location's identifier, such as its name. The identifier of a vertex representing a company in a graph indicates the company's identifier, such as its name. An edge between a vertex representing an employee and a vertex representing a location indicates that the employee represented by that vertex lives at the location represented by that vertex. An edge between a vertex representing an employee and a vertex representing a company indicates that the employee represented by that vertex belongs to the company represented by that vertex, and an edge between a vertex representing a company and a vertex representing a location indicates that the company represented by that vertex is located at the location represented by that vertex.
[0052] For example, Figure 1 is a schematic diagram of a graph indicating employee information provided by an embodiment of the present application. The graph shown in Figure 1 includes 4 vertices and 5 edges. The 4 vertices indicate employee A, employee B, company C, and location D, respectively. The edge between the vertex representing employee A and the vertex representing location D indicates that employee A lives in location D. The edge between the vertex representing employee B and the vertex representing location D indicates that employee B lives in location D. The edge between the vertex representing employee A and the vertex representing company C indicates that employee A works at company C. The edge between the vertex representing employee B and the vertex representing company C indicates that employee B works at company C. The edge between the vertex representing company C and the vertex representing location D indicates that company C is located at location D. Figure 2 is a schematic diagram of a graph indicating social relationships provided by an embodiment of the present application. The graph shown in Figure 2 includes 5 vertices and 4 edges, and each vertex has an identifier and attribute information. The identifiers of the 5 vertices indicate Xiao Zhang, Xiao Li, Xiao Wang, Xiao N, and Xiao O, respectively. The attribute information for the vertex representing Xiao Zhang indicates that the probability of Xiao Zhang being a potential customer of the specified product and the probability of Xiao Zhang being a high-net-worth customer are unknown, as shown in Figure 2: {buyer:null,rich:null}. The attribute information for the vertex representing Xiao Li indicates that Xiao Li is likely to be a potential customer of the specified product, but the probability of Xiao Li being a high-net-worth customer is unknown, as shown in Figure 2: {buyer:true,rich:null}. The attribute information for the vertex representing Xiao Wang indicates that the probability of Xiao Wang being a potential customer of the specified product and the probability of Xiao Wang being a high-net-worth customer are unknown, as shown in Figure 2: {buyer:null,rich:null}. The attribute information for the vertex representing Xiao O indicates that the probability of Xiao O being a potential customer of the specified product is unknown, but Xiao O is likely to be a high-net-worth customer, as shown in Figure 2: {buyer:null,rich:true}. The attribute information for the vertex representing Xiao N indicates that the probability of Xiao N being a potential customer of the specified product and the probability of Xiao N being a high-net-worth customer are unknown, as shown in Figure 2: {buyer:null,rich:null}. An edge between two vertices represents a social relationship between the people represented by the two vertices, and this social relationship is represented by the edge's attribute information. An edge between the vertex representing Xiao Zhang and the vertex representing Xiao Li indicates that Xiao Zhang and Xiao Li are good friends. An edge between the vertex representing Xiao Li and the vertex representing Xiao O indicates that Xiao Li and Xiao O are good friends. An edge between the vertex representing Xiao Li and the vertex representing Xiao Wang indicates that Xiao Li and Xiao Wang are good friends. An edge between the vertex representing Xiao Wang and the vertex representing Xiao N indicates that Xiao Wang and Xiao N are good friends.
[0053] A graph database is a new type of non-relational database based on graph theory. Its data storage structure and data management methods are both based on graph theory. Specifically, the relationships between data in a graph database are represented by graphs, and all graph database features are implemented using graphs. For example, operations such as create (creat), read (also known as find), update (update), and delete (delete) on a graph, as well as transaction processing capabilities and high availability, are all executed on the graph.
[0054] Currently, the use of graph databases is plagued by the following common problem: most graphs suffer from missing information. Missing information in a graph refers to the lack of identification and property information for some points, missing attribute information for edges, or missing edges between points. For example, in some graph databases, 93.8% of people lack birthplace information, 78.5% lack nationality, and 68% lack any occupation information. In other graph databases, 50% of artists lack birthdates. Consequently, when users perform graph-based queries in databases, they typically perform queries directly on existing graphs in the database. Consequently, when a graph is missing some information, it becomes difficult for the graph database to return all the results the user expects, compromising the accuracy of queries against the graph database. This problem is further exacerbated by the fact that most graphs in reality lack information.
[0055] In the graph data shown in Figure 1, the solid edges in Figure 1 are present in the graph data, while the dashed edges are missing. Suppose a user wants to find people living in location D based on this graph data. The query is:
[0056] Match(p:people)–[:residence]->(c:country{name:locationD})
[0057] Return p.name
[0058] After the user enters the query statement into the graph database, the database outputs the following result based on the graph data: Employee A. However, the person who actually lives in location D also has Employee B. This shows that because the graph data lacks the edge indicated by the dotted line, the graph database cannot output the information that the person who lives in location D also has Employee B. This indicates that the accuracy of queries on the graph database is poor.
[0059] Corresponding to the graph data shown in Figure 2, the attribute information indicated as unknown in Figure 2 is the missing information in the graph data. Assume that the user wants to find possible high-net-worth customers and potential customers who may purchase a specific product based on the graph data, so as to pay attention to possible high-net-worth customers and potential customers in advance. The query statement is:
[0060] Match(f:Person{rich:true})
[0061] Match(v:Person{buyer:true})
[0062] Return f.name,v.name
[0063] When the user enters this query into the graph database, the database outputs the following results based on the graph data: f.name: Xiao O, v.name: Xiao Li. This result indicates that Xiao O is likely a high-net-worth customer and Xiao Li is likely to purchase the specified product. However, Xiao Zhang, Xiao Wang, and Xiao O are also likely to purchase the specified product, and Xiao Li is also likely a high-net-worth customer. This indicates that the graph database is unable to output these query results due to the missing attribute information for the vertices in the graph data, indicating that query accuracy on the graph database is poor.
[0064] In view of this, an embodiment of the present application provides a graph database system and a query method. The graph database system includes: an interaction module and a processing module. The interaction module is used to receive a data query request sent by a first user, and the data query request indicates a query for a specified event in the graph database system. The processing module is used to obtain first graph data related to the specified event based on the data query request. The first graph data is the graph data after the second graph data completes the missing information. The second graph data is found in the graph data stored in the graph database system based on the data query request. The graph data is used to indicate multiple entities and the relationship between different entities. The interaction module is also used to feedback a response to the data query request to the first user based on the first graph data, and the response carries data that meets the specified event.
[0065] It can be seen from this that after receiving the data query request sent by the user, the graph database system of the present application can automatically complete the missing information of the second graph data queried by the data query request to obtain the first graph data, and then feedback the response to the data query request to the user based on the first graph data. Since the response to the data query request is obtained based on the graph data after the missing information is completed, it can avoid the inability to query and obtain all query results due to missing information in the graph data, which helps to improve the accuracy of the query results. In addition, the graph database system of the present application can complete the missing information of the graph data without the user noticing by automatically completing the missing information of the graph data, and will not make the user aware of the missing information of the graph data. It can improve the user's trust in the graph database and help to improve the usability and user stickiness of the graph database.
[0066] This article provides a detailed introduction to the technical solution of this application from multiple perspectives, including implementation scenarios, method flow, hardware devices, and software devices.
[0067] The following first illustrates an implementation scenario of the embodiment of the present application with examples.
[0068] Figure 3 is a structural diagram of an implementation scenario involving a graph database system and its query method provided in an embodiment of the present application. As shown in Figure 3, the implementation scenario includes: one or more computing devices 10 and a client 20. The one or more computing devices 10 are used to implement the graph database provided in an embodiment of the present application. The client 20 is capable of establishing a communication connection with one or more computing devices 10. For example, a communication connection can be established between the client 20 and one or more computing devices 10 through a network. Optionally, the network can be a local area network, the Internet, or other networks, which is not limited in the embodiment of the present application.
[0069] The client 20 is used for users to interact with one or more computing devices 20. In one implementation, the client 20 is used to send a data query instruction to the computing device 10 according to the user's instructions. The one or more computing devices 20 are used to query the graph database based on the data query instruction and feedback the query results to the client 20.
[0070] In one possible implementation, the client 20 can be a desktop computer, a laptop computer, a mobile phone, a smart phone, a tablet computer, a multimedia player, a smart home appliance, an artificial intelligence device, a smart wearable device, an e-reader, a smart car device or an Internet of Things device, etc. The computing device 10 can be a server (such as a cloud server). When the implementation scenario includes multiple computing devices 10, the multiple computing devices 10 can be referred to as a computing device cluster. At this time, the computing device cluster is a server cluster composed of several servers, or is implemented by a cloud computing service center. Among them, a large number of basic resources owned by the cloud service provider are deployed in the cloud computing service center. For example, computing resources, storage resources, and network resources are deployed in the cloud computing service center. The cloud computing service center can use this large amount of basic resources to implement the graph database provided in the embodiment of the present application.
[0071] When a computing device cluster is implemented through a cloud computing service center, the functions of the graph database implemented by the computing device cluster can be abstracted by the cloud service provider into a graph database cloud service on the cloud platform. At this time, the user can access the cloud management platform through the client 20, and after purchasing the graph database cloud service on the cloud management platform, use the graph database cloud service provided by the computing device cluster through the cloud management platform. Optionally, the cloud management platform can be a cloud management platform for the central cloud, a cloud management platform for the edge cloud, or a cloud management platform including the central cloud and the edge cloud, which is not specifically limited in the embodiments of the present application. In addition, the graph database cloud service can be optionally provided by the cloud management platform as a separate cloud service, or the graph database cloud service can be provided as an additional cloud service to other cloud services, which is not specifically limited in the embodiments of the present application.
[0072] When a computing device cluster is implemented through a cloud computing service center, as shown in FIG4 , an implementation scenario involving a graph database system and its query method provided in an embodiment of the present application includes: a data center 1 and a client 20. A communication connection can be established between the data center 1 and the client 20 through a network. Optionally, the network can be the Internet or other networks, which is not limited in the embodiment of the present application. Tenants can interact with the data center 1 through the client 20. For example, a tenant can send information such as a data query request to the data center 1 through the client 20. The data center 1 is used to respond based on the information sent by the client 20.
[0073] A large amount of infrastructure owned by the cloud service provider is deployed in the data center 1, such as computing resources, storage resources, and network resources. For example, computing resources can be computing devices (such as servers, etc.) that can provide computing capabilities. At this time, the computing device 10 is deployed in the data center 1. As shown in Figure 4, the data center 1 includes a cloud management platform and infrastructure (not shown in Figure 4). The cloud management platform and the infrastructure are connected through the internal network of the data center. The cloud management platform is used to manage the infrastructure. The infrastructure is used to provide public cloud services, such as the above-mentioned graph database cloud service. The infrastructure includes multiple servers. Cloud services can be optionally deployed in the server. Cloud services are implemented by running virtual instances, so they are also called virtual instances deployed in the server for implementing tenant services. Tenants can send cloud service requests and related information to the server through the client 20 they use. The server can process the cloud service requests and related information, and provide cloud services to tenants based on the processed cloud service requests and related information. For example, the server can receive a data query request sent by a first user through the query method of the graph database system provided in the embodiment of the present application, find the second graph data based on the data query request, complete the missing information of the second graph data to obtain the first graph data, and feedback a response to the data query request to the first user based on the first graph data.
[0074] The cloud management platform can be logically divided into the following functional areas: the tenant console, compute management service, network management service, storage management service, authentication service, and image management service. The tenant console provides an interface or application program interface (API) for interacting with tenants. The compute management service manages servers running virtual instances and bare metal servers. The network management service manages network services (such as gateways and firewalls). The storage management service manages storage services (such as data bucket services). The authentication service manages tenant accounts and passwords. The image management service manages images for virtual instances.
[0075] In the implementation scenario shown in Figure 4, multiple servers are deployed in a data center. The server includes a hardware layer and a software layer. The hardware layer is the standard configuration of the server. The hardware layer deploys hardware devices such as processors, memory, network cards, disks, and buses. The software layer includes the operating system installed and running on the server. The operating system of the virtual machine can be called the host operating system. The host operating system runs a virtual machine manager (also called a hypervisor). The role of the virtual machine manager is to implement computing virtualization, network virtualization, and storage virtualization for the virtual machine, and is responsible for managing the virtual machine.
[0076] The cloud management platform client runs within the virtual machine manager. The cloud management platform client receives control plane commands from the cloud management platform, creates virtual instances on servers based on these commands, and manages the virtual instances throughout their lifecycle. For example, the cloud management platform client monitors the hardware resource usage of the server in real time and reports this information to the cloud management platform. When the cloud management platform confirms the creation of a virtual instance on a server, it sends a virtual instance creation command to the cloud management platform client on that server. Upon receiving this command, the cloud management platform client creates the virtual instance on that server. This allows tenants to create, manage, log in to, and operate virtual instances in the data center through the cloud management platform.
[0077] Servers can be used to run virtual machines of varying specifications. Virtual machine specifications are categorized as general-purpose computing, memory-optimized, and ultra-large memory, with each type further defined. After a tenant selects a virtual machine specification, the cloud management platform selects a server in the data center that supports that specification, determines if the server has sufficient available hardware resources, and then creates a virtual machine with that specification on that server. Configuring servers through the cloud management platform allows for analysis and planning of server hardware resources. Based on the server's hardware performance, computing products corresponding to the physical hardware can be planned, such as virtual machines of varying specifications, to meet the differentiated needs of different tenants. Furthermore, the performance differences between virtual machines of varying specifications can enable differentiated pricing strategies. For example, virtual instances with high performance specifications can be sold at a higher price, while those with standard performance specifications can be sold at a lower price, allowing tenants to purchase virtual instances on demand.
[0078] In one implementation, as shown in Figure 5, the location of basic resources in a data center can be described using cloud resource deployment regions and availability zones (AZs). Tenants can optionally deploy cloud services based on resources in specific regions and AZs. Regions are defined based on geographic location and network latency. Within a region, the same resource pool is used, which can be understood as sharing public services such as elastic computing, block storage, object storage, virtual private cloud (VPC) networks, Elastic Internet Protocol (EIP) addresses, and images. Regions are categorized as general regions and dedicated regions. General regions provide general cloud services to public tenants. Dedicated regions are dedicated regions that carry the same type of business or provide services to specific tenants. A region typically includes multiple AZs. AZs within a region are connected by high-speed fiber optic cables to meet tenants' needs for building high-availability systems across AZs. An AZ is a collection of one or more data centers, as shown in Figure 5. Computing, networking, and storage resources within an AZ are logically divided into multiple clusters.
[0079] Tenants can send instructions to the cloud management platform through the client 20 they use to create, manage, log in and operate virtual instances in the server, and use the cloud services provided by the virtual instances. For example, the cloud management platform can provide an access interface. The access interface can be optionally provided in the form of an interface or an API. Tenants can operate the client to remotely access the access interface to register a cloud account and password on the cloud management platform, and use the cloud account and password to log in to the cloud management platform. The cloud management platform can also authenticate the cloud account and password. After successful authentication, the tenant can further select and pay to purchase a virtual instance of specific specifications (processor, memory, disk) on the cloud management platform. After the tenant successfully pays for the virtual instance, the cloud management platform provides the tenant with the remote login account and password of the purchased virtual instance. The tenant can use the remote login account and password to remotely log in to the virtual instance on the client, install and run the tenant's application in the virtual instance, and implement the tenant's business through the application.
[0080] In one implementation, the graph database system and query method thereof provided in the embodiments of the present application can be implemented by running an executable program on one or more computing devices 10. For example, the executable program of the graph database system and query method thereof can be optionally presented in the form of an application installation package. After the application installation package is installed on one or more computing devices 10, the graph database system and query method thereof can be implemented by running the executable program. When the computing device cluster is implemented through a cloud computing service center, the graph database system and query method thereof provided in the embodiments of the present application can be implemented by running the executable program on computing devices in the data center 1.
[0081] It should be understood that the above content is an illustrative description of the implementation scenarios of the graph database system and its query method provided in the embodiments of this application, and does not constitute a limitation on the implementation scenarios of the graph database system and its query method. A person skilled in the art will know that as business needs change, its implementation scenarios can be adjusted according to application requirements, and the embodiments of this application do not specifically limit them. In addition, when the graph database system and its query method provided in the embodiments of this application are applied to other scenarios, the executable program of the method can also be presented in the form of an application installation package or in other ways, and the embodiments of this application do not list them one by one.
[0082] The following first introduces the implementation of the graph database system provided by the embodiment of the present application. Figure 6 is a structural diagram of a graph database system provided by the embodiment of the present application. As shown in Figure 6, the graph database system 60 includes: an interaction module 601 and a processing module 602.
[0083] The interaction module 601 is used to receive a data query request sent by the first user and provide the data query request to the processing module 602. The data query request indicates a query for a specified event in the graph database system 60. For example, the data query request indicates a query for possible high-net-worth customers and potential customers who may purchase specified products. When the first user needs to query a specified event, he or she may perform a specified operation on the client he or she uses to trigger the client to send the data query request to the graph database system 60. After the client sends the data query request to the graph database system 60, the interaction module 601 receives the data query request. In one possible implementation, the graph database system 60 can provide an application programming interface (API) for the client, and the client can trigger a data query request by accessing the API.
[0084] The processing module 602 is used to obtain first graph data related to a specified event based on a data query request. The first graph data is the graph data after the second graph data has supplemented the missing information. That is, the first graph data carries the information included in the second graph data and the information missing in the second graph data. The second graph data is found in the graph data stored in the graph database system 60 based on the data query request. If the data query request indicates that a specified event is to be queried in the graph database system 60, then the second graph data is the graph data related to the specified event in the graph database system 60. The graph data being related to the specified event means that the query results for the specified event are recorded in the graph data. For example, assuming that the graph database system 60 records the graph data shown in Figures 1 and 2, when the data query request indicates that the specified event to be queried is possible high-net-worth customers and potential customers who may purchase specified products, since the graph data shown in Figure 2 records the query results for the specified event, and the graph data shown in Figure 1 does not record the query results for the specified event, the processing module 602 can determine that the graph data shown in Figure 2 is the second graph data. It should be noted that the graph database system 60 typically records a large amount of graph data, and there may be multiple graph data recording query results for a specified event. In this case, the multiple graph data recording query results for the specified event are all second graph data. Accordingly, the processing module 602 can obtain multiple first graph data corresponding to the multiple second graph data, with any one of the first graph data being the graph data after the corresponding second graph data has completed the missing information.
[0085] Furthermore, the first graph data and the second graph data may both be a complete graph, or subgraphs within a complete graph. A subgraph is a portion of a complete graph, including some vertices and some edges within the complete graph. A subgraph is also called a partition within a graph. A complete graph may have multiple subgraphs, with different subgraphs containing at least some different vertices and at least some different edges. When the second graph data is a subgraph, the subgraph may be obtained by partitioning the complete graph based on a data query request. For example, a complete graph represents the relationships between multiple entities with the same attribute, and these multiple entities may be divided into multiple entity sets. Each entity set includes some entities from multiple entities, and each entity set has a sub-attribute, with different entity sets having different sub-attributes. A graph consisting of multiple entities within an entity set is a subgraph within the complete graph. The data query request may instruct a query for entities with a sub-attribute that satisfy a specified event. In this case, the second graph data obtained based on the data query request is a subgraph indicating multiple entities with the sub-attribute and the relationships between them. For example, suppose a complete graph records information about customers who have browsed all products of a certain brand. That is, the same attribute possessed by multiple entities in the complete graph is: multiple entities have browsed products of this brand. When a data query request indicates to query potential customers who may purchase a product of this brand, information indicating customers who have browsed the product can be determined in the complete graph based on the data query request, and the subgraph shown in Figure 2 is obtained. At this time, the sub-attribute possessed by multiple entities in the subgraph is: multiple entities have browsed a specified product of this brand. It should be noted that the above is only an exemplary description of the attributes corresponding to the complete graph and the subgraph. The complete graph and the subgraph can also have other attributes, which are not exemplified here one by one.
[0086] The interaction module 601 is further configured to, after the processing module 602 obtains the first graph data related to the specified event in the data query request, provide a response to the data query request based on the first graph data to the first user. The response carries data that matches the specified event. Specifically, after the processing module 602 completes the second graph data to obtain the first graph data, it obtains a query result for the data query request based on the first graph data and then provides the query result to the interaction module 601. After obtaining the query result, the interaction module 601 provides a response indicating the query result to the first user. Alternatively, after the processing module 602 obtains the first graph data, it provides the first graph data to the interaction module 601. After obtaining the first graph data, the interaction module 601 obtains a query result for the data query request based on the first graph data and then provides a response indicating the query result to the first user. This embodiment of the application is described using an example in which the processing module 602 provides the query result of the data query request to the interaction module 601, and the interaction module 601 provides a response indicating the query result to the first user. The data that matches the specified event indicates the entity indicated by the vertex in the first graph data that matches the specified event. For example, when a data query request indicates a query for possible high-net-worth customers and potential customers who may purchase a specified product, the query result of the graph data shown in Figure 2 for the data query request indicates that the potential customers who may purchase the specified product are Xiao Li, Xiao Zhang, Xiao Wang and Xiao O, and the potential high-net-worth customers are Xiao O and Xiao Li. That is, the data carried in the response to the data query request indicates that "the potential customers who may purchase the specified product are Xiao Li, Xiao Zhang, Xiao Wang and Xiao O, and the potential high-net-worth customers are Xiao O and Xiao Li."
[0087] Optionally, the response may carry not only data that matches the specified event, but also the probability that the entity indicated by the data matches the specified event. That is, the response carries the entity that matches the specified event and the probability that the entity matches the specified event. In this way, the graph database system provides the first user with more detailed query results, can provide the first user with more reference information, and help the first user make more appropriate decisions based on the degree to which the probability indicates that the entity matches the specified event. Furthermore, the entity carried by the response can be an entity whose probability of matching the specified event is greater than a specified probability threshold. That is, the probability that the entity carried by the response matches the specified event is greater than the specified probability threshold, and the response also carries a specific numerical value of the probability that the entity matches the specified event. The value of the specified threshold can be determined according to application requirements, and the embodiments of the present application do not specifically limit it. For example, Tables 1 and 2 show the query results of the data query request in the above example. As can be seen from Table 1, in addition to indicating the names of potential customers who may purchase the specified product, the query results also indicate the probability of these potential customers purchasing the specified product. As can be seen from Table 2, the query results not only indicate the names of possible high-net-worth customers, but also indicate the probability that these customers are high-net-worth customers.
[0088] Table 1
[0089] Table 2
[0090] In one possible implementation, after receiving the data query request, the processing module 602 may first obtain the second graph data based on the data query request, and obtain the target information that is missing from the second graph data, and then obtain the value of the target information based on the association between the second graph data, the target information and the specified event, and add the value of the target information to the second graph data to obtain the first graph data. For example, after receiving the data query request, the processing module 602 may obtain the specified event indicated by the data query request, and then select the graph data that records the query result of the specified event from the graph data recorded in the graph database system 60, and then determine the selected graph data as the second graph data. For example, as shown in Figure 7, the graph database system 60 also includes: a storage module 603. The storage module 603 is used to store graph data. Then, after receiving the data query request, the processing module 602 may first obtain the second graph data related to the specified event from the storage module 603 based on the specified event indicated by the data query request.
[0091] The target information is used to indicate the type of information that needs to be completed for the second graph data. In one possible implementation, the target information is used to indicate one or more of the following: the identifier of the entity indicated by the vertex in the graph data, the attribute information of the entity indicated by the vertex in the graph data, the relationship between different entities indicated by different vertices in the graph data, or the attribute information of the relationship. After the processing module 602 obtains the data query request, it can obtain the information that the graph data indicated by the data query request should record. The information that the graph data indicated by the data query request should record can be indicated by the configuration information of the graph data. After the processing module 602 obtains the configuration information of the second graph data, it can determine the target information missing from the second graph data based on the configuration information. The configuration information is used to indicate the type of information that the graph data indicated by the data query request needs to record. For example, the configuration information indicates one or more of the following: the identifier of the entity indicated by the vertex in the graph data, the attribute information of the entity indicated by the vertex in the graph data, the relationship between different entities indicated by different vertices in the graph data, or the attribute information of the relationship.
[0092] In one possible implementation, after obtaining configuration information, processing module 602 may, based on the configuration information, check whether the second graph data contains all the information indicated by the configuration information, and determine the information indicated by the configuration information but not recorded in the second graph data as target information missing from the second graph data. For example, assume that the configuration information of the second graph data indicates that each vertex in the second graph data must record the identifier of the entity indicated by the vertex and attribute information indicating multiple specified attributes, that whether an edge exists between two vertices is determined based on the relationship between the entities represented by the two vertices, and that each edge must record its attribute information. If a vertex in the second graph data does not record the identifier of the entity it indicates, the target information missing from the second graph data indicates that the identifier of the entity indicated by the vertex needs to be supplemented in the second graph data. If a vertex in the second graph data does not record attribute information for a first attribute among multiple specified attributes, the target information missing from the second graph data indicates that the attribute information carrying the first attribute needs to be supplemented in the second graph data. The first attribute is any one of the multiple specified attributes. When there are two vertices in the second graph data that are not connected by an edge, but the relationship between the entities indicated by the two vertices indicates that there is an association between the two entities, the content indicated by the missing target information of the second graph data includes: the edge between the two vertices needs to be completed for the second graph data. When there is an edge between two vertices in the second graph data that does not record attribute information, the content indicated by the missing target information of the second graph data includes: the attribute information of the edge between the two vertices needs to be completed for the second graph data. For example, it is assumed that the second graph data determined by the processing module 602 based on the data query request is the graph data shown in Figure 2. The configuration information of the graph data indicates that the information that needs to be recorded in the graph data includes: attribute information of each query object and whether it is a high-net-worth person and a potential customer who purchases the specified product, as well as the social relationship between the query objects that have browsed the specified product. Based on the configuration information, the processing module 602 can determine that the graph shown in FIG2 lacks the following information: the vertex indicating Xiao Zhang lacks the attribute information of whether he is a high-net-worth person and a potential customer who purchases designated goods, the vertex indicating Xiao Li lacks the attribute information of whether he is a high-net-worth person, the vertex indicating Xiao Wang lacks the attribute information of whether he is a high-net-worth person and a potential customer who purchases designated goods, the vertex indicating Xiao N lacks the attribute information of whether he is a high-net-worth person and a potential customer who purchases designated goods, and the vertex indicating Xiao O lacks the attribute information of whether he is a potential customer who purchases designated goods. These missing information are the target information that is missing from the graph data shown in FIG2. It should be noted that the configuration information may be part of the information that is actually missing from the graph data. At this time, the information not indicated by the configuration information can be considered as information that does not need to be paid attention to or has little reference value when implementing the business, that is, it is considered not to be information missing from the graph data.For example, the graph data shown in FIG2 actually still lacks the age and gender of the customer indicated by each vertex, but the age and gender of the customer provide little reference value for the query, so it can be considered that the age and gender of the customer are not missing information in the graph data shown in FIG2.
[0093] Optionally, the configuration information of the graph data can be obtained by setting the user of the graph database. The interactive module 601 is also used to receive the configuration information set by the second user for the second graph data. In this way, customized completion of the second graph data can be achieved. Among them, the user can set the configuration information for the graph data multiple times based on needs. For example, after the user sets the configuration information for the graph data for the first time, the user can also modify, add and delete the configuration information of the graph data. The second user may be the same as or different from the first user. For example, the second user is the administrator of the graph database system 60, and the first user is the user of the graph database system 60. In this case, the first user is different from the second user. For another example, the first user and the second user are both users who use the graph database system 60 to query.
[0094] The second user can set configuration information for the graph data using the database definition language (DDL). DDL is used to indicate the information that needs to be recorded in the graph data, such as the attribute information of the vertices and / or edges in the graph, the edges between vertices, etc. The following is an exemplary description of the configuration information represented by DDL:
[0095] [Create|Drop]ML Index on([node selection query|edge selection query]{property selection query}) is used to indicate the construction or deletion of certain attribute information of some vertices or edges in the graph data. When the DDL indicates the construction of certain attribute information of some vertices or edges in the graph data, it means that the graph data needs to record these attribute information. At this time, the DDL indicates the configuration information of the graph data. When the graph data lacks these attribute information, the processing module 602 can complete these attribute information for the graph data based on the DDL. Among them, the node selection query indicates the vertices that need to be constructed or deleted, the edge selection query indicates the edges that need to be constructed or deleted, and the property selection query indicates the attribute information that needs to be constructed or deleted. For example, for Figure 2, Create ML Index on(p:Person{buyer,rich}) indicates the construction of attribute information of whether the Person is the buyer of the specified product and whether the Person is rich on all vertices indicating Person.
[0096] [Create|Drop]ML Edge on((node selection query 1)-[:`edgeName`]->(node selection query 2)) is used to indicate the construction or deletion of an edge named "edgeName" between the node selected by node selection query 1 and the node selected by node selection query 2 in the graph data. When the DDL indicates the construction of an edge named "edgeName" between the node selected by node selection query 1 and the node selected by node selection query 2 in the graph data, it means that the graph data needs to record these edges. At this time, the DDL indicates the configuration information of the graph data. When the graph data lacks these edges, the processing module 602 can complete these edges for the graph data based on the DDL. For example, for Figure 2, Create ML Edge on(p:Person-[:Know]->p2:Person) indicates the construction of an edge between all vertices indicating Person, indicating whether the Person indicated by the vertex knows each other (Know).
[0097] It should be noted that the above is only a schematic example of the configuration information represented by DDL, and there may be more implementation methods. For example, DDL can also indicate the effective time limit, effective scope, and method of completing graph data based on the configuration information. Among them, the effective time limit of the configuration information refers to the time when the configuration information takes effect after the configuration information is set for the graph data. For example, the effective time limit of the configuration information indicates that it takes effect immediately after the configuration information is set. That is, after the configuration information is set, the missing information of the graph data is determined according to the newly configured configuration information. Alternatively, the effective time limit of the configuration information indicates that the configuration information will take effect only after the configuration information is set and the effective period of the configuration information is reached. That is, the effective time of the configuration information is set in the graph data system. After the configuration information is set, if the effective time of the old configuration information has not reached the effective time, the missing information of the graph data is still determined according to the old configuration information. After the effective time of the old configuration information reaches the effective time, the missing information of the graph data is determined according to the newly configured configuration information. The effective scope indicates the scope to which the configuration information applies. For example, the effective scope indicates that the configuration information is applicable to the entire graph, or the effective scope indicates that the configuration information is applicable to certain subgraphs of the entire graph.
[0098] In one possible implementation, the operation of completing the second graph data can be obtained by prediction. The prediction process can be performed by the processing module 602, or the processing module 602 calls other modules to perform. For example, as shown in Figure 7, the graph database system 60 also includes: a prediction module 604. The processing module 602 can call the prediction module 604 to complete the second graph data to obtain the first graph data. That is, the processing module 602 is used to obtain the second graph data and its missing target information based on the data query request, and then provide the second graph data and target information to the prediction module 604. After obtaining the second graph data and the target information, the prediction module 604 is used to predict the value of the target information based on the association relationship between the second graph data, the target information and the specified event indicated by the data query request, and then add the predicted target information value to the second graph data to obtain the first graph data, and provide the first graph data to the processing module 602. The implementation process is as follows: after obtaining the second graph data and target information, the prediction module 604 analyzes the existing information, target information and specified events in the second graph data, obtains the correlation between various data, target information and specified events in the second graph data, and predicts the value of the target information based on the correlation, and then completes the second graph data based on the predicted value of the target information to obtain the first graph data.
[0099] In one possible implementation, the prediction module 604 is implemented by machine learning (ML) technology. For example, the prediction module 604 is implemented based on a pre-trained machine learning model. For example, the machine learning model can be selected as a deep learning model. For example, the machine learning model is a graph neural network (GNN), a graph convolutional network (GCN), a graph attention network (GAT), a graph sample and aggregate (GraphSAGE) or other machine learning models that can implement corresponding functions. At this time, after the processing module 602 obtains the second graph data and its missing target information, it can input the second graph data and its missing target information into the machine learning model, and receive the first graph data output by the machine learning model. Accordingly, the graph database system 60 of the present application is also called a neural graph database system.
[0100] When prediction module 604 is implemented using this deep learning model, the output of the deep learning model also includes a confidence level for the target information value. The confidence level for any target information value indicates the degree of trustworthiness of the target information value. When obtaining a query result for a data query request based on the first graph data provided by prediction module 604, the probability that the entity involved in the query result corresponds to a specified event can also be determined based on the confidence level. For example, continuing with the graph data shown in the previous Figure 2 as an example, assume that the missing information completed in the first graph data output by the deep learning model indicates the following: the attribute information indicating Xiao Li’s vertex indicates that the confidence that Xiao Li is a high-net-worth person is 1; the attribute information indicating Xiao Zhang’s vertex indicates that the confidence that Xiao Zhang is a high-net-worth person is 0.7656757, and the confidence that Xiao Zhang is a potential customer who purchases the specified product is 0.8656757; the attribute information indicating Xiao Wang’s vertex indicates that the confidence that Xiao Wang is a high-net-worth person is 0.202511, and the confidence that Xiao Wang is a potential customer who purchases the specified product is 0.1231242; the attribute information indicating Xiao N’s vertex indicates that the confidence that Xiao N is a high-net-worth person is 0.31452, and the confidence that Xiao N is a potential customer who purchases the specified product is 0.4251211; the attribute information indicating Xiao O’s vertex indicates that the confidence that Xiao O is a potential customer who purchases the specified product is 0.7546752. When a query result is obtained based on the first graph data, the confidence level can be directly determined as the probability that the entity involved in the query result meets the specified event, that is, the results shown in Table 1 and Table 2 are obtained.
[0101] When the prediction module 604 is implemented based on a pretrained machine learning model, the machine learning model is further configured to obtain first computational data pre-calculated by the pretrained machine learning model, and then predict the value of the target information based on the first computational data, the second graph data, and the target information, thereby obtaining the first graph data. The first computational data may optionally be calculated based on the training data. For example, the first computational data is the result of calculations performed by the embedding layer of the pretrained deep learning model based on the training data. In one possible implementation, after obtaining the first computational data, the second graph data, and the target information, the machine learning model may filter computational data from the first computational data that matches the second graph data and the target information based on the second graph data and the target information, then predict the value of the target information based on the filtered computational data, and then complete the second graph data based on the value of the target information to obtain the first graph data. For example, the graph data used to train the deep learning model includes graph data in the graph database system 60 for user queries. This graph data is typically represented in text. During the training of the deep learning model, the embedding layer of the deep learning model converts the textual representation of the graph data into a vector representation, and then performs subsequent training based on the vector. After completing the training process of the deep learning model, the prediction module 604 can obtain and store the vectors converted by the embedding layer during the training process, and when the deep learning model predicts the value of the target information, the vector used to represent the second graph data is filtered from the vectors converted by the embedding layer during the training process based on the second graph data and the target information, and then the value of the target information is predicted based on the filtered vectors. Among them, the embedding layer converts the graph data represented by text into a vector representation, which is an implementation method for converting the graph data represented by text into machine language. The deep learning model can also convert the graph data represented by text into other types of machine language based on demand, and the embodiments of this application do not provide examples one by one.
[0102] Optionally, the first calculation data may be stored in the storage module 603. In one possible implementation, the first calculation data obtained based on any graph data may be optionally stored in the graph data as attribute information of the graph data. In this way, when the graph data is obtained, the first calculation data obtained based thereon can be directly obtained. Alternatively, the graph database system 60 includes at least two storage modules 603, one of which is used to store graph data, and the other is used to store the first calculation data. For example, as shown in FIG8 , the graph database system 60 includes a graph data storage module 6031 and a calculation data storage module 6032, the graph data storage module 6031 is used to store graph data, and the calculation data storage module 6032 is used to store the first calculation data. After storing the first calculation data, the calculation data storage module 6032 may also store related data such as metadata of the first calculation data in the graph data storage module 6031, so that the processing module 602 can obtain the related data when reading the second graph data in the graph data storage module 6031, and obtain the first calculation data indicated by the related data from the calculation data storage module 6032 based on the related data.
[0103] When the first graph data is obtained based on pre-calculated first calculation data, the process of obtaining the first graph data does not require the computational process of obtaining the first calculation data based on the second graph data. This reduces the amount of computation required to obtain the first graph data, speeding up the process of obtaining the first graph data and, in turn, accelerating the query process of the graph database system 60. Furthermore, because the machine learning model is pre-trained, the relationships reflected by the first calculation data are likely to satisfy the relationships between various data in the second graph data and the target information. Therefore, even if the first calculation data is not calculated based on the second graph data and the target information, the impact of the first calculation data on the accuracy of the obtained first graph data can be controlled within an acceptable range, thereby ensuring the accuracy of the obtained first graph data.
[0104] When a machine learning model is used to complete the second graph data to obtain the first graph data, the graph database system 60 can automatically complete the second graph data, completing missing information without the user's awareness of the missing information. This can enhance user trust in the graph database system 60 and help improve the usability and user engagement of the graph database system 60. Furthermore, when a machine learning model is used to complete the second graph data to obtain the first graph data, the graph database system 60 can lower its requirements for graph data completeness, allowing graph data with only a small amount of annotated vertex and edge information to be added to the graph database system. When the vertex and edge information in the graph data is annotated by a user (e.g., a graph database system administrator), the workload of annotating the graph data can be reduced. Furthermore, because the prediction module 604 is a built-in module of the graph database system 60, it can be deeply integrated with the existing functions of the graph database system 60. This allows users to seamlessly query the prediction module 604 while using the graph database system 60, enabling seamless access to the graph database system 60 with prediction functionality, thereby improving the user experience. Compared to technologies where the graph database system 60 can only use prediction functions through external calls, this prediction function eliminates the need for repeated data migration between the graph database system 60 and the external prediction module 604, reducing query overhead and the user threshold of the graph database system 60, thereby further improving the usability of the graph database system 60. Specifically, users are unaware of querying using the prediction module 604, including but not limited to being unaware of the query language and the interaction between the original graph database functions and the prediction module 604.
[0105] In addition, after obtaining the first graph data, the processing module 602 may optionally save the first graph data. When the processing module 602 receives a data query request again, it may optionally determine whether the first graph data is the graph data indicated by the data query request based on the data query request. When the first graph data is the graph data indicated by the data query request, the processing module 602 may directly feedback a response to the data query request based on the first graph data. At this time, there is no need to perform a completion operation on the second graph data, which can simplify the calculation process of the processing module 602 and reduce computing overhead. When the first graph data is not the graph data indicated by the data query request, the processing module 602 obtains the second graph data based on the data query request, then completes the second graph data to obtain the first graph data, and then feedbacks a response based on the completed first graph data.
[0106] It should be noted that, in the process of obtaining the first graph data based on the data query request, the processing module 602 may first perform preprocessing based on the data query request, and then obtain the first graph data based on the preprocessing results. For example, the functions of the processing module 602 can be implemented by a parser, an optimizer, and a processing unit. The parsing unit is used to parse the data query request represented in text and provide the parsing results to the optimization unit. The parsing results are used to indicate the query requirements and the information that should be recorded in the graph data indicated by the data query request, that is, the parsing results indicate the query requirements of the data query request and its corresponding configuration information. The parsing results can be represented using an abstract syntax tree (AST). An abstract syntax tree is an abstract representation of the grammatical structure of the source code. It represents the grammatical structure of a programming language in a tree-like form, with each node on the tree representing a structure in the source code. The optimization unit is used to generate the operation flow required to be executed by the data query request based on the parsing results and provide the operation flow to the processing unit. The processing unit is used to obtain the second graph data indicated by the data query request based on the operation flow. The operation flow indicates multiple operations in a sequential order. The operation flow can be represented by a query plan tree. The query plan tree is a tree-like data structure that can be recognized by the graph database system 60, which has multiple nodes, each node is used to indicate an operation command. The operation flow starts to execute from the root node of the query plan tree, and the execution of the remaining nodes except the root node depends on the execution result of its parent node. Since the operation flow indicates multiple operations with a sequence, the execution of these multiple operations requires reference to different data, then the operation flow also indicates the sequence of the data that needs to be obtained. Accordingly, when the processing unit obtains the second graph data from the storage module 603, it can obtain the data in the second graph data in sequence according to the data indicated by the operation flow.
[0107] As can be seen from this, the graph database system 60 of the present application can be implemented by multiple components. Figure 9 is a schematic diagram of the graph database system 60 shown in Figure 8 implementing data queries through multiple components. As shown in Figure 9, the interaction module 601, also known as the graph query interface, is responsible for interfacing with users and providing them with graph query capabilities. For example, the interaction module 601 is configured to receive a data query request from a first user and provide the first user with a response to the data query request. The processing module 602 includes a parsing unit 6021, an optimization unit 6022, and a processing unit 6023. The parsing unit is configured to receive the data query request from the interaction module 601, as shown in step 1 in Figure 10, and then parse the user's data query request into an abstract syntax tree and provide the abstract syntax tree to the optimization unit, as shown in step 2 in Figure 10. The optimization unit is configured to convert the abstract syntax tree into a query plan tree, optimize the query plan tree as needed, and provide the optimized query plan tree to the processing unit, as shown in step 3 in Figure 10. The processing unit is configured to query relevant points and edges from the graph data storage module 6031 based on the query plan tree, as shown in step 4 in Figure 10. The graph data storage module 6031 provides the relevant points and edges to the processing unit, as shown in step ⑤ in Figure 10. After obtaining the points and edges provided by the graph data storage module 6031, the processing unit provides the points and edges obtained from the graph data storage module 6031 to the prediction module 604, as shown in step ⑥ in Figure 10. The points and edges obtained by the processing unit from the graph data storage module 6031 constitute the second graph data. After obtaining the second graph data provided by the processing unit, the prediction module 604 completes the second graph data based on the second graph data to obtain the first graph data, and outputs the first graph data to the processing unit, as shown in step ⑨ in Figure 10. The processing unit receives the first graph data output by the prediction module 604, and provides the query result of the data query request to the interaction module 601 based on the first graph data, as shown in step ⑩ in Figure 10. Among them, if the first calculation data is stored in the calculation data storage module 6032, the prediction module 604 can first obtain the first calculation data from the calculation data storage module 6032 when completing the second graph data, as shown in step ⑦ in Figure 10. The calculation data storage module 6032 provides the first calculation data to the prediction module 604, as shown in step ⑧ of Figure 10. After obtaining the first calculation data, the prediction module 604 then completes the second graph data based on the first calculation data. The order of the steps in Figure 10 indicates the order in which the corresponding steps are executed, with the steps with smaller numbers being executed first.
[0108] For example, assuming the machine learning model is a GCN model, and continuing with the query in Figure 2 , Figure 11 illustrates the query plan tree generated by the processing unit when the data query request indicates whether the specified event is whether Xiao Li is a high-net-worth individual. As shown in Figure 11 , the query plan tree includes two branches: the left branch, which feeds into the Union operator from the left, and the right branch, which feeds into the Union operator from the right. The root node of the left branch instructs: First, retrieve all vertices and edges between vertices that indicate Xiao Li from the graph data storage module 6031 . This function is implemented by the NodeByPropertyScan(x.name=Xiao Li) operator in Figure 11 . The first-level child node of this root node instructs: From all retrieved vertices, select all vertices whose attribute information indicating whether Xiao Li is a high-net-worth individual is true. This function is implemented by the Filter(x.rich!=null&x.rich=true) operator in Figure 11 . The root node of the right branch instructs: First, retrieve all vertices and edges between vertices that indicate Xiao Li from the graph data storage module 6031 . This function is implemented by the NodeByPropertyScan(x.name=Xiao Li) operator in Figure 11. The first-level child node of the root node indicates that all vertices whose attribute information indicating whether they are high-net-worth individuals has unknown values are selected from all the obtained vertices. This function is implemented by the Filter(x.rich=null) operator in Figure 11. The second-level child node of the root node (i.e., the child node of the first-level child node) indicates that all vertices and edges within two hops of the selected vertex are obtained from the graph data storage module 6031, and the second graph data is obtained based on all the vertices and edges obtained from the graph data storage module 6031. This function is implemented by the ExpandAsSubgraph(x,2) operator in Figure 11. Any vertex within two hops refers to a vertex that can be reached by taking the any vertex as the starting point and passing through two edges. Since the second graph data is a part of the graph stored in the graph data storage module 6031, the second graph data is a subgraph of the graph. The third-level child node of the root node (i.e., the child node of the second-level child node) instructs the processing unit to call the interface of the prediction module 604 to use the GCN model. The GCN model predicts all attribute information indicating whether the value is unknown based on the second graph data, and records the prediction results in the second graph data to obtain the first graph data, and provides the first graph data to the processing unit. This function is implemented by the GNNInference(GCN,Person.rich) operator in Figure 11. The fourth-level child node of the root node (i.e., the child node of the third-level child node) instructs the processing unit to filter out all vertices whose attribute information indicates that the customer indicated by the vertex is a high-net-worth person from the first graph data, and obtain the query result of the data query request. This function is implemented by the Filter(x.rich=ture) operator in Figure 11.The Union operator is used to aggregate the query results of the left branch and the right branch and provide the aggregated result to the ProduceResults operator. The ProduceResults operator is used to provide the query result to the interaction module 601 based on the aggregated result.
[0109] The training process of the machine learning model is described below. The training process includes multiple sub-training processes that are executed in sequence. The sub-training processes include: the processing module 602 obtains a data query request for training, obtains the graph data for training indicated by the data query request based on the data query request, determines the target information missing from the graph data for training, and inputs the target information and the graph data for training into the machine learning model, so that the machine learning model performs model training based on the target information and the graph data for training. After completing multiple sub-training processes, the processing module 602 can obtain the first calculation data calculated by the trained machine learning model for each graph data for training, and store the first calculation data.
[0110] Similar to the query process of graph database system 60, processing module 602 may also pre-process the training data query request and then perform subsequent training operations based on the pre-processed data. For example, when the functions of processing module 602 are implemented by a parsing unit, an optimization unit, and a processing unit, the parsing unit is configured to obtain the training data query request provided by interaction module 601 (step 1) in Figure 12 , then parse the textual representation of the training data query request and provide the parsing results to the optimization unit (step 2) in Figure 12 . The parsing results indicate the information that should be recorded in the graph data queried by the training data query request, i.e., the parsing results indicate the configuration information corresponding to the training data query request. The optimization unit is configured to generate the operation flow required to be executed by the training data query request based on the parsing results and provide this operation flow to the processing unit (step 3) in Figure 12 . Based on this operation flow, the processing unit is configured to obtain the second graph data queried by the training data query request from graph data storage module 6031 (step 4) in Figure 12 . The graph data storage module 6031 provides the relevant points and edges to the processing unit (step 5) in Figure 12 . When the processing unit obtains the second graph data from the storage module 603, it may sequentially obtain data from the second graph data according to the data indicated by the operation flow. After obtaining the points and edges provided by the graph data storage module 6031, the processing unit provides the points and edges obtained from the graph data storage module 6031 to the prediction module 604, as shown in step 6 of Figure 12. The points and edges obtained from the graph data storage module 6031 are combined into the second graph data by the processing unit. After obtaining the second graph data provided by the processing unit, the prediction module 604 completes the second graph data based on the second graph data to obtain the first graph data, and outputs the first graph data to the processing unit, as shown in step 7 of Figure 12. After completing multiple sub-training processes, the processing module 602 may calculate the first computational data obtained from the trained machine learning model for each training graph data, and store the first computational data in the computational data storage module 6032, as shown in step 8 of Figure 12. After storing the first computational data, the computational data storage module 6032 may store metadata and other related data of the first computational data in the graph data storage module 6031, as shown in step 9 of Figure 12. The order of steps in FIG12 is used to indicate the execution order of the corresponding steps, and the steps with smaller numbers are executed first.
[0111] For example, assuming that the machine learning model is a GCN model, the query in FIG2 is still used as an example for explanation. When the data query request used for training indicates that the specified event of the query is a possible high-net-worth customer, FIG13 is a schematic diagram of the query plan tree generated by the processing unit for training. As shown in FIG13, the root node of the query plan tree indicates: first, from the graph data storage module 6031, obtain all vertices indicating people and the edges between the vertices. This function is implemented by the NodeByPropertyScan(Person) operator in FIG13. The first-level child node of the root node indicates that all vertices and edges within two hops of all vertices obtained by the root node are obtained from the graph data storage module 6031, and based on all vertices and edges obtained from the graph data storage module 6031, a second graph data (i.e., a subgraph) is obtained. This function is implemented by the ExpandAsSubgraph(2) operator in FIG13. The second-level child node of the root node (i.e., the child node of the first-level child node) indicates that the processing unit calls the interface of the prediction module 604 to train the GCN model. During training, the GCN model needs to predict all unknown attribute information indicating whether a person belongs to a high-net-worth individual based on the second graph data, record the prediction results in the second graph data, obtain the first graph data, and provide this first graph data to the processing unit. This function is implemented by the GNNTraining(GCN) operator in Figure 13. The third-level child node of the root node (i.e., the child node of the second-level child node) instructs the processing unit to obtain the calculation results (i.e., the first calculation data) of the GCN model's embedding layer based on the training graph data from the prediction module 604, and then store this first calculation data in the calculation data storage module 6032. After storing this first calculation data, the calculation data storage module 6032 can store metadata and other related data of the first calculation data in the graph data storage module 6031. The function of obtaining the first calculation data is implemented by the Pre-ComputeEmbedding operator in Figure 13. The fourth-level child node of the root node (i.e., the child node of the third-level child node) refers to the storage of the trained GCN model. This function is implemented by the StoreModel operator in Figure 13.
[0112] As can be seen from the above, after receiving a data query request sent by a user, the graph database system of the present application can automatically complete the missing information of the second graph data queried by the data query request to obtain the first graph data, and then feedback the response to the data query request to the user based on the first graph data. Since the response to the data query request is based on the graph data after the missing information is completed, it can avoid the inability to obtain all query results due to missing information in the graph data, which helps to improve the accuracy of the query results. In addition, the graph database system of the present application can complete the missing information of the graph data without the user noticing it by automatically completing the missing information of the graph data, and will not make the user aware of the missing information of the graph data. It can improve the user's trust in the graph database and help to improve the usability and user stickiness of the graph database. In addition, the graph database system provided by the present application can reuse the functions of the existing graph database system to a large extent. When upgrading and updating the graph database system, it can reuse some executable programs used to implement the existing graph database system, which can reduce repeated development work, reduce development and maintenance costs, and improve the upgrade and update efficiency of the graph database system.
[0113] The following describes the implementation process of the query method of the graph database system provided in the embodiment of the present application. The query method of the graph database system is applied to the graph database system provided in the embodiment of the present application. Figure 14 is a flow chart of a query method of a graph database system provided in the embodiment of the present application. As shown in Figure 14, the query method of the graph database system includes the following steps:
[0114] Step 1401: Receive a data query request sent by a first user, where the data query request indicates querying a specified event in a graph database system.
[0115] The implementation process of step 1401 refers to the relevant description in the previous graph database system and will not be repeated here.
[0116] Step 1402: Based on the data query request, obtain the first graph data related to the specified event. The first graph data is the graph data after the second graph data completes the missing information. The second graph data is found in the graph data stored in the graph database system based on the data query request. The graph data is used to indicate multiple entities and the relationship between different entities.
[0117] In one possible implementation, obtaining first graph data related to a specified event based on a data query request includes: obtaining second graph data related to the specified event and target information missing from the second graph data based on the data query request; obtaining a value of the target information based on an association between the second graph data, the target information, and the specified event; and adding the value of the target information to the second graph data to obtain the first graph data. The target information may indicate one or more of the following: an entity identifier, attribute information of an entity, a relationship between different entities, or attribute information of a relationship.
[0118] Optionally, obtaining the value of the target information based on the association between the second graph data, the target information, and the specified event includes: predicting the value of the target information using a pretrained machine learning model based on the second graph data and the target information. Predicting the value of the target information using a pretrained machine learning model based on the second graph data and the target information includes: obtaining first calculation data precalculated by the pretrained machine learning model, and predicting the value of the target information using the pretrained machine learning model based on the first calculation data, the second graph data, and the target information.
[0119] In one possible implementation, the machine learning model includes a deep learning model, the first computing data is a calculation result of an embedding layer of a pre-trained deep learning model based on graph data used in training, and the first computing data is stored as attribute information of the graph data used in training.
[0120] In a possible implementation, as shown in FIG15 , the method further includes: step 1404, receiving configuration information set by the second user for the second graph data, the configuration information being used to indicate information that needs to be recorded in the second graph data. Accordingly, obtaining target information that is missing from the second graph data includes: determining the target information that is missing from the second graph data based on the configuration information. That is, step 1402 includes step 14021, obtaining the second graph data related to the specified event based on the data query request, determining the target information that is missing from the second graph data based on the configuration information, obtaining the value of the target information based on the association between the second graph data, the target information and the specified event, and adding the value of the target information to the second graph data to obtain the first graph data. The configuration information is used to indicate the type of information that needs to be recorded in the second graph data, and the type indicates one or more of the following: entity identification, entity attribute information, relationship between different entities, or attribute information of the relationship.
[0121] The implementation process of step 1402 refers to the relevant description in the previous graph database system and will not be repeated here.
[0122] Step 1403: Feedback a response to the data query request to the first user based on the first graph data, where the response carries data that matches the specified event.
[0123] Optionally, the response also carries the probability that the data matches a specified event. The implementation process of step 1403 is described in detail in the previous graph database system and will not be repeated here.
[0124] In summary, in the graph database query method provided in the embodiment of the present application, after receiving a data query request sent by a user, the graph database system can automatically complete the missing information of the second graph data queried by the data query request to obtain the first graph data, and then feedback the response to the data query request to the user based on the first graph data. Because the response to the data query request is based on the graph data after the missing information is completed, it can avoid the inability to obtain all query results due to missing information in the graph data, which helps to improve the accuracy of the query results. In addition, by automatically completing the missing information in the graph data, the graph database system of the present application can complete the missing information in the graph data without the user noticing that the graph data is missing, which can increase the user's trust in the graph database and help improve the usability and user stickiness of the graph database. In addition, the graph database system provided by the present application can reuse the functions of the existing graph database system to a large extent. When upgrading and updating the graph database system, some executable programs used to implement the existing graph database system can be reused, which can reduce repeated development work, reduce development and maintenance costs, and improve the upgrade and update efficiency of the graph database system.
[0125] It should be noted that the order of the steps in the query method for the graph database system provided in the embodiments of this application can be adjusted appropriately, and the number of steps can be increased or decreased accordingly. Any method that can be easily conceived by a person skilled in the art within the scope of the technology disclosed in this application should be included in the scope of protection of this application, and therefore will not be described in detail.
[0126] In this application, the interaction module 601, processing module 602, storage module 603, and prediction module 604 can all be implemented via software or hardware. For example, the implementation of the interaction module 601 will be described below using the interaction module 601 as an example. Similarly, the implementation of the processing module 602, storage module 603, and prediction module 604 can refer to the implementation of the interaction module 601.
[0127] As an example of a software functional unit, the interaction module 601 may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the interaction module 601 may include code running on multiple hosts / virtual machines / containers. It should be noted that when the graph database system of the present application is deployed in a cloud platform, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region (region) or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one cloud data center or multiple cloud data centers with similar geographical locations. Generally, a region may include multiple AZs.
[0128] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.
[0129] As an example of a hardware functional unit, the interaction module 601 may include at least one computing device, such as a server. Alternatively, the interaction module 601 may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0130] The multiple computing devices included in the interaction module 601 can be distributed in the same region or in different regions. The multiple computing devices included in the interaction module 601 can be distributed in the same AZ or in different AZs. Similarly, the multiple computing devices included in the interaction module 601 can be distributed in the same VPC or in multiple VPCs. The multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.
[0131] It should be noted that in other embodiments, any one of the interaction module 601, processing module 602, storage module 603, and prediction module 604 can be used to execute any step in the query method of the graph database system. The steps that the interaction module 601, processing module 602, storage module 603, and prediction module 604 are responsible for implementing can be specified as needed. By having the interaction module 601, processing module 602, storage module 603, and prediction module 604 respectively implement different steps in the query method of the graph database system, the full functionality of the query device of the graph database system is realized.
[0132] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the various components described above can refer to the corresponding contents in the aforementioned method embodiments and will not be repeated here.
[0133] The following is an example of the basic hardware structure involved in the embodiments of the present application.
[0134] This application also provides a computing device 1600. As shown in Figure 16, computing device 1600 includes a bus 1602, a processor 1604, a memory 1606, and a communication interface 1608. Processor 1604, memory 1606, and communication interface 1608 communicate with each other via bus 1602. Computing device 1600 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1600.
[0135] Bus 1602 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG16 shows only one line, but this does not imply a single bus or type of bus. Bus 1602 may include a path for transmitting information between various components of computing device 1600 (e.g., memory 1606, processor 1604, and communication interface 1608).
[0136] The processor 1604 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0137] The memory 1606 may include volatile memory, such as random access memory (RAM). The processor 1604 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).
[0138] Memory 1606 stores executable program code, which processor 1604 executes to implement the functions of interaction module 601, processing module 602, storage module 603, and prediction module 604, thereby implementing the query method for the graph database system. In other words, memory 1606 stores instructions for executing the query method for the graph database system.
[0139] The communication interface 1608 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1600 and other devices or a communication network.
[0140] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.
[0141] As shown in Figure 17, the computing device cluster includes at least one computing device 1600. The memory 1606 in one or more computing devices 1600 in the computing device cluster may store the same instructions for executing the query method of the graph database system.
[0142] In some possible implementations, the memory 1606 of one or more computing devices 1600 in the computing device cluster may also store partial instructions for executing the query method of the graph database system. In other words, the combination of one or more computing devices 1600 can jointly execute the instructions for executing the query method of the graph database system.
[0143] It should be noted that the memory 1606 in different computing devices 1600 in the computing device cluster can store different instructions, each used to execute a portion of the functions of the query device of the graph database system. In other words, the instructions stored in the memory 1606 in different computing devices 1600 can implement the functions of one or more modules among the interaction module 601, the processing module 602, the storage module 603, and the prediction module 604.
[0144] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), among others. FIG. 18 illustrates one possible implementation. As shown in FIG. 18 , two computing devices 1600A and 1600B are connected via a network. Specifically, the connection to the network is achieved via a communication interface in each computing device. In this type of possible implementation, the memory 1606 in the computing device 1600A stores instructions for executing the functions of the interaction module 601 and the processing module 602. Simultaneously, the memory 1606 in the computing device 1600B stores instructions for executing the functions of the storage module 603 and the prediction module 604.
[0145] The connection method between the computing device clusters shown in Figure 18 can be that considering that the query method of the graph database system provided in this application requires a large amount of data storage, it is considered to entrust the functions implemented by the storage module 603 and the prediction module 604 to the computing device 1600B for execution.
[0146] It should be understood that the functionality of the computing device 1600A shown in FIG18 may also be implemented by multiple computing devices 1600. Similarly, the functionality of the computing device 1600B may also be implemented by multiple computing devices 1600.
[0147] The present application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection relationship between the computing device clusters in Figures 17 and 18. However, the memory 1606 in one or more computing devices 1600 in this computing device cluster can store the same instructions for executing the query method of the graph database system.
[0148] In some possible implementations, the memory 1606 of one or more computing devices 1600 in the computing device cluster may also store partial instructions for executing the query method of the graph database system. In other words, the combination of one or more computing devices 1600 can jointly execute the instructions for executing the query method of the graph database system.
[0149] Embodiments of the present application also provide a computer program product containing instructions. The computer program product may be software or a program product containing instructions that can be executed on a computing device or stored on any available medium. When the computer program product is executed on at least one computing device, it causes the at least one computing device to execute a query method for a graph database system.
[0150] The embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute a query method for a graph database system, or instruct the computing device to execute a query method for a graph database system.
[0151] Those skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware, or may be accomplished by a program to instruct the relevant hardware, 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.
[0152] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, storage, display, etc.), and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the raw data and executable code involved in this application were obtained with full authorization.
[0153] In the embodiments of the present application, the terms "first," "second," and "third" are used for descriptive purposes only and should not be understood as indicating or implying relative importance. The term "at least one" refers to one or more, and the term "plurality" refers to two or more, unless otherwise expressly limited.
[0154] In this application, the term "and / or" simply describes an association between related objects, indicating that three possible relationships exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the related objects are in an "or" relationship.
[0155] 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. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the embodiments of the present application.
Claims
1. A graph database system, characterized in that: The graph database system includes: An interaction module is configured to receive a data query request sent by a first user, wherein the data query request indicates querying a specified event in the graph database system; a processing module, configured to obtain, based on the data query request, first graph data related to the specified event, the first graph data being graph data obtained by supplementing missing information with the second graph data, the second graph data being obtained by searching graph data stored in the graph database system based on the data query request, the graph data being used to indicate multiple entities and relationships between different entities; The interaction module is further configured to feed back a response to the data query request to the first user based on the first graph data, wherein the response carries data that matches the specified event.
2. The system according to claim 1, wherein The response also carries the probability that the data corresponds to the specified event.
3. The system according to claim 1 or 2, characterized in that The processing module is configured to obtain, based on the data query request, the second graph data related to the specified event and target information missing from the second graph data; obtain a value of the target information based on an association between the second graph data, the target information, and the specified event; and add the value of the target information to the second graph data to obtain the first graph data; The target information is used to indicate one or more of the following: the identifier of the entity, the attribute information of the entity, the relationship between different entities, or the attribute information of the relationship.
4. The system according to claim 3, wherein: The graph database system further includes: a storage module and a prediction module, wherein the storage module is used to store graph data; The processing module is configured to obtain, based on the data query request, the second graph data related to the specified event from the storage module, determine target information missing from the second graph data, and provide the second graph data and the target information to the prediction module; The prediction module is configured to predict a value of the target information based on the second graph data and the target information, and add the value of the target information to the second graph data to obtain the first graph data, and provide the first graph data to the processing module; The processing module is used to obtain the response to the data query request based on the first graph data.
5. The system according to claim 4, wherein: The prediction module is implemented based on a pre-trained machine learning model.
6. The system according to claim 5, wherein: The prediction module is used to obtain the first calculation data pre-calculated by the pre-trained machine learning model, and predict the value of the target information based on the first calculation data, the second graph data and the target information.
7. The system according to claim 6, wherein: The machine learning model includes a deep learning model, the first calculation data is a calculation result of an embedding layer of a pre-trained deep learning model based on the graph data used in training, and the first calculation data is stored in the storage module as attribute information of the graph data used in training.
8. The system according to any one of claims 3 to 7, characterized in that: The interaction module is further configured to receive configuration information set by a second user for the second graph data, where the configuration information is used to indicate information that needs to be recorded in the second graph data; The processing module is used to determine the target information missing from the second graph data based on the configuration information.
9. The system according to claim 8, wherein The configuration information is used to indicate the type of information that needs to be recorded in the second graph data, and the type indicates one or more of the following: the identifier of the entity, the attribute information of the entity, the relationship between different entities, or the attribute information of the relationship.
10. A query method for a graph database system, characterized in that: The method is applied to a graph database system, and the graph database method includes: receiving a data query request sent by a first user, wherein the data query request indicates querying a specified event in the graph database system; Based on the data query request, obtaining first graph data related to the specified event, the first graph data being graph data obtained by supplementing missing information from the second graph data, the second graph data being obtained by searching graph data stored in the graph database system based on the data query request, the graph data being used to indicate multiple entities and relationships between different entities; A response to the data query request is fed back to the first user based on the first graph data, where the response carries data that matches the specified event.
11. The method according to claim 10, wherein The response also carries the probability that the data corresponds to the specified event.
12. The method according to claim 10 or 11, characterized in that The acquiring, based on the data query request, first graph data related to the specified event, includes: Based on the data query request, obtaining the second graph data related to the specified event and target information missing from the second graph data; obtaining a value of the target information based on an association between the second graph data, the target information, and the specified event; and adding the value of the target information to the second graph data to obtain the first graph data; The target information is used to indicate one or more of the following: the identifier of the entity, the attribute information of the entity, the relationship between different entities, or the attribute information of the relationship.
13. The method according to claim 12, wherein: The acquiring the value of the target information based on the association relationship between the second graph data, the target information and the designated event includes: Based on the second graph data and the target information, a pre-trained machine learning model is used to predict the value of the target information.
14. The method according to claim 13, wherein The predicting the value of the target information using a pre-trained machine learning model based on the second graph data and the target information includes: Obtain first calculation data pre-calculated by the pre-trained machine learning model, and use the pre-trained machine learning model to predict the value of the target information based on the first calculation data, the second graph data and the target information.
15. The method according to claim 14, wherein The machine learning model includes a deep learning model, the first calculation data is a calculation result of an embedding layer of a pre-trained deep learning model based on the graph data used in training, and the first calculation data is stored as attribute information of the graph data used in training.
16. The method according to any one of claims 12 to 15, characterized in that: The method further comprises: receiving configuration information set by a second user for the second graph data, the configuration information being used to indicate information that needs to be recorded in the second graph data; The acquiring of target information missing from the second graph data includes: Based on the configuration information, the target information missing from the second graph data is determined.
17. The method according to claim 16, wherein The configuration information is used to indicate the type of information that needs to be recorded in the second graph data, and the type indicates one or more of the following: the identifier of the entity, the attribute information of the entity, the relationship between different entities, or the attribute information of the relationship.
18. A computing device cluster, characterized in that: It includes multiple computing devices, each of which includes multiple processors and multiple memories. Program instructions are stored in the multiple memories, and the multiple processors run the program instructions, so that the computing device cluster implements the graph database system described in any one of claims 1 to 9.
19. A computer-readable storage medium, characterized in that The method comprises program instructions, which, when executed on a computing device, enable the computing device to implement the graph database system according to any one of claims 1 to 9.
20. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster implements the graph database system described in any one of claims 1 to 9.