A query method, device and equipment of an attribute graph

By introducing extended attribute information and an extended database, the query results of attribute graphs are dynamically expanded, which solves the problem that attribute graph querying is limited by graph databases and realizes more flexible data expression and heterogeneous data fusion.

CN115391378BActive Publication Date: 2026-04-14ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
Filing Date
2022-09-06
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing attribute graph query methods are limited by graph databases, making it difficult to expand nodes, edges, and attributes. This restricts the flexibility of data use and the integration of heterogeneous data. Furthermore, modifying attributes has a significant impact and a high learning cost.

Method used

By introducing extended attribute information and combining the extended database with the graph database, the query results of the attribute graph are dynamically extended, enabling the modification and expansion of entity attribute information in the graph database and the unified processing of query results.

Benefits of technology

It expands the data representation capabilities of attribute graphs, reduces system impact, enhances the flexibility of data use and the ability to integrate heterogeneous data, and simplifies the query process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115391378B_ABST
    Figure CN115391378B_ABST
Patent Text Reader

Abstract

The embodiment of the specification discloses a kind of attribute graph query method, device and equipment, the method comprises: obtaining the query request of target attribute graph initiated by target user, based on the identification of target attribute graph, the attribute information of entity contained in target attribute graph is obtained from graph database, if the attribute information of entity contained in target attribute graph exists the attribute information of first entity matched with the extended attribute information in extension database, the first extended attribute information matched with the attribute information of first entity is obtained, and the attribute information of first entity is replaced using first extended attribute information, extended attribute information includes one or more of the following information: the information for modifying attribute information, the information for content expansion to the information of entity, the information for content expansion to graph database;The attribute information of entity contained in the target attribute graph after replacement is provided as query result to target user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of computer technology, and in particular to a method, apparatus, and device for querying attribute graphs. Background Technology

[0002] With the development of internet technology, the need to discover correlations in massive amounts of data has become increasingly urgent, and graph-based data analysis is gaining popularity. Currently, there are two main graph data structure models: attribute graphs and RDF graphs, with attribute graphs being the more commonly used graph data model in engineering practice.

[0003] Typically, in the query process of an attribute graph, the attribute graph has a schema definition based on business abstraction. Based on this schema definition, structured or unstructured data can be processed into node, edge, and attribute information that conforms to the schema definition constraints, and this information can be stored in a graph database. When a user queries an attribute graph, they use a query language and, based on the schema information defined above, retrieve the required attribute graph data from the graph database. However, this query method requires the data to be queried to be stored in the graph database beforehand. Therefore, when querying data in an attribute graph, the query results must all come from the graph database containing the attribute graph. This query mode limits the use of other data sources outside the attribute graph. Moreover, modifying a certain attribute becomes very difficult. Therefore, a technical solution is needed that can better extend the nodes, edges, and attributes in the attribute graph, thereby overcoming the limitation of the nodes, edges, and attributes in the attribute graph query results being restricted by the graph database, and expanding the expressive power of the attribute graph from the perspective of data heterogeneity. Summary of the Invention

[0004] The purpose of the embodiments in this specification is to provide a technical solution that can better extend the nodes, edges, and attributes in the attribute graph, thereby getting rid of the limitation of the nodes, edges, and attributes in the attribute graph query results being restricted by the graph database, and expanding the expressive power of the attribute graph from the perspective of data heterogeneity.

[0005] To achieve the above technical solution, the embodiments in this specification are implemented as follows:

[0006] This specification provides an embodiment of a method for querying an attribute graph. The method includes: obtaining a query request for a target attribute graph initiated by a target user, the query request including an identifier of the target attribute graph; obtaining attribute information of entities contained in the target attribute graph from a graph database containing the identifier of the target attribute graph, the entities including nodes and / or edges; if the obtained attribute information of the entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in a pre-configured extended database, then obtaining the first extended attribute information that matches the attribute information of the first entity, and replacing the attribute information of the first entity with the first extended attribute information to obtain the replaced attribute information of the entities contained in the target attribute graph, the extended attribute information including one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the information of the entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database; using the replaced attribute information of the entities contained in the target attribute graph as the query result corresponding to the query request, and providing the query result to the target user.

[0007] This specification provides an embodiment of an attribute graph query device, comprising: a query request module for acquiring a query request for a target attribute graph initiated by a target user, the query request including an identifier of the target attribute graph; an attribute acquisition module for acquiring attribute information of entities contained in the target attribute graph from a graph database containing the identifier of the target attribute graph, the entities including nodes and / or edges; and an attribute replacement module for acquiring first extended attribute information matching the attribute information of the first entity in the acquired attribute information of the entities contained in the target attribute graph, and replacing the attribute information of the first entity with the first extended attribute information to obtain the replaced attribute information of the entities contained in the target attribute graph, the extended attribute information including one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the information of the entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. The query result output module takes the attribute information of the entities contained in the replaced target attribute graph as the query result corresponding to the query request and provides the query result to the target user.

[0008] This specification provides an attribute graph query device, comprising: a processor; and a memory arranged to store computer-executable instructions, wherein the executable instructions, when executed, cause the processor to: obtain a query request for a target attribute graph initiated by a target user, the query request including an identifier of the target attribute graph; based on the identifier of the target attribute graph, obtain attribute information of entities contained in the target attribute graph from a graph database containing the identifier of the target attribute graph, the entities including nodes and / or edges; if the obtained attribute information of entities contained in the target attribute graph contains attribute information of a first entity that matches extended attribute information in a pre-configured extended database, then obtain first extended attribute information matching the attribute information of the first entity, and replace the attribute information of the first entity with the first extended attribute information to obtain the replaced attribute information of entities contained in the target attribute graph, the extended attribute information including one or more of the following: information for modifying the attribute information of entities contained in the target attribute graph in the graph database, information for expanding the content of the information of entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. The attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the query request, and the query result is provided to the target user.

[0009] This specification also provides a storage medium for storing computer-executable instructions. When executed by a processor, these instructions implement the following process: obtaining a query request for a target attribute graph initiated by a target user, the query request including an identifier of the target attribute graph. Based on the identifier of the target attribute graph, obtaining attribute information of entities contained in the target attribute graph from a graph database containing the identifier of the target attribute graph, the entities including nodes and / or edges. If the obtained attribute information of entities contained in the target attribute graph contains attribute information of a first entity that matches extended attribute information in a pre-configured extended database, then obtaining first extended attribute information matching the attribute information of the first entity, and replacing the attribute information of the first entity with the first extended attribute information to obtain the replaced attribute information of entities contained in the target attribute graph. The extended attribute information includes one or more of the following: information for modifying the attribute information of entities contained in the target attribute graph in the graph database, information for expanding the content of the information of entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. The attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the query request, and the query result is provided to the target user. Attached Figure Description

[0010] To more clearly illustrate the technical solutions in the embodiments or prior art of this specification, the drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is an embodiment of a method for querying attribute graphs as described in this specification;

[0012] Figure 2 This is a schematic diagram of a query page for an attribute diagram in this specification;

