CN114943004B - Attribute graph query method, attribute graph query device, and storage medium - Google Patents

Attribute graph query method, attribute graph query device, and storage medium Download PDF

Info

Publication number
CN114943004B
CN114943004B CN202210886632.7A CN202210886632A CN114943004B CN 114943004 B CN114943004 B CN 114943004B CN 202210886632 A CN202210886632 A CN 202210886632A CN 114943004 B CN114943004 B CN 114943004B
Authority
CN
China
Prior art keywords
query
graph
attribute
data
steps
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.)
Active
Application number
CN202210886632.7A
Other languages
Chinese (zh)
Other versions
CN114943004A (en
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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN202210886632.7A priority Critical patent/CN114943004B/en
Publication of CN114943004A publication Critical patent/CN114943004A/en
Application granted granted Critical
Publication of CN114943004B publication Critical patent/CN114943004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/53Querying

Landscapes

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

Abstract

The application discloses an attribute graph query method, an attribute graph query device and a computer storage medium, wherein the attribute graph query method comprises the following steps: acquiring a query instruction of a user; analyzing the query instruction, and generating a plurality of query steps according to an analysis result, wherein each query step corresponds to at least one query object; searching a plurality of initial query graph data from a graph database based on a query object in the first query step; determining query path cost based on query objects in the rest query steps, and acquiring query batch according to the query path cost; and searching final query graph data from the initial query graph data according to the query batch number. By the method, the query batch number can be calculated based on the statistical result of each attribute in the attribute graph, graph query is performed in parallel according to the query batch number so as to optimize the query process, and the query speed is increased.

Description

Attribute graph query method, attribute graph query device, and storage medium
Technical Field
The present invention relates to the field of graph databases, and in particular, to an attribute graph query method, an attribute graph query device, and a storage medium.
Background
As the digital transformation of enterprises in various industries continues to increase, more and more data is generated, and thus a database is required to store the data. Among them, graph databases, which have great advantages in handling the associative relations, have become the most popular choice in the current market for fields sensitive to the relations between data, such as social networks, communications, etc., due to the increasing amount of relational data. Graph databases can flexibly operate between a large number of data relationships.
In an application scenario, when a user queries data in a graph database, the graph database generates a query index according to a query instruction of the user, and queries the data in the database based on the query index. In the execution process of the query, the graph database needs to traverse all data according to the query index to find the desired result, and the execution process needs to query all data once in the worst case, so that the query speed is low. When the amount of data is large, a lot of time is consumed.
Disclosure of Invention
The technical problem mainly solved by the present application is how to improve the query speed of the attribute map, and to this end, the present application provides an attribute map query method, an attribute map query device, and a storage medium.
In order to solve the technical problem, the application adopts a technical scheme that: a method for querying an attribute graph is provided, and comprises the following steps: acquiring a query instruction of a user; analyzing the query instruction, and generating a plurality of query steps according to an analysis result, wherein each query step corresponds to at least one query object; searching a plurality of primary query graph data from a graph database based on a query object in the first query step; determining query path cost based on query objects in the rest query steps, and acquiring query batch according to the query path cost; and searching final query graph data from the primary query graph data according to the query batch number.
The query instruction at least comprises a query object of the query graph data, and the query object is a data category of the query graph data.
Wherein, based on the query objects of the rest query steps, determining the query path cost comprises: acquiring query graph attributes corresponding to each query object in the rest query steps; calculating a graph attribute expected value of each query graph attribute; and determining the query path cost based on the expected value of the graph attribute.
The method for acquiring the query batch number according to the query path cost comprises the following steps: and acquiring query batch according to the query path cost and the quantity of the query graph data required in the query instruction.
Determining the query path cost based on the expected value of the graph attribute comprises the following steps: acquiring the query sequence of the rest query steps; calculating corresponding query step cost based on the expected value of the graph attribute; and determining the query path cost according to the query sequence and the query step cost.
Determining the query path cost according to the query sequence and the query step cost, wherein the determining the query path cost comprises the following steps: acquiring the number of query objects corresponding to each query step; calculating the product of the number of the query objects corresponding to each query step and the last query step based on the number of the query objects according to the query sequence; a query path cost is determined based on the product and the query step cost.
The method for calculating the graph attribute expected value of each query graph attribute comprises the following steps: acquiring the total query number of each query graph attribute in a database and the query number of specific classifications in the query graph attributes; and determining the expected value of the graph attribute of the query graph attribute based on the ratio of the minimum value in the query quantity of the specific classification to the total query quantity.
After obtaining the query graph attribute corresponding to each query object in the rest of query steps, the method further includes: judging whether all query graph attributes have graph attribute expected values; if not, setting the query path cost as the product of the required query graph data quantity and a preset coefficient.
The method for searching the final query graph data from the initial query graph data according to the query batch number comprises the following steps: setting the quantity of each query based on the obtained query batch quantity; and performing parallel query in the initial query graph data based on the number of each query, and searching the final query graph data.
After searching a plurality of initial query graph data from a graph database based on a query object in the first query step, the method further comprises the following steps: judging whether the query object in the rest query steps has the query graph attribute; if not, the query cost value is set to be a preset value, and the final query graph data is searched from the primary query graph data according to the preset value.
In order to solve the technical problem, the other technical scheme adopted by the application is as follows: the attribute map query device comprises a processor and a memory, wherein the memory is coupled with the processor, the memory stores program data, and the processor is used for executing the program data to realize the attribute map query method.
In order to solve the above technical problem, another technical solution adopted by the present application is: there is provided a computer-readable storage medium storing program data for implementing the above-described attribute map query method when the program data is executed.
The beneficial effect of this application is: different from the situation of the prior art, the attribute graph query method provided by the application is applied to an attribute graph query device, and the attribute graph query device acquires a query instruction of a user; analyzing the query instruction, and generating a plurality of query steps according to the analysis result, wherein each query step corresponds to at least one query object; searching a plurality of primary query graph data from a graph database based on a query object in the first query step; determining query path cost based on query objects in other query steps, and acquiring query batch according to the query path cost; and searching final query graph data from the primary query graph data according to the query batch number. Through the mode, compared with the conventional attribute graph query method, the method for calculating the query batch number by using the attribute graph query device after analyzing the query instruction obtained from the user based on the graph attribute expected value of the query graph attribute in the query instruction can optimize and set the number of parallel queries at each time based on the number of data in the database to be queried so as to achieve the effects of reasonably setting the query batch number and reasonably optimizing the query process. The attribute graph query method can generate graph attribute expected values based on statistical results of attribute graph data and obtain the quantity of parallel queries each time, can more effectively perform query operation, reasonably sets the query quantity under the condition of ensuring query speed, and does not waste database resources.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts. Wherein:
FIG. 1 is a flowchart illustrating a first embodiment of a method for querying a property graph provided in the present application;
FIG. 2 is a flowchart illustrating an attribute map query method executed by the attribute map query apparatus according to the present application;
FIG. 3 is a flowchart illustrating an embodiment of a method step 14 for querying a property graph provided in the present application;
FIG. 4 is a flowchart illustrating a query process performed by the attribute map query device of the present application;
FIG. 5 is a schematic structural diagram of a first embodiment of an attribute map query device provided in the present application;
fig. 6 is a schematic structural diagram of a second embodiment of an attribute map query device provided in the present application;
FIG. 7 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1 and fig. 2, fig. 1 is a schematic flowchart of a first embodiment of an attribute map query method provided by the present application, and fig. 2 is a schematic flowchart of an attribute map query method executed by an attribute map query device provided by the present application.
The attribute map query method provided by the application is applied to a map database, data in the map database is stored in the format of an attribute map, and the data types in the database can be people, events, objects and the like, and are not limited herein. An attribute graph is a directed graph composed of vertices, edges, labels, and attributes, where the vertices are also called nodes, and each node represents an entity, such as a specific person or thing. Categories or other data, etc., edges are also referred to as relationships, representing the connection relationship between two nodes. The label is the type of the node or the relationship, the attribute is additional description information of the node or the relationship, taking a node 'Xiaoming' as an example, a 'person' is the label of the node, and a 'gender' and an 'age' can be the attribute of the node.
As shown in fig. 1 and fig. 2, the attribute map query method according to the embodiment of the present application includes:
step 11: and acquiring a query instruction of a user.
Specifically, the user may select the data to be queried on a display screen of the attribute map query device by checking or directly inputting a query condition, and the attribute map query device may obtain a query instruction of the user based on an operation of the user.
In one embodiment of the present application, the user-selected graph database may be a database containing both person and event tag types, in which the relationships between specific persons and specific events are stored. Taking an example that the user wants to query a male with a height of 185 who loiters near china bank, the user may select a query object in the query object list as a person and an event, select a height attribute of 185 persons and a gender attribute as men under the corresponding query object list, select a location attribute of the event as near china bank, and select an action attribute as loitering. The user may also enter all query terms directly within the search box to conduct the search. The attribute map query device acquires a condition input by a user, and generates a database query statement based on the condition.
Step 12: analyzing the query instruction, and generating a plurality of query steps according to the analysis result, wherein each query step corresponds to at least one query object.
Referring to fig. 2, the attribute map query device obtains a map query request command issued by a user and analyzes the map query request command. And generating an attribute graph according to the analyzed result, and executing query operation by a query device, wherein each query step comprises query on one object, for example, one query step is to query all event objects which meet wandering in the vicinity of China Bank.
Step 13: a number of primary query graph data are searched from a graph database based on the query object of the first query step.
Referring to fig. 2, the attribute map query device first queries the query index of one of the query objects according to the predetermined optimization rule of the map database based on the generated query step. Taking the above-mentioned case of searching for a male having a height of 185 who loiters near china bank as an example, the attribute map query device may generate an event index, and search for all events that meet the location attribute of being near china bank and the action attribute of loitering through the event index. The generated query index may also be an index of a person, and is not limited herein.
Specifically, the query index is a structure for sorting one or more columns of values in the database table in the attribute map query device, and the query index can be used for quickly accessing and acquiring specific information in the database table, so that the query efficiency is improved.
Step 14: and determining the query path cost based on the query objects in the rest query steps, and acquiring the query batch number according to the query path cost.
Specifically, the rest of the query steps are query steps of the attribute map query device except for the query index step. The query path cost is the cost of the path which needs to be circularly traversed in the whole graph query step execution process of the attribute graph query device. The query batch is the quantity of each query when the attribute graph query device queries the remaining limited conditions in the objects screened by the query index. For example, when the graph data to be queried includes all men who wander near china bank and have a height of 185, the set query batch is 100, and the query index is to find all people who wander near china bank, the query batch at this time represents a judgment on whether the condition of men having a height of 185 is satisfied by drawing 100 people every time from all people who wander near china bank, so as to obtain a final query result. The query index may also be used to find all events related to all males with height 185, which is not limited herein.
Referring to fig. 2, the attribute map query device obtains the objects to be queried in the rest of the query steps, and before determining the query path cost, the attribute map query device determines whether the query objects in the rest of the query steps have the filter condition for the attributes. And if not, setting the query cost value as a preset value, and searching final query graph data from the primary query graph data according to the preset value.
Specifically, the attribute map query device determines whether the attribute value of the query object screened out after query index query is limited based on a query instruction, and if not, sets the query batch number as a default value. For example, when the query command is a person wandering around china bank, the query objects in the remaining steps after the query indexing do not have the attribute filtering condition, so the query batch number is set to 10, which means that the attribute map query device will extract 10 objects to query each time.
Optionally, after the attribute map query device determines whether the query object screened out after query index query has the attribute value limitation based on the query instruction, if so, the attribute map query device calculates the map attribute expected value of each attribute according to the query map attribute of the query object, and calculates the query path cost value of the whole query path based on the map attribute expected value.
Optionally, in an embodiment, as shown in fig. 3, fig. 3 is a schematic flow chart of an embodiment of step 14, where step 14 may specifically include:
step 141: and acquiring the query graph attribute corresponding to each query object in the rest query steps.
Specifically, the rest of the query steps are query steps of the attribute map query device except for the query index step. For example, if the query instruction is to query men who wander near china bank and have a height of 185, the attribute map query device sets the query index to search for all persons who satisfy the event of wandering near china bank, and the remaining query steps are to search for men who have a height of 185 from all persons who satisfy wandering near china bank. At this time, the query object is a person, the attribute of the corresponding query graph is height 185, and the gender is male.
Step 142: and calculating the expected value of the graph attribute of each query graph attribute.
Specifically, the attribute map query device will count the data in the whole map database, count the attributes except for the attributes belonging to the precise conditions, such as the unique attributes of the name, the phone number and the like of the person, and obtain the number of each attribute value in each query map attribute. The number distribution of the category attributes and height attributes in a database is shown in the following table.
Figure 515419DEST_PATH_IMAGE001
The attribute map query device divides the total number of the attributes of each query map by the minimum value in the values of each attribute, and the obtained result is the expected value of the map attribute of the corresponding attribute. Taking the expected value of the graph attribute of the attribute of calculating gender as an example, if the total number of data with the attribute of gender obtained by the attribute graph query device is 20 ten thousand, where 10 ten thousand for male and 10 ten thousand for female, the expected value of the graph attribute of the attribute of gender is 20/10=2.
Step 143: based on the expected value of the graph attribute, the query path cost is determined.
Specifically, the attribute map query device obtains a query sequence of the remaining query steps, calculates corresponding query step costs based on expected values of map attributes, and determines query path costs according to the query sequence and the query step costs. The query step cost is the multiplication of the expected value of the graph attribute of each query graph attribute in each query step.
Specifically, the attribute map query device obtains the number of query objects corresponding to each query step to calculate the query path cost, calculates the product of each query step and the number of query objects corresponding to the last query step based on the number of query objects according to the query sequence, and determines the query path cost based on the product and the query step cost. Taking the above example of querying a male with a height of 185 who wanders near china bank as an example, if the attribute map query device has found out all persons who wander near china bank by using the query index, the query sequence is to query the events first, and then query a male with a height of 185 from the queried events. The query person's step cost value is the product of the expected value for the height map attribute and the expected value for the gender map attribute. Based on the data in the table above, if the height map attribute expected value is 20/2=10 and the gender map attribute expected value is 2, the cost value of the query person is 10 × 2=20. After the step cost values of the inquirers are obtained by the attribute map inquiry device, the step cost values of each inquiry step can be multiplied according to the inquiry sequence, and then the ratio of the number of the inquiry objects corresponding to each inquiry step obtained by inverting according to the inquiry sequence to the number of the last inquiry object corresponding to the inquiry step is multiplied, so that the whole inquiry path cost is calculated. The statistics of the human and event objects in the graph database just described are shown in the table below.
Label Statistical results (ten thousand)
Person 20
Event 10
As can be seen from the table, if the total number of events is 10 ten thousand and the total number of people is 20 ten thousand, the cost of the entire query path is 20 × 10/20=10.
Optionally, after the cost of the whole query path is obtained, the query batch is obtained according to the quantity of the query graph data required in the query instruction. The number of query graph data is the number of objects meeting the condition, which the user wants to search. For example, if the user wants to search 10 men who wander around china bank and have a height of 185, the number of query graph data is 10. The query batch number at this time is the query path cost multiplied by the number of the query graph data, and then multiplied by a preset coefficient. Taking the preset coefficient as 6 as an example, the query batch number is 10 × 10 × 6=600. The query batch number represents that the attribute map query device queries 600 objects from the total database data in parallel at a time, so that the query speed is increased. The query step and the specific data to be queried are combined to calculate the number of the objects to be queried each time based on the query batch obtained by the number of the attributes of each query graph of the query objects, so that the query speed can be increased under the condition of not wasting system resources, and the performance of the whole query device is improved.
Optionally, the attribute map query device may determine whether the query map attribute has an expected value of the map attribute, and when the query map attribute in the query path does not have the expected value of the map attribute, that is, the attribute is an attribute of the precise condition, the query batch number may be set as the number of query map data multiplied by a preset coefficient.
Step 15: and searching final query graph data from the primary query graph data according to the query batch number.
Referring to fig. 4, fig. 4 is a query flow chart of the attribute map query device according to the present application.
Specifically, after calculating the query batch number, the attribute map query device may select to concurrently search for the number of objects to be queried each time by using multiple lines. For example, the attribute map query device may use 3 lines, each of which searches 200 objects in the database, thereby speeding up the query of the data in the database. The number of lines can be set according to the user's needs, and is not limited herein. And the attribute map query device searches the matched final query map data from all the objects selected by the query index according to the set batch number.
Different from the situation of the prior art, the attribute map query method provided by the application is applied to an attribute map query device, and the attribute map query device acquires a query instruction of a user; analyzing the query instruction, and generating a plurality of query steps according to an analysis result, wherein each query step corresponds to at least one query object; searching a plurality of initial query graph data from a graph database based on a query object in the first query step; determining query path cost based on query objects in the rest query steps, and acquiring query batch according to the query path cost; and searching final query graph data from the primary query graph data according to the query batch number. Through the mode, compared with the conventional attribute map query method, the method for calculating the query batch number based on the map attribute expected value of the query map attribute in the query instruction after the query instruction obtained from the user is analyzed by the attribute map query device can optimally set the number of parallel queries in each time based on the number of data in the database to be queried, so that the effects of reasonably setting the query batch number and reasonably optimizing the query process are achieved. The attribute graph query method can generate graph attribute expected values based on the statistical results of the attribute graph data and obtain the quantity of parallel queries each time, can more effectively perform query operation, reasonably sets the query quantity under the condition of ensuring the query speed, and does not waste database resources.
Taking an example that the user wants to query 10 men who wander around china bank and have a height 185, the attribute map query device will analyze the query instruction of the user, and generate the query index in the query process as all the people who wander around china bank. The remaining query step was to query men who satisfied 185 height among all those who were wandering near china bank. The attribute map query means may extract two map query attributes from the remaining query steps: the height is 185 and the sex is male. The attribute map query device acquires the total number of all objects with height attributes to be 20 ten thousand based on the map data in the whole map database, wherein the minimum ratio of different height values is more than 190, and the number of the objects is 2 ten thousand, and the expected value of the map attribute of the height attribute is 20 ten thousand/2 ten thousand =10; the total number of all the objects with the gender attribute is 20 ten thousand, wherein the smallest ratio among the different gender values is male, and the number of the objects is 10 ten thousand, and the expected value of the graph attribute of the gender attribute is 20 ten thousand/10 ten thousand =2. From the expected values of the map attributes of the two attributes, the query step cost value can be calculated to be 10 × 2=20. The path cost value of the whole query path can be calculated by multiplying the cost value of each query step according to the query sequence and then multiplying the ratio of the number of the query objects corresponding to each query step obtained by inversion according to the query sequence to the number of the last query object corresponding to the query step. Assuming that the total number of all event objects in the graph database is 10 ten thousand and the total number of human objects is 20 ten thousand, the query path cost here is 20 × 10/20=10.
Since the user needs to query 10 men with height 185 wandering around the chinese bank, the query path cost needs to be multiplied by the number of the required graph data, and then multiplied by a preset coefficient 6, so that the query batch number of the query is 10 × 10 × 6=600. Therefore, when the attribute map query device queries, 600 pieces of map data are extracted from the map database each time to query whether the conditions of the user are satisfied.
The method of the foregoing embodiment may be implemented by using an attribute map query apparatus, which is described below with reference to fig. 5, where fig. 5 is a schematic structural diagram of a first embodiment of the attribute map query apparatus provided in this application.
As shown in fig. 5, the attribute map query apparatus 50 according to the embodiment of the present disclosure includes an instruction obtaining module 51, an instruction parsing module 52, a batch number calculating module 53, and an attribute map query module 54.
The instruction obtaining module 51 is configured to obtain a query instruction of a user.
The instruction parsing module 52 is configured to parse the query instruction, and generate a plurality of query steps according to a parsing result, where each query step corresponds to at least one query object.
And the batch number calculating module 53 is configured to search a plurality of first query graph data from the graph database based on the query object in the first query step, determine a query path cost based on the query objects in the remaining query steps, and obtain the query batch number according to the query path cost.
And the attribute map query module 54 is configured to search the final query map data from the primary query map data according to the query batch number.
The method of the foregoing embodiment may be implemented by using an attribute map query apparatus, and referring to fig. 6, fig. 6 is a schematic structural diagram of a second embodiment of the attribute map query apparatus provided in this application, where the attribute map query apparatus 60 includes a memory 61 and a processor 62, the memory 61 is used for storing program data, and the processor 62 is used for executing the program data to implement the following method:
the method comprises the steps of obtaining a query instruction of a user, analyzing the query instruction, generating a plurality of query steps according to an analysis result, wherein each query step corresponds to at least one query object, searching a plurality of initial query graph data from a graph database based on the query object of the first query step, determining query path cost based on the query objects of the rest query steps, obtaining query batch numbers according to the query path cost, and searching final query graph data from the initial query graph data according to the query batch numbers.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an embodiment of a computer-readable storage medium 70 provided in the present application, where the computer-readable storage medium 70 stores program data 71, and when the program data 71 is executed by a processor, the program data is used to implement the following methods:
the method comprises the steps of obtaining a query instruction of a user, analyzing the query instruction, generating a plurality of query steps according to an analysis result, wherein each query step corresponds to at least one query object, searching a plurality of initial query graph data from a graph database based on the query object of the first query step, determining query path cost based on the query objects of the rest query steps, obtaining query batch numbers according to the query path cost, and searching final query graph data from the initial query graph data according to the query batch numbers.
Embodiments of the present application may be implemented in software functional units and may be stored in a computer readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solutions of the present application, which are essential or contributing to the prior art, or all or part of the technical solutions may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the methods according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only an embodiment of the present application, and is not intended to limit the scope of the present application, and all equivalent structures or equivalent processes performed by the present application and the contents of the attached drawings, which are directly or indirectly applied to other related technical fields, are also included in the scope of the present application.

Claims (9)

1. An attribute map query method, the query method comprising:
acquiring a query instruction of a user, wherein the query instruction at least comprises a query object of query graph data, and the query object is a data type of the query graph data;
analyzing the query instruction, and generating a plurality of query steps according to an analysis result, wherein each query step corresponds to at least one query object;
searching a plurality of primary query graph data from a graph database based on the query object of the first query step;
determining query path cost based on query graph attributes corresponding to the query objects in the rest of query steps, and acquiring query batch according to the query path cost, wherein the query batch is the number of query graph data searched at the same time each time;
searching final query graph data from the primary query graph data according to the query batch number;
determining a query path cost based on the query graph attributes corresponding to the query objects in the rest of query steps, including:
calculating a graph attribute expected value of each query graph attribute;
acquiring the query sequence of the rest query steps;
calculating corresponding query step cost based on the graph attribute expected value;
and determining the query path cost according to the query sequence and the query step cost.
2. The query method of claim 1,
obtaining a query batch number according to the query path cost, including:
and acquiring a query batch number according to the product of the query path cost and the number of the query graph data required in the query instruction.
3. The query method of claim 1,
the determining the query path cost according to the query sequence and the query step cost includes:
acquiring the number of the query objects corresponding to each query step;
according to the query sequence, calculating the product of the number of the query objects corresponding to each query step and the last query step based on the number of the query objects;
determining the query path cost based on the product and the query step cost.
4. The query method of claim 1,
the calculating of the graph attribute expected value of each query graph attribute comprises:
acquiring the total query number of each query graph attribute in a database and the query number of specific classification in the query graph attributes;
and determining the attribute expected value of the query graph attribute based on the ratio of the minimum value in the query quantity of the specific classification to the total query number.
5. The query method of claim 1,
before the calculating of the graph attribute expected value of each query graph attribute, the method further includes:
judging whether all the query graph attributes have graph attribute expected values;
and if not, setting the query path cost as the product of the required query graph data quantity and a preset coefficient.
6. The query method of claim 1,
searching final query graph data from the primary query graph data according to the query batch number comprises the following steps:
setting the quantity of each query based on the obtained query batch quantity;
and performing parallel query in the primary query graph data based on the quantity of each query, and searching final query graph data.
7. The query method of claim 1,
after searching a plurality of first query graph data from a graph database based on the query object of the first query step, the method further comprises the following steps:
judging whether the query object in the rest query steps has a query graph attribute;
and if not, setting the query batch number as a preset value, and searching final query graph data from the primary query graph data according to the preset value.
8. An attribute map query device, comprising a memory and a processor coupled to the memory;
wherein the memory is for storing program data and the processor is for executing the program data to implement the property graph query method of any one of claims 1 to 7.
9. A computer storage medium for storing program data which, when executed by a computer, is configured to implement the property graph query method of any one of claims 1 to 7.
CN202210886632.7A 2022-07-26 2022-07-26 Attribute graph query method, attribute graph query device, and storage medium Active CN114943004B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210886632.7A CN114943004B (en) 2022-07-26 2022-07-26 Attribute graph query method, attribute graph query device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210886632.7A CN114943004B (en) 2022-07-26 2022-07-26 Attribute graph query method, attribute graph query device, and storage medium

Publications (2)

Publication Number Publication Date
CN114943004A CN114943004A (en) 2022-08-26
CN114943004B true CN114943004B (en) 2022-10-28

Family

ID=82911423

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210886632.7A Active CN114943004B (en) 2022-07-26 2022-07-26 Attribute graph query method, attribute graph query device, and storage medium

Country Status (1)

Country Link
CN (1) CN114943004B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113064918A (en) * 2021-03-24 2021-07-02 北京金堤征信服务有限公司 Enterprise data query method and device, electronic equipment and storage medium
CN114372165A (en) * 2022-01-18 2022-04-19 北京途普科技有限公司 Optimized path query method, device, equipment and storage medium for jump connection

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101296683B1 (en) * 2011-03-23 2013-08-14 연세대학교 산학협력단 Two phase method for processing multi-way join query over data streams
CN113405552A (en) * 2021-06-17 2021-09-17 北京理工大学 Aircraft path planning method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113064918A (en) * 2021-03-24 2021-07-02 北京金堤征信服务有限公司 Enterprise data query method and device, electronic equipment and storage medium
CN114372165A (en) * 2022-01-18 2022-04-19 北京途普科技有限公司 Optimized path query method, device, equipment and storage medium for jump connection

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"GoDB: From Batch Processing to Distributed Querying over Property Graphs";Nitin Jamadagni等;《 2016 16th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGrid)》;20160721;第1-10页 *
"HybriG:一种高效处理大量重边的属性图存储架构";黄权隆等;《计算机学报》;20180831;第1766-1779页 *

