CN115391378A - Attribute graph query method, device and equipment - Google Patents

Attribute graph query method, device and equipment Download PDF

Info

Publication number
CN115391378A
CN115391378A CN202211084427.5A CN202211084427A CN115391378A CN 115391378 A CN115391378 A CN 115391378A CN 202211084427 A CN202211084427 A CN 202211084427A CN 115391378 A CN115391378 A CN 115391378A
Authority
CN
China
Prior art keywords
attribute
information
target
entity
extended
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211084427.5A
Other languages
Chinese (zh)
Inventor
唐烨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alipay Hangzhou Information Technology Co Ltd
Original Assignee
Alipay Hangzhou Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alipay Hangzhou Information Technology Co Ltd filed Critical Alipay Hangzhou Information Technology Co Ltd
Priority to CN202211084427.5A priority Critical patent/CN115391378A/en
Publication of CN115391378A publication Critical patent/CN115391378A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2428Query predicate definition using graphical user interfaces, including menus and forms
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the specification discloses a query method, a device and equipment of an attribute graph, wherein the method comprises the following steps: acquiring a query request of a target attribute map initiated by a target user, acquiring attribute information of an entity contained in the target attribute map from a map database based on an identifier of the target attribute map, acquiring first extended attribute information matched with the attribute information of the first entity if the attribute information of the first entity matched with the extended attribute information in an extended database exists in the attribute information of the entity contained in the target attribute map, and replacing the attribute information of the first entity with the first extended attribute information, wherein the extended attribute information comprises one or more of the following information: information for modifying attribute information, information for performing content expansion on information of an entity, and information for performing content expansion on a graph database; and providing the attribute information of the entity contained in the replaced target attribute graph as a query result to the target user.

Description