[0013] Figure 3 This is another embodiment of the attribute graph query method in this specification;

[0014] Figure 4 This is a schematic diagram illustrating the attribute extension of an attribute graph as described in this specification.

[0015] Figure 5 This is an embodiment of an attribute graph query device described in this specification;

[0016] Figure 6 This is an embodiment of an attribute graph query device described in this specification. Detailed Implementation

[0017] This specification provides an embodiment of a method, apparatus, and device for querying attribute graphs.

[0018] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0019] Example 1

[0020] like Figure 1As shown in the embodiments of this specification, a method for querying attribute graphs is provided. The execution subject of this method can be a terminal device or a server. The terminal device can be a mobile phone, tablet computer, or a computer device such as a laptop or desktop computer, or an IoT device (specifically, a smartwatch, in-vehicle device, etc.). The server can be a single server or a server cluster composed of multiple servers. The server can be a backend server for financial services or online shopping services, or a backend server for an application. This embodiment uses a server as an example for detailed description. For the execution process of the terminal device, please refer to the relevant content below, which will not be repeated here. The method specifically includes the following steps:

[0021] In step S102, a query request for the target attribute graph initiated by the target user is obtained, and the query request includes the identifier of the target attribute graph.

[0022] The target user can be any user; in this embodiment, the target user can be the user who initiates the attribute graph query. The target attribute graph can be any attribute graph that the target user needs to query. The attribute graph can be a graph data model, a directed graph composed of vertices, edges, and properties. Vertices can also be called nodes, and edges can be called relationships. Properties can be defined by the user on the nodes and edges. Each property is a custom key-value pair, such as name:zhangsan, where "name" is the attribute key and "zhangsan" is the attribute value. The identifier of the target attribute graph can be its name or code, etc., which can be set according to the actual situation.

[0023] In practice, with the development of internet technology, the need to discover correlations in massive amounts of data has become increasingly urgent, and graph-based data analysis is gaining popularity. Currently, the main graph data structure models are attribute graphs and RDF graphs, with attribute graphs being the more commonly used graph data model in engineering practice.

[0024] Typically, in the query process of a property graph, the property graph has a schema definition based on business abstraction (i.e., the schema of the property graph refers to the metadata of the property graph, used to describe the basic information of nodes and edges, such as node type, edge type, attribute identifier, attribute type, etc. The schema of the property graph is an abstraction of entities, relationships, and characteristics in the actual business concept, and can also be designed according to the business scenario). Based on this schema definition, structured or unstructured data can be processed into node, edge, and attribute information that conforms to the schema definition constraints, and can be stored in a graph database. When a user queries a property graph, the query language is used, and according to the schema information defined above, the required property graph data is retrieved from the graph database. However, the above query method requires the data to be queried to be stored in the graph database in advance. Thus, when querying data in the property graph, the query results must all come from the graph database where the property graph resides. This query mode limits the use of other data sources outside the property graph. Moreover, it is very difficult to modify a certain attribute if needed. Specifically, modifying attribute logic often requires adjusting the pre-construction chain of the attribute graph, potentially involving modifications and releases of the entire construction chain, with a significant impact. Furthermore, the range of usable data for attribute graphs is limited; specifically, the data in an attribute graph depends entirely on its pre-construction process. During the construction environment, data barriers may exist due to environmental and systemic limitations, hindering the full utilization of heterogeneous data sources to obtain complex attribute graph properties. Additionally, there are difficulties in calculating derived graph attributes. Typically, complex attribute graph query functions are used in the query request statement for expression, but the combination of atomic attribute graph query functions is limited, resulting in a high learning curve for users. Therefore, a technical solution is needed to better extend the nodes, edges, and attributes in attribute graphs, thereby overcoming the limitations of graph databases on the nodes, edges, and attributes in attribute graph query results and expanding the expressive power of attribute graphs from the perspective of data heterogeneity. This specification provides an achievable technical solution, which may include the following:

[0025] To enable users to query attribute graphs, this embodiment improves the existing query system by introducing a special type of attribute into the attribute graph. When querying the attribute graph, the data of this type of attribute graph is processed uniformly, ultimately achieving dynamic expansion of the attributes of the static attribute graph. Specifically, for example... Figure 2As shown, when a user (i.e., the target user) needs to query a certain attribute graph, they can use the corresponding query device to open the corresponding query system. At this time, the query device can obtain and display the query page. The query page can include information input boxes for entering keywords or key words, as well as query and cancel buttons. The target user can enter the query keywords or key words into the information input boxes. Specifically, they can enter the identifier of the target attribute graph, or other information related to the target attribute graph. After entering the information, they can click the query button. At this time, the query device can obtain the information entered by the target user and use it to generate a query request for the target attribute graph. The query device can send the query request for the target attribute graph to the server, and the server can obtain the query request for the target attribute graph initiated by the target user.

[0026] It's important to note that querying information about nodes, edges, and other related data in a property graph involves two methods: procedural queries and declarative queries. Procedural queries are exemplified by Gremlin queries, which can use functional or dataflow languages ​​and require a query language to describe the query process. Declarative queries are exemplified by Neo4j's Cypher query, which focuses on the query target rather than the process, reducing the complexity of the query language. Both methods require data that conforms to the property graph schema definition; that is, the data needs to be pre-constructed based on the property graph schema and stored in the graph database. This approach ensures data consistency and simplifies query statements. The query request initiated by the target user for the target property graph can also be either a procedural or declarative query, allowing the retrieval of relevant data from the graph database.

[0027] In step S104, based on the identifier of the target attribute graph, the attribute information of the entities contained in the target attribute graph is obtained from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges.

[0028] The graph database can be the database mentioned above used to store relevant data for attribute graphs. The graph database may include relevant data for one or more different attribute graphs, including information about each entity in the attribute graph (such as entity identifiers and types) and attribute-related information (attribute identifiers and types), etc. The specific details can be set according to actual conditions, and this embodiment does not limit this. Entities may include nodes and / or edges in the attribute graph. Attribute information may include entity identifiers, types, relationship information between entities, and characteristics, etc., and the specific details can be set according to actual conditions.

[0029] In implementation, the above query requests can be analyzed to extract the identifier of the target attribute graph. Then, based on the identifier of the target attribute graph, the attribute information of the nodes and / or edge attributes contained in the target attribute graph can be obtained from the graph database. In this way, the target attribute graph can be queried by using the attribute graph query language corresponding to the procedural query or declarative query method to obtain the original node data and / or edge data in the target attribute graph.

[0030] In step S106, if the attribute information of the entities contained in the acquired target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then the first extended attribute information that matches the attribute information of the first entity is acquired, and the attribute information of the first entity is replaced with the first extended attribute information to obtain the attribute information of the entities contained in the target attribute graph after replacement. The extended attribute information includes one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the entity information contained in the target attribute graph in the graph database, and information for expanding the content of the graph database.

