Graph database system and query method thereof
By automatically completing missing information in the graph database system and using pre-trained machine learning models to generate complete graph data, the query accuracy problem caused by missing information in the graph database is solved, and the accuracy of query results and user experience are improved.
Patent Information
- Application Number
- CN202410532715.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-03-07
- Filing Date
- 2024-04-29
- Publication Date
- 2025-09-09
AI Technical Summary
Existing graph databases have information missing problems, resulting in poor query accuracy and the inability to return all the query results expected by users.
A graph database system is provided, including an interaction module and a processing module, which automatically completes missing information in graph data, obtains missing information through a pre-trained machine learning model through a prediction module, and generates complete graph data to improve query accuracy.
It improves the accuracy of graph database query results and user trust, reduces query overhead, and enhances system usability and user stickiness.
Smart Images

Figure CN120611064A_ABST
Abstract
Description
[0001] This application claims priority to Chinese patent application No. 202410263169.X, filed on March 7, 2024, entitled “A Graph Data Query Method, Apparatus, and Computing Device Cluster,” the entire contents of which are incorporated herein by reference. 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] Figure 1 This is a schematic diagram of graph data provided by an embodiment of the present application;
[0031] Figure 2 This is a schematic diagram of another type of graph data provided in an embodiment of the present application;
[0032] Figure 3 This 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] Figure 4This is a structural diagram of another implementation scenario involving a graph database system and a query method thereof provided in an embodiment of the present application;
[0034] Figure 5 This is a schematic diagram of a basic resource deployment method in a data center provided by an embodiment of the present application;
[0035] Figure 6 This is a structural diagram of a graph database system provided in an embodiment of the present application;
[0036] Figure 7 This is a schematic diagram of the structure of another graph database system provided in an embodiment of the present application;
[0037] Figure 8 This is a structural diagram of another graph database system provided in an embodiment of the present application;
[0038] Figure 9 This is a structural diagram of another graph database system provided in an embodiment of the present application;
[0039] Figure 10 This is a schematic diagram of a data query process provided by an embodiment of the present application;
[0040] Figure 11 This is a schematic diagram of a query plan tree provided in an embodiment of the present application;
[0041] Figure 12 is a schematic diagram of a training process provided in an embodiment of the present application;
[0042] Figure 13 is a schematic diagram of a query plan tree for training provided in an embodiment of the present application;
[0043] Figure 14 This is a flowchart of a query method for a graph database system provided by an embodiment of the present application;
[0044] Figure 15 This is a flowchart of another query method for a graph database system provided in an embodiment of the present application;
[0045] Figure 16 is a structural diagram of a computing device provided in an embodiment of the present application;
[0046] Figure 17 This is a schematic diagram of the structure of a computing device cluster provided in an embodiment of the present application;
[0047] Figure 18 This 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 This is a schematic diagram of a graph indicating employee information provided in an embodiment of the present application. Figure 1 The graph shown consists of four vertices and five edges. The four vertices represent 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 in Location D. Figure 2 This is a schematic diagram of a graph indicating social relationships provided in an embodiment of the present application. Figure 2The graph shown consists of 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 of the vertex representing Xiao Zhang indicates that the probability that Xiao Zhang is a potential customer of the specified product and the probability that he is a high net worth customer are unknown, that is, Figure 2 {buyer:null,rich:null}. The attribute information of the vertex representing Xiao Li indicates that Xiao Li is likely to be a potential customer of the specified product, but the probability that Xiao Li is a high-net-worth customer is unknown, that is, Figure 2 {buyer:true,rich:null}. The attribute information of the vertex representing Xiao Wang indicates that the probability that Xiao Wang is a potential customer of the specified product and the probability that he is a high-net-worth customer are unknown, that is, Figure 2 {buyer:null,rich:null}. The attribute information of the vertex representing small O indicates that the probability that small O is a potential customer of the specified product is unknown, and small O is likely to be a high-net-worth customer, that is, Figure 2 {buyer:null,rich:true}. The attribute information of the vertex representing small N indicates that the probability that small N is a potential customer of the specified product and the probability that it is a high-net-worth customer are unknown, that is, 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] Corresponding to Figure 1 The graph data shown, Figure 1 The solid edges in the graph are present in the data, while the dashed edges are missing from the graph. Assume that a user wants to find people living in location D based on the 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 Figure 2 The graph data shown, Figure 2 The attribute information indicated as unknown in the graph is missing information in the graph data. Suppose 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 This 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. Figure 3As shown, 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 the embodiment of the present application. The client 20 can establish a communication connection with the one or more computing devices 10. For example, a communication connection can be established between the client 20 and the 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 computing device clusters are implemented through cloud computing service centers, such as Figure 4As shown, the implementation scenarios involved in a graph database system and its query method provided by an embodiment of the present application include: 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 by 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. Figure 4 As shown, data center 1 includes a cloud management platform and infrastructure ( Figure 4 (not shown in the figure). 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, and the server can process the cloud service request and related information, and provide cloud services to tenants based on the processed cloud service request 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 an 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] exist Figure 4In the illustrated implementation scenario, multiple servers are deployed in a data center. The servers consist of a hardware layer and a software layer. The hardware layer comprises the typical server configuration. The hardware layer includes 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 a virtual machine is referred to as the host operating system. The host operating system runs a virtual machine manager (also known as a hypervisor). The role of the virtual machine manager is to implement compute virtualization, network virtualization, and storage virtualization for the virtual machines, and to manage the virtual machines.
[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, Figure 5As shown, the location of basic resources in the data center can be described by cloud resource deployment regions (regions) and availability zones (AZs). Tenants can choose to deploy cloud services based on resources in specific regions and AZs. Among them, regions are divided based on geographical location and network latency. Using the same resource pool in the same region can be understood as sharing public services such as elastic computing, block storage, object storage, virtual private cloud (VPC) network, elastic internet protocol (EIP) address and mirroring. Regions are divided into general regions and dedicated regions. A general region refers to a region that provides general cloud services to public tenants. A dedicated region refers to a dedicated region that carries the same type of business or provides business services to specific tenants. A region usually includes multiple AZs. Multiple AZs in a region are connected by high-speed optical fibers to meet the needs of tenants to build high-availability systems across AZs. An AZ is one or more Figure 5 The computing, network, 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 method of the graph database system provided in the embodiment of this application. Figure 6 This is a structural diagram of a graph database system provided by an embodiment of the present application. Figure 6 As shown, 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 the 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. 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. The data query request indicates to query the specified event 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. Among them, the graph data being related to the specified event means that the query result of the specified event is recorded in the graph data. For example, assuming that the graph database system 60 records Figure 1 and Figure 2 As shown in the graph data, when the data query request indicates that the specified event to be queried is a possible high-net-worth customer and a potential customer who may purchase a specified product, due to Figure 2 The graph data shown contains the query results for the specified event. Figure 1 The graph data shown does not record the query result of the specified event, so the processing module 602 can determine Figure 2 The graph data shown 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 items recording query results for a specified event. In this case, the multiple graph data items recording query results for the specified event are all second graph data items. Accordingly, the processing module 602 can obtain multiple first graph data items that correspond one-to-one with the multiple second graph data items. Each first graph data item is the graph data item after the corresponding second graph data item 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 of multiple entities in the complete graph is that multiple entities have browsed the products of the brand. When a data query request indicates to query potential customers who may purchase a certain product of the brand, the information of customers who have browsed the product can be determined in the complete graph based on the data query request, and the obtained Figure 2 The subgraph shown. In this case, the sub-attribute of the multiple entities in the subgraph is: multiple entities have browsed a specific product of the brand. It should be noted that the above is only an example of the attributes corresponding to the complete graph and subgraph. The complete graph and subgraph can also have other attributes, which are not listed 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 to query possible high-net-worth customers and potential customers who may purchase a specified product, Figure 2 The query result of the graph data shown in the figure 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] f:Person{rich:true} Probability Xiao Li 1 Xiao Zhang 0.7656757 Xiao Wang 0.202511 Little N 0.31452 Little O 1
[0090] Table 2
[0091] v:Person{buyer:true} Probability Xiao Li 1 Xiao Zhang 0.8656757 Xiao Wang 0.1231242 Little N 0.4251211 Little O 0.7546752
[0092] 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, Figure 7 As shown, the graph database system 60 further includes a storage module 603. The storage module 603 is used to store graph data. After receiving a data query request, the processing module 602 may first obtain second graph data related to the specified event from the storage module 603 based on the specified event indicated in the data query request.
[0093] 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.
[0094] 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 is no edge connecting two vertices in the second graph data, but the relationship between the entities indicated by the two vertices indicates that there is an association between the two entities, the target information indicating that the second graph data is missing includes: the edge between the two vertices needs to be supplemented for the second graph data. When there is no attribute information recorded for the edge between two vertices in the second graph data, the target information indicating that the second graph data is missing includes: the attribute information of the edge between the two vertices needs to be supplemented for the second graph data. For example, assuming that the second graph data determined by the processing module 602 based on the data query request is Figure 2 The configuration information of the graph data indicates that the information 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 a specified product, as well as the social relationship between the query objects who have browsed the specified product. The processing module 602 can determine based on the configuration information Figure 2 The graph shown is missing 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 the specified product; 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 the specified product; the vertex indicating Xiao N lacks the attribute information of whether he is a high net worth person and a potential customer who purchases the specified product; the vertex indicating Xiao O lacks the attribute information of whether he is a potential customer who purchases the specified product. These missing information are Figure 2 The target information of the graph data shown is missing. It should be noted that the configuration information may be part of the information actually missing from the graph data. In this case, 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 missing from the graph data. For example, Figure 2The graph data shown actually 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 Figure 2 The data shown in the figure is missing information.
[0095] 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.
[0096] 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:
[0097] [Create|Drop]ML Index on([node selection query|edge selection query]{property selection query}), is used to indicate the construction or deletion of some attribute information of some vertices or edges in the graph data. When the DDL indicates the construction of some 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 nodeselection 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 that the attribute information of whether the person is the buyer of the specified product and whether the person is rich is constructed on all vertices indicating the person.
[0098] [Create|Drop]ML Edge on((node selection query 1)-[:`edgeName`]->(nodeselection query 2)) is used to instruct to construct or delete 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 instructs to construct 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. In this case, 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 that an edge is constructed between all vertices indicating Person, indicating whether the Person indicated by the vertex knows each other (Know).
[0099] 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.
[0100] In a possible implementation, the operation of completing the second image data can be obtained by prediction. The prediction process can be performed by the processing module 602, or by calling other modules by the processing module 602. For example, Figure 7 As shown, the graph database system 60 also includes a prediction module 604. The processing module 602 can call this prediction module 604 to complete the second graph data to obtain the first graph data. That is, after obtaining the second graph data and its missing target information based on the data query request, the processing module 602 is configured to provide the second graph data and target information to the prediction module 604. After obtaining the second graph data and target information, the prediction module 604 is configured to predict the value of the target information based on the association between the second graph data, the target information, and the specified event indicated by the data query request. The prediction module 604 then adds the predicted target information value to the second graph data to obtain the first graph data, and then provides 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 event in the second graph data to determine the association between various data, target information, and the specified event in the second graph data. Based on this association, the prediction module 604 predicts the value of the target information. The prediction module then completes the second graph data based on the predicted target information value to obtain the first graph data.
[0101] 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.
[0102] Among them, when the prediction module 604 is implemented by the deep learning model, the output of the deep learning model also includes the confidence of the value of the target information. The confidence of the value of any target information indicates the credibility of the value of the target information. Then, when the query result of the data query request is obtained based on the first graph data provided by the prediction module 604, the probability that the entity involved in the query result meets the specified event can also be obtained based on the confidence. For example, continuing with the previous Figure 2 Taking the graph data shown as an example, it is assumed 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.
[0103] 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.
[0104] 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 on it 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, Figure 8As shown, the graph database system 60 includes a graph data storage module 6031 and a computational data storage module 6032. The graph data storage module 6031 is used to store graph data, and the computational data storage module 6032 is used to store first computational data. After storing the first computational data, the computational data storage module 6032 may also store metadata and other related data of the first computational 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 from the graph data storage module 6031, and based on the related data, obtain the first computational data indicated by the related data from the computational data storage module 6032.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] 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.
[0109] It can be seen from this that the graph database system 60 of the present application can be implemented by multiple components. Figure 9 for Figure 8 The diagram of the graph database system 60 shown in FIG. Figure 9 As shown, the interaction module 601 is also called the graph query interface, which is responsible for connecting with the user and providing the user with the graph query capability. For example, the interaction module 601 is used to receive a data query request sent by a first user and feedback a response to the data query request to the first user. The processing module 602 includes a parsing unit 6021, an optimization unit 6022 and a processing unit 6023. The parsing unit is used to receive the data query request provided by the interaction module 601, such as Figure 10Then, the user's data query request is parsed into an abstract syntax tree and the abstract syntax tree is provided to the optimization unit, such as Figure 10 The optimization unit is used to convert the abstract language tree into a query plan tree, optimize the query plan tree as needed, and provide the optimized query plan tree to the processing unit, such as Figure 10 Step ③ in the above. The processing unit is used to query the relevant points and edges from the graph data storage module 6031 according to the query plan tree, such as Figure 10 Step ④ in the diagram. The graph data storage module 6031 provides the relevant points and edges to the processing unit, such as 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, such as Figure 10 Step ⑥ in the above. The processing unit obtains the points and edges from the graph data storage module 6031 to form the second graph data. After the prediction module 604 obtains the second graph data provided by the processing unit, it complements 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, such as 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, such as Figure 10 If the calculation data storage module 6032 stores the first calculation data, the prediction module 604 may first obtain the first calculation data from the calculation data storage module 6032 when completing the second graph data. Figure 10 The calculation data storage module 6032 provides the first calculation data to the prediction module 604. Figure 10 After the prediction module 604 obtains the first calculation data, it then completes the second graph data based on the first calculation data. Figure 10 The step sequence is used to indicate the execution order of the corresponding steps, and the step with the smaller number is executed first.
[0110] For example, assuming that the machine learning model is a GCN model, we still face the same Figure 2 Take the query of as an example, when the data query request indicates that the specified event to be queried is whether Xiao Li is a high net worth customer, Figure 11 A diagram of the query plan tree generated for a processing unit. Figure 11 As shown, the query plan tree includes two branches, namely Figure 11 The left branch of the Union operator is fed from the left, and the right branch of the Union operator is fed from the right. The root node of the left branch indicates: first, obtain all the vertices and edges between the vertices indicating Xiao Li from the graph data storage module 6031. This function is achieved through Figure 11The NodeByPropertyScan(x.name=Xiao Li) operator is implemented in the NodeByPropertyScan(x.name=Xiao Li) operator. The first-level child node of the root node indicates to select all vertices whose attribute information indicating whether they are high net worth individuals is true from all the obtained vertices. This function is implemented by Figure 11 The Filter(x.rich!=null&x.rich=true) operator is implemented. The root node of the right branch indicates: first, all vertices indicating Xiao Li and the edges between vertices are obtained from the graph data storage module 6031. This function is implemented by Figure 11 The NodeByPropertyScan(x.name=Xiao Li) operator is implemented in the NodeByPropertyScan(x.name=Xiao Li) operator. The first-level child node of the root node indicates to select all vertices whose attribute information indicating whether they are high-net-worth individuals is unknown from all the acquired vertices. This function is implemented by Figure 11 The second-level child node of the root node (i.e., the child node of the first-level child node) indicates to obtain all vertices and edges within two hops of the selected vertex from the graph data storage module 6031, and obtain the second graph data based on all vertices and edges obtained from the graph data storage module 6031. This function is implemented by Figure 11 The ExpandAsSubgraph(x,2) operator is implemented in . Any vertex within two hops refers to the vertex that can be reached by taking the 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 (that is, 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 the attribute information of all unknown values indicating whether they are high-net-worth individuals 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 achieved through 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 Figure 11 The Filter(x.rich=ture) operator is implemented in the following example: 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 results to the interaction module 601 based on the aggregated result.
[0111] 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.
[0112] Similar to the query process of the graph database system 60, the processing module 602 may also pre-process the data query request for training, and then perform subsequent training operations based on the pre-processed data. For example, when the function of the processing module 602 is implemented by the parsing unit, the optimization unit and the processing unit, the parsing unit is used to obtain the data query request for training provided by the interaction module 601, such as Figure 12 Then, the data query request used for training of text representation is parsed and the parsing result is provided to the optimization unit, such as Figure 12 The parsing result is used to indicate the information that should be recorded in the graph data of the data query request used for training, that is, the parsing result indicates the configuration information corresponding to the data query request used for training. The optimization unit is used to generate the operation flow that needs to be executed for the data query request used for training based on the parsing result, and provide the operation flow to the processing unit, such as Figure 12 Step ③ in the processing unit is used to obtain the second graph data indicated by the data query request for training from the graph data storage module 6031 based on the operation flow, such as Figure 12 Step ④ in the diagram. The graph data storage module 6031 provides the relevant points and edges to the processing unit, such as Figure 12 Step ⑤ in the above. When the processing unit obtains the second graph data from the storage module 603, it can sequentially obtain the data in 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, such as Figure 12 Step ⑥ in the above. The processing unit obtains the points and edges from the graph data storage module 6031 to form the second graph data. After the prediction module 604 obtains the second graph data provided by the processing unit, it complements 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, such as Figure 12After completing the multiple sub-training processes, the processing module 602 may calculate the first calculation data obtained from the trained machine learning model for each training graph data, and store the first calculation data in the calculation data storage module 6032, such as Figure 12 After storing the first calculation data, the calculation data storage module 6032 may store the metadata and other related data of the first calculation data in the graph data storage module 6031, such as Figure 12 Step 9 in the above. Figure 12 The step sequence is used to indicate the execution order of the corresponding steps, and the step with the smaller number is executed first.
[0113] For example, assuming that the machine learning model is a GCN model, we still face the same Figure 2 Take the query of as an example, when the data query request used for training indicates that the specified event of the query is a possible high net worth customer, Figure 13 Schematic diagram of the query plan tree generated for the processing unit for training. Figure 13 As shown, the root node of the query plan tree indicates: first, obtain all the vertices indicating people and the edges between the vertices from the graph data storage module 6031. This function is achieved through Figure 13 The first-level child node of the root node indicates that all vertices and edges within two hops of all vertices obtained from the root node are obtained from the graph data storage module 6031, and the second graph data (i.e., subgraph) is obtained based on all vertices and edges obtained from the graph data storage module 6031. Figure 13 The second-level child node of the root node (i.e., the child node of the first-level child node) instructs the processing unit to call the interface of the prediction module 604 to train the GCN model. During the training process, the GCN model needs to predict the attribute information of all unknown values indicating whether they are high-net-worth individuals based on the second graph data, and record the prediction results in the second graph data to obtain the first graph data, and provide the first graph data to the processing unit. This function is achieved through 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 result (i.e., the first calculation data) of the embedding layer of the GCN model based on the graph data used for training from the prediction module 604, and then stores the first calculation data in the calculation data storage module 6032. After storing the first calculation data, the calculation data storage module 6032 can store the metadata of the first calculation data and other related data in the graph data storage module 6031. The function of obtaining the first calculation data is achieved through Figure 13The fourth-level child node of this root node (i.e., the child node of the third-level child node) refers to the GCN model that has completed training. This function is implemented by Figure 13 StoreModel operator implementation in .
[0114] 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.
[0115] 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 This is a flowchart of a query method for a graph database system provided by an embodiment of the present application. Figure 14 As shown, the query method of the graph database system includes the following steps:
[0116] 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.
[0117] The implementation process of step 1401 refers to the relevant description in the previous graph database system and will not be repeated here.
[0118] 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.
[0119] 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.
[0120] 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.
[0121] 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.
[0122] In one possible implementation, Figure 15 As shown, the method also includes: step 1404, receiving configuration information set by the second user for the second graph data, the configuration information is used to indicate the information that needs to be recorded in the second graph data. Accordingly, obtaining the 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. Among them, 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.
[0123] The implementation process of step 1402 refers to the relevant description in the previous graph database system and will not be repeated here.
[0124] 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.
[0125] 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.
[0126] 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.
[0127] 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.
[0128] 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.
[0129] 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.
[0130] 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.
[0131] 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.
[0132] 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.
[0133] 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.
[0134] 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.
[0135] The following is an example of the basic hardware structure involved in the embodiments of the present application.
[0136] The present application also provides a computing device 1600. Figure 16 As shown, 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.
[0137] The bus 1602 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 16The fact that only one line is used in the figure does not mean that there is only one bus or only one type of bus. The bus 1602 may include a path for transmitting information between various components of the computing device 1600 (eg, memory 1606, processor 1604, communication interface 1608).
[0138] 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).
[0139] 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).
[0140] 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.
[0141] 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.
[0142] 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.
[0143] like Figure 17As shown, 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.
[0144] 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.
[0145] 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.
[0146] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network, which may be a wide area network or a local area network. Figure 18 A possible implementation is shown. Figure 18 As shown, two computing devices 1600A and 1600B are connected via a network. Specifically, the connection to the network is achieved through a communication interface within each computing device. In this possible implementation, the memory 1606 within computing device 1600A stores instructions for executing the functions of interaction module 601 and processing module 602. Simultaneously, the memory 1606 within computing device 1600B stores instructions for executing the functions of storage module 603 and prediction module 604.
[0147] Figure 18 The connection method between the computing device clusters shown can be based on the fact that the query method of the graph database system provided in this application requires a large amount of data storage, so 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.
[0148] It should be understood that Figure 18 The functionality of the computing device 1600A shown in FIG. 1 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.
[0149] The present application embodiment also provides another computing device cluster. The connection relationship between the computing devices in the computing device cluster can be similarly referred to as Figure 17 and Figure 18 The connection mode of the computing device cluster is different in that the memory 1606 of 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.
[0150] 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.
[0151] 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.
[0152] 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.
[0153] 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.
[0154] 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.
[0155] 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.
[0156] 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.
[0157] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention 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 various embodiments of the present invention.
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, wherein: 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.
Citation Information
Cited By
Object operation processing method, device and equipment
CN122132608A
Methods, apparatus and equipment for handling object operations
CN122132608B