Attribute graph query method, device and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for querying an attribute map.
Background
With the development of internet technology, the demand for exploring relevance data from mass data is more urgent, and data analysis based on graph structures is more and more favored. Currently, there are two main graph data structure models: the method comprises the steps of attribute graph and RDF graph, wherein the attribute graph is a graph data model which is used more in engineering practice.
Generally, in a query process of a property graph, the property graph has a set of Schema definition based on business abstraction, and based on the Schema definition, structured or unstructured data can be processed into information of nodes, edges and properties conforming to the Schema definition constraint and can be stored in a graph database. When a user queries the attribute graph, the data of the required attribute graph is obtained by querying from the graph database through a query language and according to the defined Schema information. However, in the above query method, data to be queried needs to be stored in the graph database in advance, so that when data in the attribute graph is queried, all data of the query result must come from the graph database in which the attribute graph is located, and such a query mode restricts the use of other data sources than the attribute graph. Furthermore, it can be difficult if some property needs to be modified. Therefore, a technical scheme capable of better expanding the nodes, edges and attributes in the attribute map is needed to be provided, so that the nodes, edges and attributes in the query result of the attribute map are not limited by the map database, and the expression capability of the attribute map is expanded from the viewpoint of data heterogeneity.
Disclosure of Invention
The purpose of the embodiments of the present specification is to provide a technical solution capable of better extending nodes, edges, and attributes in an attribute graph, so as to get rid of the limitation that the nodes, edges, and attributes in the query result of the attribute graph are limited by a graph database, and extend the expression capability of the attribute graph from the viewpoint of data heterogeneity.
In order to implement the above technical solution, the embodiments of the present specification are implemented as follows:
an embodiment of the present specification provides a method for querying an attribute map, where the method includes: acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph. And acquiring attribute information of entities contained in the target attribute graph from a graph database in which the target attribute graph identifier is located based on the target attribute graph identifier, wherein the entities comprise nodes and/or edges. If the attribute information of the first entity matched with the extended attribute information in the pre-configured extended database exists in the acquired attribute information of the entity contained in the target attribute map, acquiring first extended attribute information matched with 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 attribute information of the entity contained in the target attribute map after replacement, wherein the extended attribute information comprises one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database and the information of content expansion of the graph database. And taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request, and providing the query result for the target user.
An apparatus for querying an attribute map provided in an embodiment of the present specification, the apparatus includes: the query request module is used for acquiring a query request of a target attribute graph initiated by a target user, the query request comprises an identifier of the target attribute graph, and the attribute acquisition module is used for acquiring attribute information of an entity contained in the target attribute graph from a graph database in which the identifier of the target attribute graph is located based on the identifier of the target attribute graph, wherein the entity comprises a node and/or an edge. An attribute replacement module, configured to, if attribute information of a first entity that matches extended attribute information in a preconfigured extended database exists in the acquired attribute information of the entity included in the target attribute map, acquire first extended attribute information that matches the attribute information of the first entity, and replace the attribute information of the first entity with the first extended attribute information, to obtain attribute information of the entity included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database, and the information of content expansion of the graph database. And the query result output module is used for taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request and providing the query result for the target user.
An attribute graph query device provided in an embodiment of the present specification includes: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to: and acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph. And acquiring attribute information of entities contained in the target attribute graph from a graph database in which the target attribute graph identifier is located based on the target attribute graph identifier, wherein the entities comprise nodes and/or edges. If the attribute information of the first entity, which is matched with the attribute information of the first entity in a pre-configured extended database, exists in the acquired attribute information of the entity in the target attribute map, acquiring first extended attribute information matched with 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 attribute information of the entity in the target attribute map after replacement, wherein the extended attribute information comprises one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database and the information of content expansion of the graph database. And taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request, and providing the query result for the target user.
The present specification also provides a storage medium for storing computer executable instructions, which when executed by a processor implement the following procedures: acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph. And acquiring attribute information of entities contained in the target attribute graph from a graph database in which the target attribute graph identifier is located based on the target attribute graph identifier, wherein the entities comprise nodes and/or edges. If the attribute information of the first entity matched with the extended attribute information in the pre-configured extended database exists in the acquired attribute information of the entity contained in the target attribute map, acquiring first extended attribute information matched with 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 attribute information of the entity contained in the target attribute map after replacement, wherein the extended attribute information comprises one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database and the information of content expansion of the graph database. And taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request, and providing the query result for the target user.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative effort.
FIG. 1 is a diagram illustrating an embodiment of a query method for an attribute map;
FIG. 2 is a schematic diagram of a query page of an attribute map of the present specification;
FIG. 3 is a query method embodiment of another property diagram of the present specification;
FIG. 4 is a schematic diagram of an attribute extension of an attribute map of the present specification;
FIG. 5 is a query device embodiment of an attribute map of the present specification;
fig. 6 is an embodiment of a query device for an attribute map according to the present disclosure.
Detailed Description
The embodiment of the specification provides a query method, a query device and query equipment of an attribute graph.
In order to make those skilled in the art better understand the technical solutions in the present specification, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only a part of the embodiments of the present specification, and not all of the embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification without any inventive step should fall within the scope of protection of the present specification.
Example one
As shown in fig. 1, an execution subject of the method may be a terminal device or a server, where the terminal device may be a certain terminal device such as a mobile phone, a tablet computer, or the like, and may also be a computer device such as a notebook computer or a desktop computer, or may also be an IoT device (specifically, a smart watch, a vehicle-mounted device, or the like). The server may be an independent server, or a server cluster formed by a plurality of servers, and the server may be a background server of financial service or online shopping service, or a background server of an application program. In this embodiment, a server is taken as an example to describe in detail, and for the execution process of the terminal device, reference may be made to the following relevant contents, which are not described herein again. The method may specifically comprise the steps of:
in step S102, an inquiry request of the target attribute map initiated by the target user is obtained, where the inquiry request includes an identifier of the target attribute map.
The target user may be any user, and in this embodiment, the target user may be a user who initiates a query of the property graph. The target Property graph may be any Property graph that a target user needs to query, where the Property graph may be a graph data model, the Property graph may be a directed graph composed of vertices (Vertex), edges (Edge), and properties (Property), where the vertices may also be referred to as nodes (nodes) and the edges may also be referred to as relationships (relationships), and where the properties may be defined on the nodes and the edges by the user, and one Property is a self-defined Key-Value pair, such as name: zhangsan, where "name" is a Property Key (Value) and "zhangkasan" is a Property Value (Value). The identifier of the target attribute map may be a name or a code of the target attribute map, and may be specifically set according to an actual situation.
In the implementation, with the development of internet technology, the demand for exploring relevant data from mass data is more urgent, and data analysis based on graph structures is more and more favored. Currently, there are two main graph data structure models: the method comprises the steps of attribute graph and RDF graph, wherein the attribute graph is a graph data model which is used more in engineering practice.
Generally, in a query process of an attribute graph, the attribute graph has a set of Schema definition based on service abstraction (that is, the Schema of the attribute graph refers to metadata of the attribute graph and is used to describe basic information of nodes and edges, such as types of nodes, types of edges, attribute identifiers, attribute types, and the like, the Schema of the attribute graph is an abstraction of entities, relationships, and characteristics in an actual service concept and can also be designed according to a service scenario), and based on the Schema definition, structured or unstructured data can be processed into information of nodes, edges, and attributes that meet the Schema definition constraint and can be stored in a graph database. When a user queries the attribute graph, the data of the required attribute graph is obtained by querying from the graph database through a query language and according to the defined Schema information. However, in the above query method, data to be queried needs to be stored in the graph database in advance, so that when data in the attribute graph is queried, all data of the query result must come from the graph database in which the attribute graph is located, and such a query mode restricts the use of other data sources than the attribute graph. Furthermore, it can be difficult if some property needs to be modified. Specifically, the attribute diagram modification logic process often needs to adjust a pre-construction link of the attribute diagram, and may involve modification and release of the whole construction link, and the influence surface is large, and in addition, the usable data range of the attribute diagram is limited, specifically, data in the attribute diagram completely depends on the pre-construction process of the attribute diagram, and in the environment construction process, there may be data barriers on the environment and the system, and the heterogeneous data sources cannot be fully utilized to obtain the attributes of the complex attribute diagram, and in addition, there are also situations of difficulty in calculating the attributes of the derivative diagram, and the like, wherein, in general, a complex attribute diagram query function needs to be used for combined expression in a query request statement, the combination of the atomized attribute diagram query functions is limited, and the user learning cost is high. Therefore, a technical scheme capable of better expanding the nodes, edges and attributes in the attribute map is needed to be provided, so that the nodes, edges and attributes in the query result of the attribute map are not limited by the map database, and the expression capability of the attribute map is expanded from the viewpoint of data heterogeneity. The embodiment of the present specification provides an implementable technical solution, which may specifically include the following contents:
in order to implement the query of the attribute map by the user, this embodiment improves the existing query system, and introduces a special attribute into the attribute map, and when querying the attribute map, performs uniform processing on data of the attribute map, and finally implements dynamic expansion of the attribute of the static attribute map, specifically, as shown in fig. 2, when a user (i.e., a target user) needs to query a certain attribute map, the corresponding query system may be opened by using a corresponding query device, at this time, the query device may obtain a query page, and may display the query page, the query page may include an information input box for inputting information such as a keyword or a keyword, and a query key and a cancel key, and the target user may input information such as a keyword or a keyword into the information input box, specifically, for example, an identifier of the target attribute map may be input into the information input box, or other information related to the target attribute map, and after the input is completed, the query key may be clicked, at this time, the query device may obtain information input by the target user, and generate a query request of the target attribute map, and the query server may initiate a query request of the query server for the target attribute map.
It should be noted that, when querying related information such as nodes, edges, and the like in an attribute graph, the query method includes a process-based query and an explicit query, where the process-based query represents a Gremlin query method, the query method may be a functional language or a data stream language, and a query process needs to be described by a query language, and the declarative query represents a Cypher query method with Neo4j, and the query language of the query method focuses on a query target rather than a process, so as to reduce the difficulty in using a query language. The query request of the target attribute map initiated by the target user can also be any query mode of process-based query and plain query, and the relevant data stored in the query mode can be acquired from the map database.
In step S104, based on the identifier of the target attribute map, attribute information of an entity included in the target attribute map is obtained from the map database in which the identifier of the target attribute map is located, where the entity includes a node and/or an edge.
The graph database may be a database mentioned in the above for storing related data of the attribute map, and the graph database may include related data of one or more different attribute maps, where the related data may include information (such as an identifier and a type of an entity) of each entity in the attribute map and related information (such as an identifier and a type of an attribute) of the attribute map, which may be specifically set according to an actual situation, and this is not limited in this specification. The entities may include nodes and/or edges in an attribute graph, etc. The attribute information may include an identifier, a type, relationship information and characteristics between entities, and the like, and may be specifically set according to an actual situation.
In implementation, the query request may be analyzed, an identifier of the target attribute graph may be extracted from the query request, and then attribute information of a node and/or attribute information of an edge included in the target attribute graph corresponding to the identifier of the target attribute graph may be acquired from the graph database based on the identifier of the target attribute graph, so that query of the target attribute graph is performed through an attribute graph query language corresponding to a query mode based on a query of a process or a declarative query, and data of an original node and/or data of an edge in the target attribute graph is acquired.
In step S106, if there is attribute information of a first entity matching the extended attribute information in the preconfigured extended database in the attribute information of the entities included in the obtained target attribute map, 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 attribute information of the entities included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database and the information of content expansion of the graph database.
The extended database may be a database different from the graph database, the extended database may be a database formed by expanding the content of the graph database, and the data in the extended database may be data obtained by modifying the data in the graph database or data obtained by extending the data in the graph database. The first entity may include a node and/or an edge, which may be set according to an actual situation, and this is not limited in this embodiment of the present specification.
In the implementation, in the above query method, if more abundant data is integrated into the graph attribute graph, the data needs to be stored in the graph database in advance, and then the data is taken out from the graph database during query, which results in higher cost of data logic change and limits flexibility of data use in the attribute graph. The embodiment improves the attribute graph query mechanism, and by introducing a special attribute into the attribute graph, when querying the attribute graph, the data of the attribute graph is uniformly processed, and finally the dynamic expansion of the attribute of the static attribute graph is realized. Specifically, an extended attribute execution module and an extended attribute configuration module may be set, where the extended attribute configuration module may be used to extend a Schema of an attribute diagram, store metadata of an extended attribute, and may include, for example, content of an extended attribute script, a type of the extended attribute, an identifier of the extended attribute script, and the like, and may be specifically set according to an actual situation, which is not limited in this embodiment of the specification.
Before returning to a target user, an original query result of a target attribute graph (i.e., a query result obtained from a graph database) may be submitted to an extended attribute execution module for further processing, that is, the extended attribute execution module may traverse information of each node and/or edge in the target attribute graph, and for the information of each node, if it is determined, according to attribute information such as an attribute key and an attribute value of each node and in combination with other related information, that attribute information of a first node matching the extended attribute information in a preconfigured extended database exists in the attribute information of the nodes included in the obtained target attribute graph, first extended attribute information matching the attribute information of the first node may be obtained from an extended database, and the first extended attribute information is used to replace the obtained attribute information of the first node in the target attribute graph, so as to obtain the attribute information of the nodes included in the replaced target attribute graph. Accordingly, for each edge, the same operation as the above node is performed, so that the first extended attribute information matching the attribute information of the first edge can be acquired from the extended database, and the acquired first extended attribute information can be used to replace the attribute information of the first edge in the acquired target attribute map, so as to obtain the attribute information of the entity contained in the target attribute map after replacement.
In step S108, the attribute information of the entity included in the replaced target attribute map is used as a query result corresponding to the query request, and the query result is provided to the target user.
The embodiment of the present specification provides a method for querying an attribute map, where a query request of a target attribute map initiated by a target user is obtained, then, based on an identifier of the target attribute map, attribute information of an entity included in the target attribute map is obtained from a map database where the identifier of the target attribute map is located, if attribute information of the entity included in the obtained target attribute map includes attribute information of a first entity that matches extended attribute information in a preconfigured extended database, 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 by the first extended attribute information, so as to obtain attribute information of the entity included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the method comprises the steps of modifying attribute information of entities contained in a target attribute graph in a graph database, content expanding information of the entities contained in the target attribute graph in the graph database, and content expanding information of the graph database, and finally, the attribute information of the entities contained in the target attribute graph after replacement can be provided to a target user as a query result.
Example two
As shown in fig. 3, an execution subject of the method may be a terminal device or a server, where the terminal device may be a certain terminal device such as a mobile phone and a tablet computer, or may also be a computer device such as a notebook computer or a desktop computer, or may also be an IoT device (specifically, a smart watch, a vehicle-mounted device, and the like). The server may be an independent server, or a server cluster formed by a plurality of servers, and the server may be a background server of financial service or online shopping service, or a background server of an application program. In this embodiment, a server is taken as an example to describe in detail, and for the execution process of the terminal device, reference may be made to the following relevant contents, which are not described herein again. The method may specifically comprise the steps of:
in step S302, extended attribute configuration information of a target entity to be extended is obtained, where the target entity is an entity included in a target attribute graph, the target entity includes a node and/or an edge, and 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.
In this embodiment, the target entity takes an entity included in the target attribute graph as an example, that is, the target entity may be a node and/or an edge included in the target attribute graph. The script identifier may be a name, a code, and the like of the script, and may be specifically set according to an actual situation. The extended script information may include information such as script content, and a script corresponding to the extended script information may be an executable file written according to a certain format using a specific descriptive language. The expansion in this embodiment may include expanding in a manner of adding new information on the basis that the original information is not changed, modifying part or all of the information in the original information to further implement the expansion of the original information, or simultaneously executing the two manners to expand the original information, which may be specifically set according to actual conditions.
In implementation, in order to implement application of the extended attribute, an extended attribute configuration module or an extended attribute configuration mechanism may be set, where the extended attribute configuration module or the extended attribute configuration mechanism may be used to store and set extended attribute configuration information, and the extended attribute configuration information may include extended script information, a script identifier (which may be a unique identifier of a script) corresponding to the extended script information, an attribute Key (Key) in a Schema of an associated attribute map, and the like. When the attribute information of a certain attribute graph (i.e., a target attribute graph) or an entity in the certain attribute graph (i.e., a target entity in the target attribute graph) needs to be extended, extended attribute configuration information of the target entity to be extended may be obtained, that is, information such as extended script information corresponding to one or more different nodes contained in the target attribute graph, a script identifier corresponding to the extended script information, and attribute information associated with the extended script information may be obtained, and/or information such as extended script information corresponding to one or more different edges contained in the target attribute graph, a script identifier corresponding to the extended script information, and attribute information associated with the extended script information may be obtained.
In step S304, extended attribute information of the target entity is generated based on the extended attribute configuration information of the target entity, and the extended attribute information of the target entity is configured into the graph database and/or the extended database.
Wherein, the extended attribute information may include one or more of the following information: the information comprises information for modifying the attribute information of the entity contained in the target attribute graph in the graph database, information for carrying out content expansion on the information of the entity contained in the target attribute graph in the graph database, and information for carrying out content expansion on the graph database.
In implementation, considering that the content expansion process is to add information to the original information, the added information is often information that does not exist in the original information, so for the information for content expansion, the extended attribute information of the target entity may be configured in the graph database and the extended database, and for other forms of information expansion, the extended attribute information of the target entity may be configured in the extended database, and the like, which may be specifically set according to actual situations, and this is not limited in this specification.
In practical applications, if the extended attribute configuration information is used to perform content extension on the information of the target entity, the specific processing procedure of step S304 may be various, and an alternative processing manner is provided below, which may specifically include the following processing of step A2 and step A4.
In step A2, extended attribute information of the target entity is generated based on the extended attribute configuration information of the target entity.
In step A4, the generated extended attribute information of the target entity is configured into a target attribute map in the map database and into an extended database.
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 step S304 may be various, and an alternative processing manner is provided below, which may specifically include the following processing of step B2 and step B4.
In step B2, extended attribute information of the target entity is generated based on the extended attribute configuration information of the target entity.
The extended attribute information of the target entity may include an identifier of the target entity and an extended attribute Value of the target entity (i.e., a Key-Value pair formed by the identifier and the Value), and therefore, in the process of generating the extended attribute information of the target entity, the extended attribute Value of the target entity is mainly determined.
In step B4, the generated extended attribute information of the target entity is configured into an extended database.
For the step A2 or the step B2, when the target entity is a node, the specific processing manner may be various, and an optional processing manner is provided below, and the processing may specifically include the processing of the following step C2 and step C4.
In step C2, information of the target entity is acquired, where the acquired information includes one or more of a node identifier, a node type, and an attribute value of the node.
In step C4, the obtained information of the target entity is input into the script corresponding to the extended script information, so as to obtain the extended attribute value of the target entity.
In practical applications, in addition to the above-mentioned processing, the processing may also be performed in the following manner, specifically, the processing in step D2 and step D4 may be referred to below.
In step D2, information of a neighbor node adjacent to the target entity is acquired, and the acquired information of the neighbor node includes one or more of a neighbor node identifier, a neighbor node type, and an attribute value of the neighbor node.
In step D4, the acquired information of the neighbor node is input into the script corresponding to the extended script information, and the extended attribute value of the target entity is obtained.
For the step A2 or the step B2, when the target entity is an edge, the specific processing manner may be various, and an optional processing manner is provided below, and the specific processing manner may specifically include the following processing of the step E2 and the step E4.
In step E2, information of the target entity is acquired, and the acquired information includes one or more of start point information of the edge, target point information of the edge, a type of the edge, and an attribute value of the edge.
In step E4, the obtained information of the target entity is input into the script corresponding to the extended script information, so as to obtain the extended attribute value of the target entity.
In practical applications, in addition to the above-mentioned treatment, the treatment may be performed in the following manner, specifically, the treatment in step F2 and step F4 described below.
In step F2, the information of the adjacent side adjacent to the target entity is obtained, where the obtained information of the adjacent side includes one or more of start point information of the adjacent side, target point information of the adjacent side, type of the adjacent side, and attribute value of the adjacent side.
In step F4, the obtained information of the adjacent edge is input into the script corresponding to the extended script information, so as to obtain the extended attribute value of the target entity.
In step S306, based on a preset communication interaction manner, extended data related to the target entity and used for content extension of the graph database is acquired from another data source, and the acquired extended data is configured into an extended database as an extended attribute value of the target entity.
The preset communication interaction mode comprises one or more of a Remote Procedure Call (RPC) based communication interaction mode, a file reading based communication interaction mode and a memory sharing based communication interaction mode.
In practical applications, two or more processing manners of the above-mentioned processing manners C2-C4, D2-D4, E2-E4, F2-F4 and step S306 may be selected to obtain the extended attribute value of the target entity.
The graph database and the extended database can be obtained through the specific processing of the above step S302 to step S306, and the query processing of the attribute graph can be performed based on the graph database and the extended database, which can be specifically referred to the processing of the following step S308 to step S320.
In step S308, a query request of the target attribute map initiated by the target user is obtained, where the query request includes an identifier of the target attribute map.
In step S310, based on the identifier of the target attribute map, attribute information of an entity included in the target attribute map is obtained from the map database in which the identifier of the target attribute map is located, where the entity includes a node and/or an edge.
For the specific processing procedures of step S308 and step S310, reference may be made to the relevant contents in the first embodiment, and details are not described herein again.
In step S312, if there is attribute information of the first entity matching the extended attribute information in the pre-configured extended database in the attribute information of the entities included in the obtained target attribute map, an identifier of the first entity is obtained from the attribute information of the first entity.
In implementation, the extended attribute execution module processes corresponding data in combination with original graph data generated by the attribute graph query mechanism and extended attribute configuration information in the extended attribute configuration module to obtain extended graph data, specifically, as shown in fig. 4, traversing each attribute information in each node and each edge in the target attribute graph, and requesting the extended attribute configuration module to determine whether attribute information matching extended attribute information in a preconfigured extended database exists in the attribute information of an entity included in the target attribute graph according to feature information of an attribute key therein, if not, continuing traversing the attribute information of the next entity, otherwise, obtaining an identifier of the first entity from the attribute information of the first entity, and continuing to perform the processing of the following step S314.
In step S314, a script identifier corresponding to the identifier of the first entity is obtained from the extended database based on the identifier of the first entity.
In step S316, extended script information corresponding to the script identifier is obtained from the extended database, a script corresponding to the obtained extended script information is executed, and a corresponding execution result is obtained, where the execution result is used as an extended attribute value in the first extended attribute information that matches the attribute information of the first entity.
In implementation, as shown in fig. 4, the extended attribute configuration module may be requested to obtain preconfigured extended script information through the attribute key and the attribute value (i.e., script identifier) of the extended attribute, and then, the logic of the script corresponding to the extended script information may be executed to obtain an actual extended attribute value (i.e., execution result), 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.
In step S318, the first extended attribute information is used to replace the attribute information of the first entity, so as to obtain the attribute information of the entity included in the replaced target attribute map.
In step S320, the attribute information of the entity included in the replaced target attribute map is used as a query result corresponding to the query request, and the query result is provided to the target user.
The embodiment of the present specification provides a method for querying an attribute map, where a query request of a target attribute map initiated by a target user is obtained, then, based on an identifier of the target attribute map, attribute information of an entity included in the target attribute map is obtained from a map database where the identifier of the target attribute map is located, if attribute information of the entity included in the obtained target attribute map includes attribute information of a first entity that matches extended attribute information in a preconfigured extended database, 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 by the first extended attribute information, so as to obtain attribute information of the entity included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the method comprises the steps of modifying attribute information of an entity contained in a target attribute map in a map database, expanding content of the entity contained in the target attribute map in the map database, and expanding content of the map database, and finally providing the replaced attribute information of the entity contained in the target attribute map as a query result to a target user.
EXAMPLE III
Based on the same idea, the foregoing attribute graph query method provided in this embodiment of this specification further provides an attribute graph query device, as shown in fig. 5.
The query device of the attribute map comprises: a query request module 501, an attribute obtaining module 502, an attribute replacing module 503 and a query result output module 504, wherein:
a query request module 501, configured to obtain a query request of a target attribute map initiated by a target user, where the query request includes an identifier of the target attribute map;
an attribute obtaining module 502, configured to obtain attribute information of an entity included in the target attribute map from a map database in which the identifier of the target attribute map is located, where the entity includes a node and/or an edge, based on the identifier of the target attribute map;
an attribute replacing module 503, configured to, if attribute information of a first entity that matches the extended attribute information in a preconfigured extended database exists in the acquired attribute information of the entity included in the target attribute map, acquire first extended attribute information that matches the attribute information of the first entity, and replace the attribute information of the first entity with the first extended attribute information, to obtain attribute information of the entity included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database, and the information of content expansion of the graph database;
and the query result output module 504 is configured to take the replaced attribute information of the entity included in the target attribute map as a query result corresponding to the query request, and provide the query result to the target user.
In an embodiment of this specification, the apparatus further includes:
the extended configuration module is used for acquiring extended attribute configuration information of a target entity to be extended, wherein the target entity is an entity contained in the target attribute graph and comprises nodes and/or edges, and the extended attribute configuration information comprises extended script information, a script identifier corresponding to the extended script information and attribute information associated with the extended script information;
and the extended attribute generating module is used for 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.
In an embodiment of this specification, the extended attribute configuration information is used to perform content extension on the information of the target entity, and the extended attribute generating module includes:
an extended attribute generating unit that generates extended attribute information of the target entity based on extended attribute configuration information of the target entity;
the extended attribute storage unit is used for configuring the generated extended attribute information of the target entity into the target attribute graph in the graph database and into the extended database; alternatively, the first and second electrodes may be,
the extended attribute configuration information is used to modify the attribute information of the target entity, and the extended attribute generation module includes:
an extended attribute generating unit that generates extended attribute information of the target entity based on extended attribute configuration information of the target entity;
and the extended attribute storage unit is used for configuring the generated extended attribute information of the target entity into the extended database.
In an embodiment of this specification, the target entity is a node, and the extended attribute generation unit acquires information of the target entity, where the acquired information includes one or more of a node identifier, a node type, and an attribute value of the node; inputting the acquired information of the target entity into a script corresponding to the extended script information to obtain an extended attribute value of the target entity; and/or the presence of a gas in the gas,
the target entity is a node, the extended attribute generation unit acquires information of neighbor nodes adjacent to the target entity, and the acquired information of the neighbor nodes comprises one or more of neighbor node identification, neighbor node types and neighbor node attribute values; and inputting the acquired information of the neighbor nodes into a script corresponding to the extended script information to obtain an extended attribute value of the target entity.
In an embodiment of this specification, the target entity is an edge, and the extended attribute generating unit obtains information of the target entity, where the obtained information includes one or more of start point information of the edge, target point information of the edge, a type of the edge, and an attribute value of the edge; inputting the acquired information of the target entity into a script corresponding to the extended script information to obtain an extended attribute value of the target entity; and/or the presence of a gas in the atmosphere,
the target entity is a side, the extended attribute generating unit acquires information of an adjacent side adjacent to the target entity, and the acquired information of the adjacent side comprises one or more of starting point information of the adjacent side, target point information of the adjacent side, the type of the adjacent side and an attribute value of the adjacent side; and inputting the acquired information of the adjacent edge into a script corresponding to the extended script information to obtain an extended attribute value of the target entity.
In an embodiment of this specification, the apparatus further includes:
and the database extension module is used for acquiring extension data which is related to the target entity and is used for extending the content of the graph database from other data sources based on a preset communication interaction mode, and configuring the acquired extension data into the extension database as an extension attribute value of the target entity.
In an embodiment of the present specification, the preset communication interaction mode includes one or more of a remote procedure call RPC-based communication interaction mode, a file reading-based communication interaction mode, and a memory sharing-based communication interaction mode.
In this embodiment of the present specification, the attribute replacement module 503 includes:
an identifier acquiring unit that acquires an identifier of the first entity from attribute information of the first entity;
the script acquisition unit is used for acquiring a script identifier corresponding to the identifier of the first entity from the extended database based on the identifier of the first entity;
and the extended attribute determining unit is used for acquiring extended script information corresponding to the script identifier from the extended database, executing the script corresponding to the acquired extended script information to obtain a corresponding execution result, and taking the execution result as an extended attribute value in the first extended attribute information matched with the attribute information of the first entity.
The embodiment of the present specification provides an attribute map query device, which obtains a query request of a target attribute map initiated by a target user, and then, based on an identifier of the target attribute map, obtains attribute information of an entity included in the target attribute map from a map database where the identifier of the target attribute map is located, and if attribute information of a first entity matching extended attribute information in a preconfigured extended database exists in the obtained attribute information of the entity included in the target attribute map, obtains 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, to obtain attribute information of the entity included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the method comprises the steps of modifying attribute information of an entity contained in a target attribute map in a map database, expanding content of the entity contained in the target attribute map in the map database, and expanding content of the map database, and finally providing the replaced attribute information of the entity contained in the target attribute map as a query result to a target user.
Example four
Based on the same idea, the attribute map query apparatus provided in the embodiment of the present specification further provides a query device for an attribute map, as shown in fig. 6.
The query device of the attribute map may provide terminal devices or servers and the like for the above embodiments.
The querying device of the attribute map may have a relatively large difference due to different configurations or performances, and may include one or more processors 601 and a memory 602, where one or more stored applications or data may be stored in the memory 602. Wherein the memory 602 may be transient storage or persistent storage. The application program stored in memory 602 may include one or more modules (not shown), each of which may include a series of computer-executable instructions in a querying device for a property graph. Still further, processor 601 may be configured to communicate with memory 602 to execute a series of computer-executable instructions in memory 602 on a querying device for the property map. The querying device of the property diagram 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, one or more keyboards 606.
In particular, in this embodiment, the query device for the property graph includes a memory, and one or more programs, where the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the query device for the property graph, and the one or more programs configured to be executed by the one or more processors include computer-executable instructions for:
acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph;
acquiring attribute information of entities contained in the target attribute graph from a graph database in which the target attribute graph identifier is located based on the identifier of the target attribute graph, wherein the entities comprise nodes and/or edges;
if the attribute information of the first entity, which is matched with the attribute information of the first entity in a pre-configured extended database, exists in the acquired attribute information of the entity in the target attribute map, acquiring first extended attribute information matched with 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 attribute information of the entity in the target attribute map after replacement, wherein the extended attribute information comprises one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database, and the information of content expansion of the graph database;
and taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request, and providing the query result for the target user.
In the embodiment of this specification, the method further includes:
acquiring extended attribute configuration information of a target entity to be extended, wherein the target entity is an entity contained in the target attribute graph and comprises nodes and/or edges, and the extended attribute configuration information comprises extended script information, a script identifier corresponding to the extended script information and attribute information associated with the extended script information;
and 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.
In an embodiment of this specification, the expanding attribute configuration information is used to expand content of the information of the target entity, and the generating of the expanding attribute information of the target entity based on the expanding attribute configuration information of the target entity and the configuring of the expanding attribute information of the target entity into the graph database and/or the expanding database includes:
generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity;
configuring the generated extended attribute information of the target entity to the target attribute graph in the graph database and to the extended database; alternatively, the first and second electrodes may be,
the extended attribute configuration information is used for modifying the attribute information of the target entity, the extended attribute information of the target entity is generated based on the extended attribute configuration information of the target entity, and the extended attribute information of the target entity is configured into the graph database and/or the extended database, and the method comprises the following steps:
generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity;
and configuring the generated extended attribute information of the target entity into the extended database.
In an embodiment of this specification, the target entity is a node, and the generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of the target entity, wherein the acquired information comprises one or more of node identification, node type and attribute value of the node;
inputting the acquired information of the target entity into a script corresponding to the extended script information to obtain an extended attribute value of the target entity; and/or the presence of a gas in the gas,
the target entity is a node, and the generating of the extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of neighbor nodes adjacent to the target entity, wherein the acquired information of the neighbor nodes comprises one or more of neighbor node identification, neighbor node types and attribute values of the neighbor nodes;
and inputting the acquired information of the neighbor nodes into a script corresponding to the extended script information to obtain an extended attribute value of the target entity.
In an embodiment of this specification, the generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of the target entity, wherein the acquired information comprises one or more of starting point information of the edge, target point information of the edge, the type of the edge and an attribute value of the edge;
inputting the acquired information of the target entity into a script corresponding to the extended script information to obtain an extended attribute value of the target entity; and/or the presence of a gas in the gas,
the generating of the extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of an adjacent side adjacent to the target entity, wherein the acquired information of the adjacent side comprises one or more of starting point information of the adjacent side, target point information of the adjacent side, the type of the adjacent side and the attribute value of the adjacent side;
and inputting the acquired information of the adjacent edges into a script corresponding to the extended script information to obtain an extended attribute value of the target entity.
In the embodiment of this specification, the method further includes:
and acquiring extension data which is related to the target entity and is used for expanding the content of the graph database from other data sources based on a preset communication interaction mode, and configuring the acquired extension data into the extension database as an extension attribute value of the target entity.
In an embodiment of the present specification, the preset communication interaction mode includes one or more of a remote procedure call RPC-based communication interaction mode, a file reading-based communication interaction mode, and a memory sharing-based communication interaction mode.
In an embodiment of this specification, the acquiring first extended attribute information that matches with the attribute information of the first entity includes:
acquiring the identifier of the first entity from the attribute information of the first entity;
acquiring a script identifier corresponding to the identifier of the first entity from the extended database based on the identifier of the first entity;
and acquiring extended script information corresponding to the script identifier from the extended database, executing the script corresponding to the acquired extended script information to obtain a corresponding execution result, and taking the execution result as an extended attribute value in first extended attribute information matched with the attribute information of the first entity.
The embodiment of the present specification provides an attribute map query device, which obtains a query request of a target attribute map initiated by a target user, then, based on an identifier of the target attribute map, obtains attribute information of an entity included in the target attribute map from a map database in which the identifier of the target attribute map is located, if there is attribute information of a first entity matching extended attribute information in a preconfigured extended database in the attribute information of the entity included in the obtained target attribute map, obtains 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, to obtain the attribute information of the entity included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the method comprises the steps of modifying attribute information of entities contained in a target attribute graph in a graph database, content expanding information of the entities contained in the target attribute graph in the graph database, and content expanding information of the graph database, and finally, the attribute information of the entities contained in the target attribute graph after replacement can be provided to a target user as a query result.
EXAMPLE five
Further, based on the methods shown in fig. 1 to fig. 4, one or more embodiments of the present specification further provide a storage medium for storing computer-executable instruction information, in a specific embodiment, the storage medium may be a usb disk, an optical disk, a hard disk, or the like, and when executed by a processor, the storage medium stores the computer-executable instruction information, which can implement the following processes:
acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph;
acquiring attribute information of entities contained in the target attribute graph from a graph database in which the target attribute graph identifier is located based on the identifier of the target attribute graph, wherein the entities comprise nodes and/or edges;
if the attribute information of the first entity matched with the extended attribute information in the pre-configured extended database exists in the acquired attribute information of the entity contained in the target attribute map, acquiring first extended attribute information matched with 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 attribute information of the entity contained in the target attribute map after replacement, wherein the extended attribute information comprises one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database, and the information of content expansion of the graph database;
and taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request, and providing the query result for the target user.
In the embodiment of this specification, the method further includes:
acquiring extended attribute configuration information of a target entity to be extended, wherein the target entity is an entity contained in the target attribute graph and comprises nodes and/or edges, and the extended attribute configuration information comprises extended script information, a script identifier corresponding to the extended script information and attribute information associated with the extended script information;
and 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.
In an embodiment of this specification, the expanding attribute configuration information is used to perform content expansion on information of the target entity, and the generating expanding attribute information of the target entity based on the expanding attribute configuration information of the target entity and configuring the expanding attribute information of the target entity into the map database and/or the expanding database includes:
generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity;
configuring the generated extended attribute information of the target entity to the target attribute graph in the graph database and to the extended database; alternatively, the first and second liquid crystal display panels may be,
the extended attribute configuration information is used for modifying the attribute information of the target entity, the extended attribute information of the target entity is generated based on the extended attribute configuration information of the target entity, and the extended attribute information of the target entity is configured into the graph database and/or the extended database, and the method comprises the following steps:
generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity;
and configuring the generated extended attribute information of the target entity into the extended database.
In an embodiment of this specification, the target entity is a node, and generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of the target entity, wherein the acquired information comprises one or more of a node identifier, a node type and an attribute value of a node;
inputting the acquired information of the target entity into a script corresponding to the extended script information to obtain an extended attribute value of the target entity; and/or the presence of a gas in the gas,
the target entity is a node, and the generating of the extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of neighbor nodes adjacent to the target entity, wherein the acquired information of the neighbor nodes comprises one or more of neighbor node identification, neighbor node types and attribute values of the neighbor nodes;
and inputting the acquired information of the neighbor nodes into a script corresponding to the extended script information to obtain an extended attribute value of the target entity.
In an embodiment of this specification, the generating extension attribute information of the target entity based on the extension attribute configuration information of the target entity includes:
acquiring information of the target entity, wherein the acquired information comprises one or more of starting point information of the edge, target point information of the edge, the type of the edge and an attribute value of the edge;
inputting the acquired information of the target entity into a script corresponding to the extended script information to obtain an extended attribute value of the target entity; and/or the presence of a gas in the gas,
the generating of the extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of an adjacent side adjacent to the target entity, wherein the acquired information of the adjacent side comprises one or more of starting point information of the adjacent side, target point information of the adjacent side, the type of the adjacent side and the attribute value of the adjacent side;
and inputting the acquired information of the adjacent edge into a script corresponding to the extended script information to obtain an extended attribute value of the target entity.
In the embodiment of this specification, the method further includes:
and acquiring extended data which is related to the target entity and is used for expanding the content of the graph database from other data sources based on a preset communication interaction mode, and configuring the acquired extended data into an extended database as an extended attribute value of the target entity.
In an embodiment of the present specification, the preset communication interaction mode includes one or more of 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.
In an embodiment of this specification, the acquiring first extended attribute information that matches with the attribute information of the first entity includes:
acquiring the identifier of the first entity from the attribute information of the first entity;
acquiring a script identifier corresponding to the identifier of the first entity from the extended database based on the identifier of the first entity;
and acquiring extended script information corresponding to the script identifier from the extended database, executing the script corresponding to the acquired extended script information to obtain a corresponding execution result, and taking the execution result as an extended attribute value in first extended attribute information matched with the attribute information of the first entity.
The embodiment of the present specification provides a storage medium, where a query request of a target attribute map initiated by a target user is obtained, then, based on an identifier of the target attribute map, attribute information of an entity included in the target attribute map is obtained from a map database where the identifier of the target attribute map is located, if attribute information of the entity included in the obtained target attribute map includes attribute information of a first entity that matches extended attribute information in a preconfigured extended database, 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 by the first extended attribute information, so as to obtain attribute information of the entity included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the method comprises the steps of modifying attribute information of an entity contained in a target attribute map in a map database, expanding content of the entity contained in the target attribute map in the map database, and expanding content of the map database, and finally providing the replaced attribute information of the entity contained in the target attribute map as a query result to a target user.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain a corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is an integrated circuit whose Logic functions are determined by a user programming the Device. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as ABEL (Advanced Boolean Expression Language), AHDL (alternate Hardware Description Language), traffic, CUPL (core universal Programming Language), HDCal, jhddl (Java Hardware Description Language), lava, lola, HDL, PALASM, rhyd (Hardware Description Language), and vhigh-Language (Hardware Description Language), which is currently used in most popular applications. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium that stores computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be conceived to be both a software module implementing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the various elements may be implemented in the same one or more software and/or hardware implementations in implementing one or more embodiments of the present description.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
Embodiments of the present description are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable fraud case serial-parallel apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable fraud case serial-parallel apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable fraud case to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable fraud case series of parallel devices to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of the present description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and so forth) having computer-usable program code embodied therein.
One or more embodiments of the present description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the system embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and reference may be made to the partial description of the method embodiment for relevant points.
The above description is only an example of the present specification, and is not intended to limit the present application. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (11)