Also Published As

Publication number Publication date
CN114943004A (en) 2022-08-26

Similar Documents

Publication Publication Date Title
US11372851B2 (en) Systems and methods for rapid data analysis
CN107451149B (en) Monitoring method and device for flow data query task
Amato et al. Region proximity in metric spaces and its use for approximate similarity search
CN111008265A (en) Enterprise information searching method and device
CN108664509B (en) Method, device and server for ad hoc query
Atallah et al. Asymptotically efficient algorithms for skyline probabilities of uncertain data
CN111666468A (en) Method for searching personalized influence community in social network based on cluster attributes
CN104252487B (en) A kind of method and apparatus for generating entry information
CN110704472A (en) Data query statistical method and device
CN110874366A (en) Data processing and query method and device
CN110990423B (en) SQL statement execution method, device, equipment and storage medium
CN108959584B (en) Community structure-based method and device for processing graph data
CN111522819A (en) Method and system for summarizing tree-structured data
CN114943004B (en) Attribute graph query method, attribute graph query device, and storage medium
US8655911B2 (en) Expressing frequent itemset counting operations
US20100268723A1 (en) Method of partitioning a search query to gather results beyond a search limit
Annam et al. Entropy based informative content density approach for efficient web content extraction
Patroumpas et al. Similarity search over enriched geospatial data
CN114911826A (en) Associated data retrieval method and system
Sharma et al. A probabilistic approach to apriori algorithm
CN108304499B (en) Method, terminal and medium for pushing down predicate in SQL connection operation
CN111639099A (en) Full-text indexing method and system
CN117648444B (en) Patent clustering method and system based on graph convolution attribute aggregation
CN111433768B (en) System and method for intelligently guiding shopping
CN111694891B (en) Data table processing method and device

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
GR01 Patent grant
GR01 Patent grant