[0031] The extended database can be a different database from the graph database described above. It can be a database formed by expanding the content of the graph database, and the data in the extended database can be modified data from the graph database or expanded data from the graph database. The first entity can include nodes and / or edges, etc., and can be specifically set according to actual conditions; this specification does not limit this in the embodiments.

[0032] In practice, under the above query method, if richer data is to be integrated into the attribute graph, the data needs to be stored in the graph database in advance and retrieved from the graph database during the query. This results in high costs associated with changing the data logic and limits the flexibility of data use in the attribute graph. This embodiment improves the attribute graph query mechanism by introducing a special type of attribute in the attribute graph. When querying the attribute graph, the data of this type of attribute graph is processed uniformly, ultimately achieving dynamic expansion of static attribute graph attributes. Specifically, an extended attribute execution module and an extended attribute configuration module can be set. The extended attribute configuration module can be used to expand the schema of the attribute graph and stores the metadata of the extended attributes, which may include, for example, the content of the extended attribute script, the type of the extended attribute, and the identifier of the extended attribute script. The specific settings can be configured according to actual conditions, and this embodiment does not limit this.

[0033] Before the query results of the original target attribute graph (i.e., the query results obtained from the graph database) are returned to the target user, they can be further processed by the extended attribute execution module. Specifically, the extended attribute execution module can traverse the information of each node and / or edge in the target attribute graph. For each node, if, based on the attribute key and attribute value of each node, and combined with other relevant information, it is determined that there is attribute information of a first node in the obtained target attribute graph that matches the extended attribute information in the pre-configured extended database, then the first extended attribute information matching the first node's attribute information can be retrieved from the extended database. This first extended attribute information is then used to replace the attribute information of the first node in the obtained target attribute graph, resulting in the attribute information of the nodes in the target attribute graph after replacement. Similarly, for each edge, the same operation is performed to retrieve the first extended attribute information matching the attribute information of the first edge from the extended database. This first extended attribute information can then be used to replace the attribute information of the first edge in the obtained target attribute graph, resulting in the attribute information of the entities in the target attribute graph after replacement.

[0034] In step S108, the attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the above query request, and the query result is provided to the target user.

[0035] This specification provides a method for querying attribute graphs. It involves obtaining a query request for a target attribute graph initiated by a target user. Then, based on the identifier of the target attribute graph, it retrieves the attribute information of entities contained in the target attribute graph from the graph database containing the identifier. If the retrieved attribute information of entities contained in the target attribute graph contains attribute information of a first entity that matches extended attribute information in a pre-configured extended database, it retrieves first extended attribute information matching the attribute information of the first entity and replaces the attribute information of the first entity with the first extended attribute information, obtaining the replaced attribute information of entities contained in the target attribute graph. The extended attribute information includes one or more of the following: information modifying the attribute information of entities contained in the target attribute graph in the graph database; information expanding the content of the information of entities contained in the target attribute graph in the graph database; and information expanding the content of the graph database. Ultimately, the attribute information of entities contained in the replaced target attribute graph can be provided to the target user as query results. In this way, when querying attribute graph data, the original query data and extended attribute information are processed uniformly before the query results are returned to obtain the actual attribute value information. By introducing extended attributes, the attribute information in the attribute graph is transformed from static information to dynamic information. Heterogeneous data sources can be used as attribute information for the attribute graph, or complex derived graph attribute information can be obtained by processing the attribute information of the original attribute graph. The adjustment and addition of attribute logic are also more flexible, and the connotation of entity attributes is also richer. This effectively expands the boundary of the use of attribute graphs for heterogeneous data sources, reduces the impact of attribute graph attribute changes on the system, increases the flexibility of attribute graph data expression, and solves the problem that the entity attribute information in the attribute graph query results is limited by the attribute information in the attribute graph. From the perspective of data heterogeneity, it expands the expressive power of attribute graphs.

[0036] Example 2

[0037] like Figure 3 As shown in the embodiments of this specification, a method for querying attribute graphs is provided. The execution subject of this method can be a terminal device or a server. The terminal device can be a mobile phone, tablet computer, or a computer device such as a laptop or desktop computer, or an IoT device (specifically, a smartwatch, in-vehicle device, etc.). The server can be a single server or a server cluster composed of multiple servers. The server can be a backend server for financial services or online shopping services, or a backend server for an application. This embodiment uses a server as an example for detailed description. For the execution process of the terminal device, please refer to the relevant content below, which will not be repeated here. The method specifically includes the following steps:

[0038] In step S302, the extended attribute configuration information of the target entity to be extended is obtained. The target entity is an entity contained in the target attribute graph. The target entity includes nodes and / or edges. The extended attribute configuration information includes extended script information, script identifiers corresponding to the extended script information, and attribute information associated with the extended script information.

[0039] The target entity can be any node and / or edge in the attribute graph. In this embodiment, the target entity is an entity contained in the target attribute graph, i.e., the target entity can be a node and / or edge contained in the target attribute graph. The script identifier can be the name, code, etc. of the script, which can be set according to the actual situation. The extended script information can include information such as script content. The script corresponding to the extended script information can be an executable file written in a specific descriptive language according to a certain format. When the script is executed, the execution device will perform a series of operations to achieve a certain purpose. The extension in this embodiment can include adding information to expand the original information without changing the original information, or modifying some or all of the information in the original information to expand the original information, or performing both of the above methods at the same time to expand the original information, which can be set according to the actual situation.

[0040] In implementation, to enable the application of extended attributes, an extended attribute configuration module or mechanism can be set up. This module or mechanism can be used to store and set extended attribute configuration information, which may include extended script information, script identifiers (which can be unique identifiers of the scripts) corresponding to the extended script information, and attribute keys in the schema of the associated attribute graph. When it is necessary to extend the attribute information of an attribute graph (i.e., the target attribute graph) or an entity in an attribute graph (i.e., the target entity in the target attribute graph), the extended attribute configuration information of the target entity to be extended can be obtained. This means obtaining the extended script information, script identifiers, and associated attribute information of one or more different nodes in the target attribute graph, and / or, the extended script information, script identifiers, and associated attribute information of one or more different edges in the target attribute graph.

[0041] In step S304, based on the extended attribute configuration information of the target entity, extended attribute information of the target entity is generated, and the extended attribute information of the target entity is configured into the graph database and / or the extended database.

[0042] The extended attribute information may include one or more of the following: information that modifies the attribute information of entities contained in the target attribute graph in the graph database, information that expands the content of the entity information contained in the target attribute graph in the graph database, and information that expands the content of the graph database.

[0043] In implementation, considering that the process of content expansion involves adding new information to the original information, and the new information is often information that does not exist in the original information, for information that is being expanded, the extended attribute information of the target entity can be configured into the graph database and the extended database. For other forms of information expansion, the extended attribute information of the target entity can be configured into the extended database, etc. The specific settings can be made according to the actual situation, and this specification does not limit this.

[0044] In practical applications, if the extended attribute configuration information is used to expand the content of the target entity's information, the specific processing procedure of the above step S304 can be varied. The following provides an optional processing method, which may include the processing of the following steps A2 and A4.

[0045] In step A2, based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated.