1. A method for querying an attribute map, the method comprising:
acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph;
acquiring attribute information of entities contained in the target attribute graph from a graph database in which the target attribute graph identifier is located based on the identifier of the target attribute graph, wherein the entities comprise nodes and/or edges;
if the attribute information of the first entity matched with the extended attribute information in the pre-configured extended database exists in the acquired attribute information of the entity contained in the target attribute map, acquiring first extended attribute information matched with 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 attribute information of the entity contained in the target attribute map after replacement, wherein the extended attribute information comprises one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database, and the information of content expansion of the graph database;
and taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request, and providing the query result for the target user.
2. The method of claim 1, further comprising:
obtaining extended attribute configuration information of a target entity to be extended, wherein the target entity is an entity contained in the target attribute graph and comprises nodes and/or edges, and the extended attribute configuration information comprises extended script information, a script identifier corresponding to the extended script information and attribute information associated with the extended script information;
and 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.
3. The method according to claim 2, wherein the extended attribute configuration information is used for content extension of information of the target entity, and the generating and configuring extended attribute information of the target entity into the map database and/or the extended database based on the extended attribute configuration information of the target entity comprises:
generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity;
configuring the generated extended attribute information of the target entity to the target attribute graph in the graph database and to the extended database; alternatively, the first and second electrodes may be,
the modifying the attribute information of the target entity by the extended attribute configuration information, generating the 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:
generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity;
and configuring the generated extended attribute information of the target entity into the extended database.
4. The method of claim 3, wherein the target entity is a node, and the generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity comprises:
acquiring information of the target entity, wherein the acquired information comprises one or more of a node identifier, a node type and an attribute value of a node;
inputting the acquired information of the target entity into a script corresponding to the extended script information to obtain an extended attribute value of the target entity; and/or the presence of a gas in the gas,
the target entity is a node, and the generating of the extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of neighbor nodes adjacent to the target entity, wherein the acquired information of the neighbor nodes comprises one or more of neighbor node identification, neighbor node types and attribute values of the neighbor nodes;
and inputting the acquired information of the neighbor nodes into a script corresponding to the extended script information to obtain an extended attribute value of the target entity.
5. The method of claim 3, wherein the target entity is an edge, and the generating extended attribute information of the target entity based on the extended attribute configuration information of the target entity comprises:
acquiring information of the target entity, wherein the acquired information comprises one or more of starting point information of the edge, target point information of the edge, the type of the edge and an attribute value of the edge;
inputting the acquired information of the target entity into a script corresponding to the extended script information to obtain an extended attribute value of the target entity; and/or the presence of a gas in the atmosphere,
the generating of the extended attribute information of the target entity based on the extended attribute configuration information of the target entity includes:
acquiring information of an adjacent side adjacent to the target entity, wherein the acquired information of the adjacent side comprises one or more of starting point information of the adjacent side, target point information of the adjacent side, the type of the adjacent side and the attribute value of the adjacent side;
and inputting the acquired information of the adjacent edges into a script corresponding to the extended script information to obtain an extended attribute value of the target entity.
6. The method of claim 1, further comprising:
and acquiring extension data which is related to the target entity and is used for expanding the content of the graph database from other data sources based on a preset communication interaction mode, and configuring the acquired extension data into the extension database as an extension attribute value of the target entity.
7. The method of claim 6, wherein the preset communication interaction mode comprises one or more of a Remote Procedure Call (RPC) based communication interaction mode, a file reading based communication interaction mode and a memory sharing based communication interaction mode.
8. The method of claim 1, the obtaining first extended attribute information that matches attribute information of the first entity, comprising:
acquiring the identifier of the first entity from the attribute information of the first entity;
acquiring a script identifier corresponding to the identifier of the first entity from the extended database based on the identifier of the first entity;
and acquiring extended script information corresponding to the script identifier from the extended database, executing the script corresponding to the acquired extended script information to obtain a corresponding execution result, and taking the execution result as an extended attribute value in first extended attribute information matched with the attribute information of the first entity.
9. An apparatus for querying an attribute map, the apparatus comprising:
the query request module is used for acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph;
the attribute acquisition module is used for acquiring attribute information of an entity contained in the target attribute graph from a graph database where the identifier of the target attribute graph is located based on the identifier of the target attribute graph, wherein the entity comprises a node and/or an edge;
an attribute replacement module, configured to, if attribute information of a first entity that matches extended attribute information in a preconfigured extended database exists in the acquired attribute information of the entity included in the target attribute map, acquire first extended attribute information that matches the attribute information of the first entity, and replace the attribute information of the first entity with the first extended attribute information, to obtain attribute information of the entity included in the target attribute map after replacement, where the extended attribute information includes one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database, and the information of content expansion of the graph database;
and the query result output module is used for taking the attribute information of the entity contained in the replaced target attribute graph as a query result corresponding to the query request and providing the query result to the target user.
10. An attribute map query device, the attribute map query device comprising:
a processor; and
a memory arranged to store computer executable instructions that, when executed, cause the processor to:
acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph;
acquiring attribute information of entities contained in the target attribute graph from a graph database in which the target attribute graph identifier is located based on the identifier of the target attribute graph, wherein the entities comprise nodes and/or edges;
if the attribute information of the first entity matched with the extended attribute information in the pre-configured extended database exists in the acquired attribute information of the entity contained in the target attribute map, acquiring first extended attribute information matched with 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 attribute information of the entity contained in the target attribute map after replacement, wherein the extended attribute information comprises one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database, and the information of content expansion of the graph database;
and taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request, and providing the query result for the target user.
11. A storage medium for storing computer-executable instructions, which when executed by a processor implement the following:
acquiring a query request of a target attribute graph initiated by a target user, wherein the query request comprises an identifier of the target attribute graph;
acquiring attribute information of entities contained in the target attribute graph from a graph database in which the target attribute graph identifier is located based on the identifier of the target attribute graph, wherein the entities comprise nodes and/or edges;
if the attribute information of the first entity, which is matched with the attribute information of the first entity in a pre-configured extended database, exists in the acquired attribute information of the entity in the target attribute map, acquiring first extended attribute information matched with 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 attribute information of the entity in the target attribute map after replacement, wherein the extended attribute information comprises one or more of the following information: the information of modifying the attribute information of the entity contained in the target attribute graph in the graph database, the information of content expansion of the entity information contained in the target attribute graph in the graph database, and the information of content expansion of the graph database;
and taking the attribute information of the entity contained in the target attribute graph after replacement as a query result corresponding to the query request, and providing the query result for the target user.
CN202211084427.5A 2022-09-06 2022-09-06 Attribute graph query method, device and equipment Pending CN115391378A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211084427.5A CN115391378A (en) 2022-09-06 2022-09-06 Attribute graph query method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211084427.5A CN115391378A (en) 2022-09-06 2022-09-06 Attribute graph query method, device and equipment

