CN-122019809-A - Database query method and system based on graph neural network
Abstract
The invention discloses a database query method and a database query system based on a graph neural network, which are used for monitoring respective query requests of a plurality of user terminals, preprocessing all the query requests to obtain query plans of the plurality of user terminals, performing neural network processing on the query plans to obtain query feature structures, performing graph convolution neural network processing on a database to obtain data element relation information of the database to generate data element layout, performing graph convolution neural network processing on the query feature structures and the data element layout to obtain query path arrangement of the database, generating an execution strategy of the query path arrangement according to actual data change states of the database, and obtaining target data from database query according to the execution strategy. The query requests initiated by the user side are integrated into a query plan, and the data element layout in the database is formed by utilizing the graph convolution neural network, so that accurate query association is formed between the user side and the database, and the query efficiency and accuracy of the database are improved.
Inventors
- YU DAN
- WANG DANXING
- XU HAORAN
Assignees
- 慧之安信息技术股份有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251212
Claims (8)
- 1. A database query method based on a graph neural network, comprising: Monitoring respective query requests of a plurality of user terminals, preprocessing all the query requests to obtain query plans of the plurality of user terminals; performing graph convolution neural network processing on a database to obtain data element relation information of the database, so as to generate a data element layout; performing graph convolution neural network processing on the query feature structure and the data element layout to obtain a query path arrangement of the database; Generating an execution strategy of the query routing according to the actual data change state of the database, and acquiring target data from the database query according to the execution strategy.
- 2. The graph neural network-based database query method of claim 1, wherein: Monitoring the respective inquiry requests of a plurality of user terminals, preprocessing all the inquiry requests to obtain inquiry plans of the plurality of user terminals, and performing neural network processing on the inquiry plans to obtain inquiry feature structures, wherein the method comprises the following steps: Determining historical query initiation features of a plurality of user terminals according to historical query logs of the user terminals, wherein the historical query initiation features comprise query operation initiation time domain layout and query operation initiation network domain layout of the user terminals during historical query of a database; The method comprises the steps of carrying out semantic comparison on respective query terms of all query requests to determine query target similarity relations among all query requests, integrating all the query requests to obtain query plans of a plurality of clients according to the query target similarity relations and respective initiation time of all the query requests; performing tree neural network processing on the query plan to obtain all query target contents of the query plan and the query minimum standard thereof; the query minimum standard refers to the minimum text length of the query target content, and query elements corresponding to all the query target content one by one are generated and arranged according to all the query target content and the query minimum standard thereof, so that query structural features are generated.
- 3. The graph neural network-based database query method of claim 1, wherein: Performing a graph convolution neural network process on the database to obtain data element relation information of the database so as to generate a data element layout, performing the graph convolution neural network process on the query feature structure and the data element layout to obtain a query path arrangement of the database, wherein the graph convolution neural network process comprises the following steps: the method comprises the steps of selecting and reserving a plurality of image data according to the image data updating time and the image data labels of a database, carrying out graph convolution neural network processing on the plurality of image data to obtain semantic relation identifications and arrangements of the plurality of image data, and generating a data element layout; And performing graph convolution neural network processing on the query feature structure and the data element layout to obtain connection relations between all query elements subordinate to the query feature structure and image data with semantic association subordinate to the data element layout, and performing database internal path mapping and priority order adjustment on all connection relations to obtain query path arrangement of the database.
- 4. The graph neural network-based database query method of claim 1, wherein: generating an execution strategy of the query routing according to the actual data change state of the database, and obtaining target data from the database query according to the execution strategy, wherein the method comprises the following steps: The method comprises the steps of monitoring a real-time data writing path in a database to determine a data access congestion interval in the database, and generating an execution strategy of query path arrangement according to the distribution of all the data access congestion intervals in the database, wherein the execution strategy comprises an interval strategy of actual execution of the query path arrangement in the database; And carrying out content extraction verification on the data successfully accessed during the implementation of the execution strategy, thereby taking the data passing the extraction verification as target data obtained from the database query.
- 5. A graph neural network-based database query system, comprising: the query plan generation module is used for monitoring respective query requests of a plurality of user terminals, preprocessing all the query requests and obtaining query plans of the plurality of user terminals; the query structure determining module is used for performing neural network processing on the query plan to obtain a query characteristic structure; the database processing module is used for carrying out graph convolution neural network processing on a database to obtain data element relation information of the database so as to generate a data element layout; The query path determining module is used for carrying out graph convolution neural network processing on the query characteristic structure and the data element layout to obtain query path arrangement of the database; the execution strategy determining module is used for generating an execution strategy of the query routing according to the actual data change state of the database; And the target data acquisition module is used for acquiring target data from the database query according to the execution strategy.
- 6. The graph neural network-based database query system of claim 5, wherein: The query plan generating module is configured to monitor respective query requests of a plurality of clients, preprocess all the query requests, and obtain query plans of the plurality of clients, where the query plan generating module includes: Determining historical query initiation features of a plurality of user terminals according to historical query logs of the user terminals, wherein the historical query initiation features comprise query operation initiation time domain layout and query operation initiation network domain layout of the user terminals during historical query of a database; The method comprises the steps of carrying out semantic comparison on respective query terms of all query requests to determine query target similarity relations among all query requests, integrating all the query requests to obtain query plans of a plurality of clients according to the query target similarity relations and respective initiation time of all the query requests; the query structure determining module is configured to perform neural network processing on the query plan to obtain a query feature structure, and includes: performing tree neural network processing on the query plan to obtain all query target contents of the query plan and the query minimum standard thereof; the query minimum standard refers to the minimum text length of the query target content, and query elements corresponding to all the query target content one by one are generated and arranged according to all the query target content and the query minimum standard thereof, so that query structural features are generated.
- 7. The graph neural network-based database query system of claim 5, wherein: The database processing module is used for performing graph convolution neural network processing on a database to obtain data element relation information of the database, so as to generate a data element layout, and the method comprises the following steps: the method comprises the steps of selecting and reserving a plurality of image data according to the image data updating time and the image data labels of a database, carrying out graph convolution neural network processing on the plurality of image data to obtain semantic relation identifications and arrangements of the plurality of image data, and generating a data element layout; The query path determining module is configured to perform graph convolution neural network processing on the query feature structure and the data element layout to obtain a query path arrangement for the database, and includes: And performing graph convolution neural network processing on the query feature structure and the data element layout to obtain connection relations between all query elements subordinate to the query feature structure and image data with semantic association subordinate to the data element layout, and performing database internal path mapping and priority order adjustment on all connection relations to obtain query path arrangement of the database.
- 8. The graph neural network-based database query system of claim 5, wherein: The execution policy determining module is configured to generate an execution policy of the query routing according to an actual data change state of the database, where the execution policy determining module includes: The method comprises the steps of monitoring a real-time data writing path in a database to determine a data access congestion interval in the database, and generating an execution strategy of query path arrangement according to the distribution of all the data access congestion intervals in the database, wherein the execution strategy comprises an interval strategy of actual execution of the query path arrangement in the database; the target data obtaining module is configured to obtain target data from the database query according to the execution policy, and includes: And carrying out content extraction verification on the data successfully accessed during the implementation of the execution strategy, thereby taking the data passing the extraction verification as target data obtained from the database query.
Description
Database query method and system based on graph neural network Technical Field The invention relates to the field of databases, in particular to a database query method and system based on a graph neural network. Background The database is used for storing data from different generators, plays a role in data integration and concentration, and provides reliable and stable data sources for scenes such as intelligent processing of big data. The database can comprise a text database, an image database and a heterogeneous database according to the type of the stored data, wherein the heterogeneous database simultaneously stores data with different structures such as text data, image data and the like. For the image database, the correct query of the image data needs to be based on the identification of the content of the image data, and the existing query mode of the image database mainly optimizes the content index tag of the image data and enhances the hardware configuration of the computing power resource of the image database by optimizing the storage mode of the image data in the database. Disclosure of Invention Considering that the existing image database query optimization mode needs to pay a large amount of time cost and hardware components, the operation difficulty of the image database is increased, the query request of a user terminal is not really oriented, the query strategy is accurately adjusted on the database side, and the query efficiency and accuracy of the database are reduced. In view of the foregoing, the present invention has been made to provide a database query method based on a graph neural network, which overcomes the foregoing problems or at least partially solves the foregoing problems, including: Monitoring respective query requests of a plurality of user terminals, preprocessing all the query requests to obtain query plans of the plurality of user terminals; performing graph convolution neural network processing on a database to obtain data element relation information of the database, so as to generate a data element layout; performing graph convolution neural network processing on the query feature structure and the data element layout to obtain a query path arrangement of the database; Generating an execution strategy of the query routing according to the actual data change state of the database, and acquiring target data from the database query according to the execution strategy. Optionally, monitoring respective query requests of a plurality of user terminals, preprocessing all the query requests to obtain query plans of the plurality of user terminals, and performing neural network processing on the query plans to obtain query feature structures, wherein the method comprises the following steps: Determining historical query initiation features of a plurality of user terminals according to historical query logs of the user terminals, wherein the historical query initiation features comprise query operation initiation time domain layout and query operation initiation network domain layout of the user terminals during historical query of a database; The method comprises the steps of carrying out semantic comparison on respective query terms of all query requests to determine query target similarity relations among all query requests, integrating all the query requests to obtain query plans of a plurality of clients according to the query target similarity relations and respective initiation time of all the query requests; performing tree neural network processing on the query plan to obtain all query target contents of the query plan and the query minimum standard thereof; the query minimum standard refers to the minimum text length of the query target content, and query elements corresponding to all the query target content one by one are generated and arranged according to all the query target content and the query minimum standard thereof, so that query structural features are generated. Optionally, performing a graph-rolling neural network process on the database to obtain data element relationship information of the database, thereby generating a data element layout, and performing the graph-rolling neural network process on the query feature structure and the data element layout to obtain a query routing for the database, including: the method comprises the steps of selecting and reserving a plurality of image data according to the image data updating time and the image data labels of a database, carrying out graph convolution neural network processing on the plurality of image data to obtain semantic relation identifications and arrangements of the plurality of image data, and generating a data element layout; And performing graph convolution neural network processing on the query feature structure and the data element layout to obtain connection relations between all query elements subordinate to the query feature structure and image data with semantic association subo