[0046] In step A4, the extended attribute information of the generated target entity is configured into the target attribute graph in the graph database and into the extended database.

[0047] In practical applications, if the extended attribute configuration information is used to modify the attribute information of the target entity, the specific processing procedure of the above step S304 can vary. The following provides an optional processing method, which may include the processing of steps B2 and B4.

[0048] In step B2, based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated.

[0049] The extended attribute information of the target entity can include the identifier of the target entity and the extended attribute value of the target entity (i.e., the key-value pair formed by the two). Therefore, the process of generating the extended attribute information of the target entity mainly involves determining the extended attribute value of the target entity.

[0050] In step B4, the extended attribute information of the generated target entity is configured into the extended database.

[0051] For step A2 or step B2 above, when the target entity is a node, there are various ways to process it. The following is an optional processing method, which may include the following steps C2 and C4.

[0052] In step C2, information about the target entity is obtained, including one or more of the following: node identifier, node type, and node attribute values.

[0053] In step C4, the information of the target entity is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

[0054] In practical applications, in addition to the above methods, it can also be handled in the following ways, as detailed in steps D2 and D4 below.

[0055] In step D2, information about neighboring nodes adjacent to the target entity is obtained. The obtained information about neighboring nodes includes one or more of the following: neighboring node identifier, neighboring node type, and neighboring node attribute values.

[0056] In step D4, the information of the neighboring nodes is input into the script corresponding to the extended script information to obtain the extended attribute values ​​of the target entity.

[0057] For step A2 or step B2 above, when the target entity is an edge, there are various ways to process it. The following is an optional processing method, which may include the processing of step E2 and step E4.

[0058] In step E2, information about the target entity is obtained, including one or more of the following: the starting point information of the edge, the target point information of the edge, the type of the edge, and the attribute values ​​of the edge.

[0059] In step E4, the acquired target entity information is input into the script corresponding to the extended script information to obtain the extended attribute values ​​of the target entity.

[0060] In practical applications, in addition to the above methods, it can also be handled in the following ways, as detailed in steps F2 and F4 below.

[0061] In step F2, information about the neighboring edges adjacent to the target entity is obtained. The obtained information about the neighboring edges includes one or more of the following: the starting point information of the neighboring edge, the target point information of the neighboring edge, the type of the neighboring edge, and the attribute values ​​of the neighboring edge.

[0062] In step F4, the acquired neighbor information is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

[0063] In step S306, based on a preset communication interaction method, extended data related to the target entity and used to expand the content of the graph database are obtained from other data sources, and the obtained extended data is configured as extended attribute values ​​of the target entity in the extended database.

[0064] The preset communication interaction methods include one or more of the following: communication interaction based on Remote Procedure Call (RPC), communication interaction based on file reading, and communication interaction based on memory sharing.

[0065] In practical applications, two or more of the processing methods in C2-C4, D2-D4, E2-E4, F2-F4 and step S306 can be selected to obtain the extended attribute values ​​of the target entity.

[0066] Through the specific processing of steps S302 to S306 above, a graph database and an extended database can be obtained. Subsequently, attribute graph query processing can be performed based on the graph database and the extended database. For details, please refer to the processing of steps S308 to S320 below.

[0067] In step S308, a query request for the target attribute graph initiated by the target user is obtained, and the query request includes the identifier of the target attribute graph.

[0068] In step S310, based on the identifier of the target attribute graph, the attribute information of the entities contained in the target attribute graph is obtained from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges.

[0069] The specific processing procedures for steps S308 and S310 can be found in the relevant content of the above embodiment one, and will not be repeated here.

[0070] In step S312, if the attribute information of the entities contained in the obtained target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then the identifier of the first entity is obtained from the attribute information of the first entity.

[0071] In implementation, the extended attribute execution module combines the original graph data generated by the attribute graph query mechanism with the extended attribute configuration information in the extended attribute configuration module to process the corresponding data and obtain the extended graph data. Specifically, for example... Figure 4As shown, each node and each edge in the target attribute graph is traversed. Based on the characteristic information of the attribute key, the extended attribute configuration module is requested to determine whether there is attribute information in the attribute information of the entity contained in the target attribute graph that matches the extended attribute information in the pre-configured extended database. If not, the attribute information of the next entity is traversed. Otherwise, the identifier of the first entity is obtained from the attribute information of the first entity, and the following step S314 is executed.

[0072] In step S314, based on the identifier of the first entity, the script identifier corresponding to the identifier of the first entity is obtained from the extended database.

[0073] In step S316, the extended script information corresponding to the script identifier is obtained from the extended database, the script corresponding to the obtained extended script information is executed, the corresponding execution result is obtained, and the execution result is used as the extended attribute value in the first extended attribute information that matches the attribute information of the first entity.

[0074] In implementation, such as Figure 4 As shown, the extended attribute configuration module can be requested to obtain the pre-configured extended script information through the attribute key and attribute value (i.e. script identifier) ​​of the extended attribute. Then, the logic of the script corresponding to the extended script information can be executed to obtain the actual extended attribute value (i.e. execution result). The execution result is used as the extended attribute value in the first extended attribute information that matches the attribute information of the first entity.

[0075] In step S318, the attribute information of the first entity is replaced with the first extended attribute information to obtain the attribute information of the entity contained in the target attribute graph after replacement.

[0076] In step S320, the attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the above query request, and the query result is provided to the target user.

[0077] This specification provides a method for querying attribute graphs. It involves obtaining a query request for a target attribute graph initiated by a target user. Then, based on the identifier of the target attribute graph, it retrieves the attribute information of entities contained in the target attribute graph from the graph database containing the identifier. If the retrieved attribute information of entities contained in the target attribute graph contains attribute information of a first entity that matches extended attribute information in a pre-configured extended database, it retrieves first extended attribute information matching the attribute information of the first entity and replaces the attribute information of the first entity with the first extended attribute information, obtaining the replaced attribute information of entities contained in the target attribute graph. The extended attribute information includes one or more of the following: information modifying the attribute information of entities contained in the target attribute graph in the graph database; information expanding the content of the information of entities contained in the target attribute graph in the graph database; and information expanding the content of the graph database. Ultimately, the attribute information of entities contained in the replaced target attribute graph can be provided to the target user as query results. In this way, when querying attribute graph data, the original query data and extended attribute information are processed uniformly before the query results are returned to obtain the actual attribute value information. By introducing extended attributes, the attribute information in the attribute graph is transformed from static information to dynamic information. Heterogeneous data sources can be used as attribute information for the attribute graph, or complex derived graph attribute information can be obtained by processing the attribute information of the original attribute graph. The adjustment and addition of attribute logic are also more flexible, and the connotation of entity attributes is also richer. This effectively expands the boundary of the use of attribute graphs for heterogeneous data sources, reduces the impact of attribute graph attribute changes on the system, increases the flexibility of attribute graph data expression, and solves the problem that the entity attribute information in the attribute graph query results is limited by the attribute information in the attribute graph. From the perspective of data heterogeneity, it expands the expressive power of attribute graphs.

[0078] Example 3

[0079] The above describes the method for querying attribute graphs provided in the embodiments of this specification. Based on the same idea, the embodiments of this specification also provide a device for querying attribute graphs, such as... Figure 5 As shown.

[0080] The attribute graph query device includes: a query request module 501, an attribute acquisition module 502, an attribute replacement module 503, and a query result output module 504, wherein:

[0081] The query request module 501 obtains a query request for a target attribute graph initiated by the target user, wherein the query request includes the identifier of the target attribute graph;

[0082] The attribute acquisition module 502, based on the identifier of the target attribute graph, acquires the attribute information of the entities contained in the target attribute graph from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges.

[0083] The attribute replacement module 503, if the attribute information of the entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then acquires the first extended attribute information that matches the attribute information of the first entity, and replaces the attribute information of the first entity with the first extended attribute information to obtain the replaced attribute information of the entities contained in the target attribute graph. The extended attribute information includes one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the entity information contained in the target attribute graph in the graph database, and information for expanding the content of the graph database.

[0084] The query result output module 504 takes the attribute information of the entities contained in the replaced target attribute graph as the query result corresponding to the query request and provides the query result to the target user.

[0085] In the embodiments described in this specification, the device further includes:

[0086] The extended configuration module obtains the extended attribute configuration information of the target entity to be extended. The target entity is an entity contained in the target attribute graph. The target entity includes nodes and / or edges. The extended attribute configuration information includes extended script information, the script identifier corresponding to the extended script information, and attribute information associated with the extended script information.

[0087] The extended attribute generation module generates extended attribute information of the target entity based on the extended attribute configuration information of the target entity, and configures the extended attribute information of the target entity into the graph database and / or the extended database.

[0088] In this embodiment of the specification, the extended attribute configuration information is used to expand the content of the target entity's information, and the extended attribute generation module includes:

[0089] An extended attribute generation unit generates extended attribute information for the target entity based on the extended attribute configuration information of the target entity.

[0090] An extended attribute storage unit configures the generated extended attribute information of the target entity into the target attribute graph in the graph database, and also into the extended database; or,

[0091] The extended attribute configuration information is used to modify the attribute information of the target entity. The extended attribute generation module includes:

[0092] An extended attribute generation unit generates extended attribute information for the target entity based on the extended attribute configuration information of the target entity.

[0093] An extended attribute storage unit configures the generated extended attribute information of the target entity into the extended database.

[0094] In this embodiment of the specification, the target entity is a node. The extended attribute generation unit acquires information about the target entity, including one or more of node identifier, node type, and node attribute values; inputs the acquired target entity information into the script corresponding to the extended script information to obtain the extended attribute values ​​of the target entity; and / or,

[0095] The target entity is a node. The extended attribute generation unit obtains information about neighboring nodes adjacent to the target entity. The obtained neighboring node information includes one or more of the following: neighboring node identifier, neighboring node type, and neighboring node attribute value. The obtained neighboring node information is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

[0096] In this embodiment of the specification, the target entity is an edge. The extended attribute generation unit acquires information about the target entity, including one or more of the following: the starting point information of the edge, the target point information of the edge, the type of the edge, and the attribute values ​​of the edge; it inputs the acquired information about the target entity into the script corresponding to the extended script information to obtain the extended attribute values ​​of the target entity; and / or,

[0097] The target entity is an edge. The extended attribute generation unit obtains information about the neighboring edges adjacent to the target entity. The obtained neighboring edge information includes one or more of the following: the starting point information of the neighboring edge, the target point information of the neighboring edge, the type of the neighboring edge, and the attribute value of the neighboring edge. The obtained neighboring edge information is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

[0098] In the embodiments described in this specification, the device further includes:

[0099] The database extension module, based on a preset communication interaction method, obtains extended data related to the target entity from other data sources to expand the content of the graph database, and configures the obtained extended data as extended attribute values ​​of the target entity into the extended database.

[0100] In the embodiments of this specification, the preset communication interaction method includes one or more of the following: communication interaction method based on Remote Procedure Call (RPC), communication interaction method based on file reading, and communication interaction method based on memory sharing.

[0101] In this embodiment of the specification, the attribute replacement module 503 includes:

[0102] The identifier acquisition unit acquires the identifier of the first entity from the attribute information of the first entity;

[0103] The script acquisition unit retrieves a script identifier corresponding to the identifier of the first entity from the extended database, based on the identifier of the first entity.

[0104] The extended attribute determination unit retrieves extended script information corresponding to the script identifier from the extended database, executes the script corresponding to the retrieved extended script information, obtains the corresponding execution result, and uses the execution result as the extended attribute value in the first extended attribute information that matches the attribute information of the first entity.

[0105] This specification provides an attribute graph query device. It obtains a query request for a target attribute graph initiated by a target user. Then, based on the identifier of the target attribute graph, it retrieves the attribute information of entities contained in the target attribute graph from the graph database containing the identifier. If the retrieved attribute information of entities contained in the target attribute graph contains attribute information of a first entity that matches extended attribute information in a pre-configured extended database, it retrieves first extended attribute information matching the attribute information of the first entity and replaces the attribute information of the first entity with the first extended attribute information, obtaining the replaced attribute information of entities contained in the target attribute graph. The extended attribute information includes one or more of the following: information for modifying the attribute information of entities contained in the target attribute graph in the graph database, information for expanding the content of the information of entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. Ultimately, the attribute information of entities contained in the replaced target attribute graph can be provided to the target user as query results. In this way, when querying attribute graph data, the original query data and extended attribute information are processed uniformly before the query results are returned to obtain the actual attribute value information. By introducing extended attributes, the attribute information in the attribute graph is transformed from static information to dynamic information. Heterogeneous data sources can be used as attribute information for the attribute graph, or complex derived graph attribute information can be obtained by processing the attribute information of the original attribute graph. The adjustment and addition of attribute logic are also more flexible, and the connotation of entity attributes is also richer. This effectively expands the boundary of the use of attribute graphs for heterogeneous data sources, reduces the impact of attribute graph attribute changes on the system, increases the flexibility of attribute graph data expression, and solves the problem that the entity attribute information in the attribute graph query results is limited by the attribute information in the attribute graph. From the perspective of data heterogeneity, it expands the expressive power of attribute graphs.

[0106] Example 4

[0107] The above describes the attribute graph query device provided in the embodiments of this specification. Based on the same idea, the embodiments of this specification also provide an attribute graph query device, such as... Figure 6 As shown.

[0108] The device for querying the attribute graph can be a terminal device or a server, as described in the above embodiments.

[0109] The property graph query device can vary considerably due to differences in configuration or performance. It may include one or more processors 601 and memory 602, where one or more application programs or data may be stored. The memory 602 may be temporary or persistent storage. The application programs stored in the memory 602 may include one or more modules (not shown in the figures), each module including a series of computer-executable instructions for the property graph query device. Furthermore, the processor 601 may be configured to communicate with the memory 602 and execute the series of computer-executable instructions in the memory 602 on the property graph query device. The property graph query device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input / output interfaces 605, and one or more keyboards 606.

[0110] Specifically, in this embodiment, the attribute graph query device includes a memory and one or more programs, wherein one or more programs are stored in the memory, and one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the attribute graph query device, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following:

[0111] Obtain a query request for a target attribute graph initiated by a target user, wherein the query request includes the identifier of the target attribute graph;

[0112] Based on the identifier of the target attribute graph, the attribute information of the entities contained in the target attribute graph is obtained from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges.

[0113] If the attribute information of the entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then the first extended attribute information that matches the attribute information of the first entity is obtained, and the attribute information of the first entity is replaced with the first extended attribute information to obtain the attribute information of the entities contained in the target attribute graph after replacement. The extended attribute information includes one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the entity information contained in the target attribute graph in the graph database, and information for expanding the content of the graph database.

[0114] The attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the query request, and the query result is provided to the target user.

[0115] The embodiments in this specification also include:

[0116] Obtain the extended attribute configuration information of the target entity to be extended, wherein the target entity is an entity contained in the target attribute graph, the target entity includes nodes and / or edges, and the extended attribute configuration information includes extended script information, the script identifier corresponding to the extended script information, and attribute information associated with the extended script information;

[0117] Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated, and the extended attribute information of the target entity is configured into the graph database and / or the extended database.

[0118] In this embodiment of the specification, the extended attribute configuration information is used to expand the content of the target entity's information. The step of generating extended attribute information for the target entity based on the extended attribute configuration information, and configuring the extended attribute information of the target entity into the graph database and / or the extended database, includes:

[0119] Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated;

[0120] Configure the generated extended attribute information of the target entity into the target attribute graph in the graph database, and into the extended database; or,

[0121] The extended attribute configuration information is used to modify the attribute information of the target entity. The step of generating extended attribute information for the target entity based on the extended attribute configuration information, and configuring the extended attribute information of the target entity into the graph database and / or the extended database, includes:

[0122] Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated;

[0123] Configure the extended attribute information of the generated target entity into the extended database.

[0124] In this embodiment of the specification, the target entity is a node, and the step of generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:

[0125] Obtain information about the target entity, including one or more of the following: node identifier, node type, and node attribute values;

[0126] The acquired target entity information is input into the script corresponding to the extended script information to obtain the extended attribute values ​​of the target entity; and / or,

[0127] The target entity is a node, and the process of generating extended attribute information for the target entity based on its extended attribute configuration information includes:

[0128] Obtain information about neighboring nodes adjacent to the target entity. The obtained information about neighboring nodes includes one or more of the following: neighboring node identifier, neighboring node type, and neighboring node attribute values.

[0129] The information of the neighboring nodes is obtained and input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

[0130] In this embodiment of the specification, the target entity is an edge, and the step of generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:

[0131] Obtain information about the target entity, including one or more of the following: the starting point information of the edge, the target point information of the edge, the type of the edge, and the attribute values ​​of the edge;

[0132] The acquired target entity information is input into the script corresponding to the extended script information to obtain the extended attribute values ​​of the target entity; and / or,

[0133] The target entity is an edge, and the process of generating extended attribute information for the target entity based on its extended attribute configuration information includes:

[0134] Obtain information about the neighboring edges adjacent to the target entity. The obtained information about the neighboring edges includes one or more of the following: the starting point information of the neighboring edge, the target point information of the neighboring edge, the type of the neighboring edge, and the attribute values ​​of the neighboring edge.

[0135] The acquired information about the neighboring edges is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

[0136] The embodiments in this specification also include:

[0137] Based on a preset communication interaction method, extended data related to the target entity and used to expand the content of the graph database are obtained from other data sources, and the obtained extended data is configured as extended attribute values ​​of the target entity in the extended database.

[0138] In the embodiments of this specification, the preset communication interaction method includes one or more of the following: communication interaction method based on Remote Procedure Call (RPC), communication interaction method based on file reading, and communication interaction method based on memory sharing.

[0139] In the embodiments of this specification, obtaining the first extended attribute information that matches the attribute information of the first entity includes:

[0140] Obtain the identifier of the first entity from the attribute information of the first entity;

[0141] Based on the identifier of the first entity, obtain the script identifier corresponding to the identifier of the first entity from the extended database;

[0142] The extended script information corresponding to the script identifier is obtained from the extended database, the script corresponding to the obtained extended script information is executed, the corresponding execution result is obtained, and the execution result is used as the extended attribute value in the first extended attribute information that matches the attribute information of the first entity.

[0143] This specification provides an attribute graph query device. It obtains a query request for a target attribute graph initiated by a target user. Then, based on the identifier of the target attribute graph, it retrieves the attribute information of entities contained in the target attribute graph from the graph database where the identifier of the target attribute graph is located. If the retrieved attribute information of entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in a pre-configured extended database, then it retrieves the first extended attribute information that matches the attribute information of the first entity and replaces the attribute information of the first entity with the first extended attribute information, obtaining the attribute information of entities contained in the target attribute graph after replacement. The extended attribute information includes one or more of the following: information for modifying the attribute information of entities contained in the target attribute graph in the graph database, information for expanding the content of the information of entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. Ultimately, the attribute information of entities contained in the replaced target attribute graph can be provided to the target user as query results. In this way, when querying attribute graph data, the original query data and extended attribute information are processed uniformly before the query results are returned to obtain the actual attribute value information. By introducing extended attributes, the attribute information in the attribute graph is transformed from static information to dynamic information. Heterogeneous data sources can be used as attribute information for the attribute graph, or complex derived graph attribute information can be obtained by processing the attribute information of the original attribute graph. The adjustment and addition of attribute logic are also more flexible, and the connotation of entity attributes is also richer. This effectively expands the boundary of the use of attribute graphs for heterogeneous data sources, reduces the impact of attribute graph attribute changes on the system, increases the flexibility of attribute graph data expression, and solves the problem that the entity attribute information in the attribute graph query results is limited by the attribute information in the attribute graph. From the perspective of data heterogeneity, it expands the expressive power of attribute graphs.

[0144] Example 5

[0145] Furthermore, based on the above Figures 1 to 4 The method shown in this specification, along with one or more embodiments, also provides a storage medium for storing computer-executable instruction information. In one specific embodiment, the storage medium can be a USB flash drive, optical disc, hard disk, etc. When the computer-executable instruction information stored in the storage medium is executed by a processor, it can achieve the following process:

[0146] Obtain a query request for a target attribute graph initiated by a target user, wherein the query request includes the identifier of the target attribute graph;

[0147] Based on the identifier of the target attribute graph, the attribute information of the entities contained in the target attribute graph is obtained from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges.

[0148] If the attribute information of the entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then the first extended attribute information that matches the attribute information of the first entity is obtained, and the attribute information of the first entity is replaced with the first extended attribute information to obtain the attribute information of the entities contained in the target attribute graph after replacement. The extended attribute information includes one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the entity information contained in the target attribute graph in the graph database, and information for expanding the content of the graph database.

[0149] The attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the query request, and the query result is provided to the target user.

[0150] The embodiments in this specification also include:

[0151] Obtain the extended attribute configuration information of the target entity to be extended, wherein the target entity is an entity contained in the target attribute graph, the target entity includes nodes and / or edges, and the extended attribute configuration information includes extended script information, the script identifier corresponding to the extended script information, and attribute information associated with the extended script information;

[0152] Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated, and the extended attribute information of the target entity is configured into the graph database and / or the extended database.

[0153] In this embodiment of the specification, the extended attribute configuration information is used to expand the content of the target entity's information. The step of generating extended attribute information for the target entity based on the extended attribute configuration information, and configuring the extended attribute information of the target entity into the graph database and / or the extended database, includes:

[0154] Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated;

[0155] Configure the generated extended attribute information of the target entity into the target attribute graph in the graph database, and into the extended database; or,

[0156] The extended attribute configuration information is used to modify the attribute information of the target entity. The step of generating extended attribute information for the target entity based on the extended attribute configuration information, and configuring the extended attribute information of the target entity into the graph database and / or the extended database, includes:

[0157] Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated;

[0158] Configure the extended attribute information of the generated target entity into the extended database.

[0159] In this embodiment of the specification, the target entity is a node, and the step of generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:

[0160] Obtain information about the target entity, including one or more of the following: node identifier, node type, and node attribute values;

[0161] The acquired target entity information is input into the script corresponding to the extended script information to obtain the extended attribute values ​​of the target entity; and / or,

[0162] The target entity is a node, and the process of generating extended attribute information for the target entity based on its extended attribute configuration information includes:

[0163] Obtain information about neighboring nodes adjacent to the target entity. The obtained information about neighboring nodes includes one or more of the following: neighboring node identifier, neighboring node type, and neighboring node attribute values.

[0164] The information of the neighboring nodes is obtained and input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

[0165] In this embodiment of the specification, the target entity is an edge, and the step of generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:

[0166] Obtain information about the target entity, including one or more of the following: the starting point information of the edge, the target point information of the edge, the type of the edge, and the attribute values ​​of the edge;

[0167] The acquired target entity information is input into the script corresponding to the extended script information to obtain the extended attribute values ​​of the target entity; and / or,

[0168] The target entity is an edge, and the process of generating extended attribute information for the target entity based on its extended attribute configuration information includes:

[0169] Obtain information about the neighboring edges adjacent to the target entity. The obtained information about the neighboring edges includes one or more of the following: the starting point information of the neighboring edge, the target point information of the neighboring edge, the type of the neighboring edge, and the attribute values ​​of the neighboring edge.

[0170] The acquired information about the neighboring edges is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

[0171] The embodiments in this specification also include:

[0172] Based on a preset communication interaction method, extended data related to the target entity and used to expand the content of the graph database are obtained from other data sources, and the obtained extended data is configured as extended attribute values ​​of the target entity in the extended database.

[0173] In the embodiments of this specification, the preset communication interaction method includes one or more of the following: communication interaction method based on Remote Procedure Call (RPC), communication interaction method based on file reading, and communication interaction method based on memory sharing.

[0174] In the embodiments of this specification, obtaining the first extended attribute information that matches the attribute information of the first entity includes:

[0175] Obtain the identifier of the first entity from the attribute information of the first entity;

[0176] Based on the identifier of the first entity, obtain the script identifier corresponding to the identifier of the first entity from the extended database;

[0177] The extended script information corresponding to the script identifier is obtained from the extended database, the script corresponding to the obtained extended script information is executed, the corresponding execution result is obtained, and the execution result is used as the extended attribute value in the first extended attribute information that matches the attribute information of the first entity.

[0178] This specification provides a storage medium that acquires a query request for a target attribute graph initiated by a target user. Then, based on the identifier of the target attribute graph, it retrieves attribute information of entities contained in the target attribute graph from the graph database where the identifier of the target attribute graph is located. If the retrieved attribute information of entities contained in the target attribute graph contains attribute information of a first entity that matches extended attribute information in a pre-configured extended database, then it acquires first extended attribute information matching the attribute information of the first entity and replaces the attribute information of the first entity with the first extended attribute information, obtaining the replaced attribute information of entities contained in the target attribute graph. The extended attribute information includes one or more of the following: information for modifying the attribute information of entities contained in the target attribute graph in the graph database; information for expanding the content of the information of entities contained in the target attribute graph in the graph database; information for expanding the content of the graph database; and so on. Finally, the attribute information of entities contained in the replaced target attribute graph can be provided to the target user as query results. In this way, when querying attribute graph data, the original query data and extended attribute information are processed uniformly before the query results are returned to obtain the actual attribute value information. By introducing extended attributes, the attribute information in the attribute graph is transformed from static information to dynamic information. Heterogeneous data sources can be used as attribute information for the attribute graph, or complex derived graph attribute information can be obtained by processing the attribute information of the original attribute graph. The adjustment and addition of attribute logic are also more flexible, and the connotation of entity attributes is also richer. This effectively expands the boundary of the use of attribute graphs for heterogeneous data sources, reduces the impact of attribute graph attribute changes on the system, increases the flexibility of attribute graph data expression, and solves the problem that the entity attribute information in the attribute graph query results is limited by the attribute information in the attribute graph. From the perspective of data heterogeneity, the expressive power of attribute graphs is expanded.

[0179] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0180] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using a hardware physical module. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0181] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, ASICs, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0182] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0183] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in one or more software and / or hardware.

[0184] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0185] Embodiments in this specification are described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable parallel device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable parallel device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0186] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable fraud device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0187] These computer program instructions can also be loaded onto a computer or other programmable device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0188] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0189] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0190] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0191] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0192] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0193] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0194] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0195] The above description is merely an embodiment of this specification and is not intended to limit this application. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. A method for querying attribute graphs, the method comprising: Obtain a query request for a target attribute graph initiated by a target user, wherein the query request includes the identifier of the target attribute graph; Based on the identifier of the target attribute graph, the attribute information of the entities contained in the target attribute graph is obtained from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges. If the attribute information of the entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then the first extended attribute information matching the attribute information of the first entity is obtained, and the attribute information of the first entity is replaced with the first extended attribute information to obtain the attribute information of the entities contained in the target attribute graph after replacement. The extended attribute information includes one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the information of the entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. The extended attribute information is obtained by obtaining the extended attribute configuration information of the target entity to be extended. The target entity is an entity contained in the target attribute graph. The extended attribute configuration information includes extended script information, a script identifier corresponding to the extended script information, and attribute information associated with the extended script information. The information of the target entity is obtained, and the obtained information of the target entity is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity. The extended attribute information including the extended attribute value of the target entity is then configured into the graph database and / or the extended database. The attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the query request, and the query result is provided to the target user.

2. The method according to claim 1, further comprising: Obtain the extended attribute configuration information of the target entity to be extended, wherein the target entity is an entity contained in the target attribute graph, the target entity includes nodes and / or edges, and the extended attribute configuration information includes extended script information, the script identifier corresponding to the extended script information, and attribute information associated with the extended script information; Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated, and the extended attribute information of the target entity is configured into the graph database and / or the extended database.

3. The method according to claim 2, wherein the extended attribute configuration information is used to expand the information of the target entity, and the step of generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity, and configuring the extended attribute information of the target entity into the graph database and / or the extended database, includes: Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated; The generated extended attribute information of the target entity is configured into the target attribute graph in the graph database, and also configured into the extended database; or, The extended attribute configuration information is used to modify the attribute information of the target entity. The step of generating extended attribute information for the target entity based on the extended attribute configuration information, and configuring the extended attribute information of the target entity into the graph database and / or the extended database, includes: Based on the extended attribute configuration information of the target entity, the extended attribute information of the target entity is generated; Configure the extended attribute information of the generated target entity into the extended database.

4. The method according to claim 3, wherein the target entity is a node, and the step of generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes: Obtain information about the target entity, including one or more of the following: node identifier, node type, and node attribute values; The acquired target entity information is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity; And / or, The target entity is a node, and the process of generating extended attribute information for the target entity based on its extended attribute configuration information includes: Obtain information about neighboring nodes adjacent to the target entity. The obtained information about neighboring nodes includes one or more of the following: neighboring node identifier, neighboring node type, and neighboring node attribute values. The information of the neighboring nodes is obtained and input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

5. The method according to claim 3, wherein the target entity is an edge, and the step of generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes: Obtain information about the target entity, including one or more of the following: the starting point information of the edge, the target point information of the edge, the type of the edge, and the attribute values ​​of the edge; The acquired target entity information is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity; And / or, The target entity is an edge, and the process of generating extended attribute information for the target entity based on its extended attribute configuration information includes: Obtain information about the neighboring edges adjacent to the target entity. The obtained information about the neighboring edges includes one or more of the following: the starting point information of the neighboring edge, the target point information of the neighboring edge, the type of the neighboring edge, and the attribute values ​​of the neighboring edge. The acquired information about the neighboring edges is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity.

6. The method according to claim 1, further comprising: Based on a preset communication interaction method, extended data related to the target entity and used to expand the content of the graph database are obtained from other data sources, and the obtained extended data is configured as extended attribute values ​​of the target entity in the extended database.

7. The method according to claim 6, wherein the preset communication interaction mode includes one or more of the following: a communication interaction mode based on remote procedure call (RPC), a communication interaction mode based on file reading, and a communication interaction mode based on memory sharing.

8. The method according to claim 1, wherein obtaining the first extended attribute information matching the attribute information of the first entity includes: Obtain the identifier of the first entity from the attribute information of the first entity; Based on the identifier of the first entity, obtain the script identifier corresponding to the identifier of the first entity from the extended database; The extended script information corresponding to the script identifier is obtained from the extended database, the script corresponding to the obtained extended script information is executed, the corresponding execution result is obtained, and the execution result is used as the extended attribute value in the first extended attribute information that matches the attribute information of the first entity.

9. A query device for an attribute graph, the device comprising: The query request module obtains a query request for a target attribute graph initiated by the target user, wherein the query request includes the identifier of the target attribute graph; The attribute acquisition module, based on the identifier of the target attribute graph, retrieves the attribute information of the entities contained in the target attribute graph from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges. The attribute replacement module, if the attribute information of the entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then acquires the first extended attribute information that matches the attribute information of the first entity, and replaces the attribute information of the first entity with the first extended attribute information to obtain the attribute information of the entities contained in the target attribute graph after replacement. The extended attribute information includes one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the information of the entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. The extended attribute information is obtained by acquiring the extended attribute configuration information of the target entity to be extended. The target entity is an entity contained in the target attribute graph. The extended attribute configuration information includes extended script information, a script identifier corresponding to the extended script information, and attribute information associated with the extended script information. The module acquires the information of the target entity, inputs the acquired information of the target entity into the script corresponding to the extended script information to obtain the extended attribute value of the target entity, and configures the extended attribute information including the extended attribute value of the target entity into the graph database and / or the extended database. The query result output module takes the attribute information of the entities contained in the replaced target attribute graph as the query result corresponding to the query request and provides the query result to the target user.

10. A query device for an attribute graph, the attribute graph query device comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to: Obtain a query request for a target attribute graph initiated by a target user, wherein the query request includes the identifier of the target attribute graph; Based on the identifier of the target attribute graph, the attribute information of the entities contained in the target attribute graph is obtained from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges. If the attribute information of the entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then the first extended attribute information matching the attribute information of the first entity is obtained, and the attribute information of the first entity is replaced with the first extended attribute information to obtain the attribute information of the entities contained in the target attribute graph after replacement. The extended attribute information includes one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the information of the entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. The extended attribute information is obtained by obtaining the extended attribute configuration information of the target entity to be extended. The target entity is an entity contained in the target attribute graph. The extended attribute configuration information includes extended script information, a script identifier corresponding to the extended script information, and attribute information associated with the extended script information. The information of the target entity is obtained, and the obtained information of the target entity is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity. The extended attribute information including the extended attribute value of the target entity is then configured into the graph database and / or the extended database. The attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the query request, and the query result is provided to the target user.

11. A storage medium for storing computer-executable instructions, which, when executed by a processor, perform the following process: Obtain a query request for a target attribute graph initiated by a target user, wherein the query request includes the identifier of the target attribute graph; Based on the identifier of the target attribute graph, the attribute information of the entities contained in the target attribute graph is obtained from the graph database where the identifier of the target attribute graph is located. The entities include nodes and / or edges. If the attribute information of the entities contained in the target attribute graph contains attribute information of a first entity that matches the extended attribute information in the pre-configured extended database, then the first extended attribute information matching the attribute information of the first entity is obtained, and the attribute information of the first entity is replaced with the first extended attribute information to obtain the attribute information of the entities contained in the target attribute graph after replacement. The extended attribute information includes one or more of the following: information for modifying the attribute information of the entities contained in the target attribute graph in the graph database, information for expanding the content of the information of the entities contained in the target attribute graph in the graph database, and information for expanding the content of the graph database. The extended attribute information is obtained by obtaining the extended attribute configuration information of the target entity to be extended. The target entity is an entity contained in the target attribute graph. The extended attribute configuration information includes extended script information, a script identifier corresponding to the extended script information, and attribute information associated with the extended script information. The information of the target entity is obtained, and the obtained information of the target entity is input into the script corresponding to the extended script information to obtain the extended attribute value of the target entity. The extended attribute information including the extended attribute value of the target entity is then configured into the graph database and / or the extended database. The attribute information of the entities contained in the replaced target attribute graph is used as the query result corresponding to the query request, and the query result is provided to the target user.

Citation Information

Patent Citations

  • System of entity-attribute framework used for information system modeling and data access

    CN108038222A

  • Unstructured data query method and system based on secondary attribute graph

    CN111897911A