Publications (1)

Publication Number Publication Date
CN115391378A true CN115391378A (en) 2022-11-25

Family

ID=84125384

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211084427.5A Pending CN115391378A (en) 2022-09-06 2022-09-06 Attribute graph query method, device and equipment

Country Status (1)

Country Link
CN (1) CN115391378A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905266A (en) * 2022-12-29 2023-04-04 支付宝(杭州)信息技术有限公司 Processing method of graph structure data and storage engine for graph structure data

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115905266A (en) * 2022-12-29 2023-04-04 支付宝(杭州)信息技术有限公司 Processing method of graph structure data and storage engine for graph structure data

Similar Documents

Publication Publication Date Title
CN107562467B (en) Page rendering method, device and equipment
CN109597661B (en) Service function configuration method and device
CN110990804B (en) Resource access method, device and equipment
CN106970936B (en) Data processing method and device and data query method and device
CN107562775B (en) Data processing method and device based on block chain
CN107391101B (en) Information processing method and device
CN109344348B (en) Resource updating method and device
CN110245002B (en) System interaction method, device, equipment and storage medium
CN116841988A (en) Data migration method, device and equipment applied to blockchain
CN109947643B (en) A/B test-based experimental scheme configuration method, device and equipment
CN110569428A (en) recommendation model construction method, device and equipment
CN111158650B (en) Report template and report generation method and device
CN110781192A (en) Verification method, device and equipment of block chain data
CN115391378A (en) Attribute graph query method, device and equipment
CN115982416A (en) Data processing method and device, readable storage medium and electronic equipment
CN106156050B (en) Data processing method and device
CN114238345A (en) Database processing and data query method and device
CN111309737A (en) List query method, device and equipment
CN115390852A (en) Method and device for generating uniform abstract syntax tree and program analysis
CN114629951A (en) Address service switching method and device, computer equipment and storage medium
CN110955653A (en) Data page processing method, device, equipment and computer system
CN117041980B (en) Network element management method and device, storage medium and electronic equipment
CN116028504B (en) Data lake metadata management method and device
CN110175020B (en) Frame attribute information expansion method and device, and frame loading method and device
CN107391525B (en) Instruction processing method and device for database

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination