Database query method and system based on graph neural network
By integrating user-end query requests and using a database query system based on graph convolutional neural networks, the technical problems of existing database query systems are solved, thereby improving the efficiency and accuracy of database queries.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUIZHIAN INFORMATION TECH CO LTD
- Filing Date
- 2025-12-12
- Publication Date
- 2026-05-12
AI Technical Summary
Existing image database query methods suffer from high time and hardware costs, fail to meet user-side query requests, and fail to effectively improve query efficiency and accuracy.
By listening to user query requests, a query plan is generated and processed by a neural network. A graph convolutional neural network is used to process the relationships between database data elements, generating a query path arrangement. An execution strategy is then generated based on the database status to obtain the target data.
It improves the query efficiency and accuracy of image databases, enables precise user-end query association, and reduces costs.
Smart Images

Figure CN122019809A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of databases, and in particular to a database query method and system based on graph neural networks. Background Technology
[0002] Databases are used to store data from different sources, serving as a data integration and centralization mechanism, providing a reliable and stable data source for scenarios such as big data intelligent processing. Based on the type of data stored, databases can include text databases, image databases, and heterogeneous databases; heterogeneous databases store data with different structures, such as text and image data. For image databases, correct image data retrieval requires prior recognition of the image data's content. Existing image database query methods mainly optimize the storage method of image data within the database, optimize the content index tags of image data, and enhance the hardware configuration of image database computing resources. However, these improvements to image database querying suffer from high implementation time and hardware costs, do not truly address user-end query requests, and do not involve precise adjustments to the query strategy on the image database side, failing to improve the query efficiency and accuracy of image databases with minimal cost. Summary of the Invention
[0003] Considering that existing image database query optimization methods require significant time and hardware investment, increasing the operational complexity of image databases, and do not truly address user-side query requests or precisely adjust query strategies on the database side, thus reducing query efficiency and accuracy, this invention is proposed to provide a database query method based on graph neural networks to overcome or at least partially solve the aforementioned problems, comprising:
[0004] Listen to the query requests from several user terminals, preprocess all query requests to obtain query plans from the user terminals, and perform neural network processing on the query plans to obtain query feature structures.
[0005] The database is processed by a graph convolutional neural network to obtain the data element relationship information of the database, thereby generating a data element layout; the query feature structure and the data element layout are processed by a graph convolutional neural network to obtain the query path arrangement of the database.
[0006] Based on the actual data change status of the database, an execution strategy for the query path arrangement is generated; based on the execution strategy, the target data is obtained by querying the database.
[0007] Optionally, the system monitors query requests from several user terminals, preprocesses all query requests to obtain query plans for the user terminals, and performs neural network processing on the query plans to obtain a query feature structure, including:
[0008] Based on the historical query logs of several user terminals, the historical query initiation characteristics of the several user terminals are determined; wherein, the historical query initiation characteristics include the time domain layout and network domain layout of the query operation initiation during the historical query of the database by the user terminals; based on the historical query initiation characteristics, the query request listening mode of each of the several user terminals is adjusted.
[0009] Semantic comparison is performed on the query terms of each query request to determine the similarity of query targets among all query requests; based on the similarity of query targets and the initiation time of each query request, all query requests are integrated to obtain the query plan for the several user terminals;
[0010] The query plan is processed by a tree neural network to obtain all the query target content and their minimum query criteria; wherein, the minimum query criteria refers to the minimum text length of the query target content; based on all the query target content and their minimum query criteria, query elements corresponding one-to-one with all the query target content are generated and arranged to generate query structure features.
[0011] Optionally, the database is processed by a graph convolutional neural network to obtain the data element relationship information of the database, thereby generating a data element layout; the query feature structure and the data element layout are processed by a graph convolutional neural network to obtain a query path arrangement for the database, including:
[0012] Based on the image data update time and image data tags in the database, a number of image data are selected and retained; graph convolutional neural network processing is performed on the image data to obtain the semantic relationship identifiers and arrangements of the image data, thereby generating a data element layout.
[0013] The query feature structure and the data element layout are processed by a graph convolutional neural network to obtain the connection relationships between all query elements under the query feature structure and the image data with semantic association under the data element layout; all connection relationships are mapped and prioritized within the database to obtain the query path arrangement for the database.
[0014] Optionally, an execution strategy for the query path arrangement is generated based on the actual data change status of the database; according to the execution strategy, the target data is obtained by querying the database, including:
[0015] Monitor the real-time data write path within the database to determine the data access congestion intervals within the database; generate an execution strategy for the query path arrangement based on the distribution of all data access congestion intervals within the database; wherein, the execution strategy includes the strategy for the actual execution interval of the query path arrangement within the database;
[0016] The data successfully accessed during the implementation of the execution strategy is extracted and verified, and the data that passes the extraction and verification is used as the target data obtained from the database.
[0017] As one aspect of the present invention, embodiments of the present invention also provide a database query system based on graph neural networks, comprising:
[0018] The query plan generation module is used to listen to the query requests of several user terminals, preprocess all query requests, and obtain the query plans of the several user terminals.
[0019] The query structure determination module is used to perform neural network processing on the query plan to obtain the query feature structure;
[0020] The database processing module is used to perform graph convolutional neural network processing on the database to obtain the data element relationship information of the database, thereby generating the data element layout.
[0021] The query path determination module is used to perform graph convolutional neural network processing on the query feature structure and the data element layout to obtain the query path arrangement for the database.
[0022] The execution strategy determination module is used to generate the execution strategy for the query path arrangement based on the actual data change status of the database.
[0023] The target data acquisition module is used to query the database to obtain target data according to the execution strategy.
[0024] Optionally, the query plan generation module is used to listen to query requests from several user terminals, preprocess all query requests, and obtain query plans from the several user terminals, including:
[0025] Based on the historical query logs of several user terminals, the historical query initiation characteristics of the several user terminals are determined; wherein, the historical query initiation characteristics include the time domain layout and network domain layout of the query operation initiation during the historical query of the database by the user terminals; based on the historical query initiation characteristics, the query request listening mode of each of the several user terminals is adjusted.
[0026] Semantic comparison is performed on the query terms of each query request to determine the similarity of query targets among all query requests; based on the similarity of query targets and the initiation time of each query request, all query requests are integrated to obtain the query plan for the several user terminals;
[0027] The query structure determination module is used to perform neural network processing on the query plan to obtain the query feature structure, including:
[0028] The query plan is processed by a tree neural network to obtain all the query target content and their minimum query criteria; wherein, the minimum query criteria refers to the minimum text length of the query target content; based on all the query target content and their minimum query criteria, query elements corresponding one-to-one with all the query target content are generated and arranged to generate query structure features.
[0029] Optionally, the database processing module is used to perform graph convolutional neural network processing on the database to obtain the data element relationship information of the database, thereby generating a data element layout, including:
[0030] Based on the image data update time and image data tags in the database, a number of image data are selected and retained; graph convolutional neural network processing is performed on the image data to obtain the semantic relationship identifiers and arrangements of the image data, thereby generating a data element layout.
[0031] The query path determination module is used to perform graph convolutional neural network processing on the query feature structure and the data element layout to obtain a query path arrangement for the database, including:
[0032] The query feature structure and the data element layout are processed by a graph convolutional neural network to obtain the connection relationships between all query elements under the query feature structure and the image data with semantic association under the data element layout; all connection relationships are mapped and prioritized within the database to obtain the query path arrangement for the database.
[0033] Optionally, the execution strategy determination module is used to generate an execution strategy for the query path arrangement based on the actual data change status of the database, including:
[0034] Monitor the real-time data write path within the database to determine the data access congestion intervals within the database; generate an execution strategy for the query path arrangement based on the distribution of all data access congestion intervals within the database; wherein, the execution strategy includes the strategy for the actual execution interval of the query path arrangement within the database;
[0035] The target data acquisition module is used to query the database to obtain target data according to the execution strategy, including:
[0036] The data successfully accessed during the implementation of the execution strategy is extracted and verified, and the data that passes the extraction and verification is used as the target data obtained from the database.
[0037] The beneficial effects of the above-mentioned technical solutions provided in the embodiments of the present invention include at least the following:
[0038] This invention provides a database query method and system based on graph neural networks. The method involves monitoring query requests from several user terminals, preprocessing all requests to obtain query plans for each user terminal, applying neural network processing to the query plans to obtain query feature structures, applying graph convolutional neural network processing to the database to obtain data element relationship information, and generating a data element layout. Further graph convolutional neural network processing is applied to the query feature structures and data element layout to obtain a query path arrangement for the database. An execution strategy for the query path arrangement is generated based on the actual data changes in the database. Finally, the target data is retrieved from the database according to the execution strategy. By integrating user-initiated query requests into query plans and utilizing graph convolutional neural networks to form the data element layout within the database, a precise query relationship is established between the user terminals and the database, improving the efficiency and accuracy of database queries.
[0039] Other features and advantages of the invention will be set forth in the following description, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention may be realized and obtained by means of the structures particularly pointed out in the written description and the accompanying drawings.
[0040] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0041] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0042] Figure 1 This is a flowchart illustrating the database query method based on graph neural networks provided in an embodiment of the present invention.
[0043] Figure 2 This is a schematic diagram of the structure of a database query system based on a graph neural network provided in an embodiment of the present invention. Detailed Implementation
[0044] Exemplary embodiments of the present disclosure will now be described in more detail with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
[0045] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," "outer," "far," "near," "front," and "rear," etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the accompanying drawings and are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of this invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.
[0046] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0047] Please see Figure 1 As shown, an embodiment of this application provides a database query method based on a graph neural network. This graph neural network-based database query method includes:
[0048] Listen to the query requests from several user terminals, preprocess all query requests to obtain query plans for several user terminals, and perform neural network processing on the query plans to obtain the query feature structure.
[0049] The database is processed by a graph convolutional neural network to obtain the data element relationship information, thereby generating the data element layout; the query feature structure and data element layout are processed by a graph convolutional neural network to obtain the query path arrangement for the database.
[0050] Based on the actual data changes in the database, an execution strategy for query path arrangement is generated; based on the execution strategy, the target data is retrieved from the database.
[0051] The beneficial effects of the above embodiments are that the database query method based on graph neural networks integrates query requests initiated by the user terminal into a query plan and uses graph convolutional neural networks to form the data element layout within the database, thereby forming a precise query association between the user terminal and the database and improving the query efficiency and accuracy of the database.
[0052] In another embodiment, query requests from several user terminals are monitored, all query requests are preprocessed to obtain query plans for several user terminals, and the query plans are processed by a neural network to obtain a query feature structure, including:
[0053] Based on the historical query logs of several user terminals, the historical query initiation characteristics of several user terminals are determined. Among them, the historical query initiation characteristics include the time domain layout and network domain layout of the query operation initiation during the historical query period of the user terminal to the database. Based on the historical query initiation characteristics, the query request listening mode of each of the several user terminals is adjusted.
[0054] Semantic comparison is performed on the query terms of each query request to determine the similarity of query targets among all query requests; based on the similarity of query targets and the initiation time of each query request, all query requests are integrated to obtain several query plans for the user end.
[0055] The query plan is processed by a tree neural network to obtain all the query target content and their minimum query criteria. The minimum query criteria refer to the minimum text length of the query target content. Based on all the query target content and their minimum query criteria, query elements that correspond one-to-one with all the query target content are generated and arranged to generate query structure features.
[0056] The beneficial effects of the above embodiments are that the database (image database) is designed for multiple user terminals, each with different tasks and different data query requirements. If the database immediately responds to each query request and executes the query internally, it would lead to multi-threaded operation within the database, increasing its workload and making it prone to query crosstalk and disorder. Therefore, it first listens for query requests from all user terminals and integrates them to obtain query plans for several user terminals, ensuring that these plans cover the data query needs of multiple user terminals. To balance the resource consumption of listening to user terminals with the accuracy of the query requests obtained, the listening mode for each user terminal needs to be determined specifically based on its historical query request initiation habits. Specifically, based on the historical query logs of several user terminals, the time domain layout (e.g., the frequency and / or time interval of query operations initiated by the client during the historical query period of the database) and the network domain layout (e.g., the location of the network node where the client initiated the query operation during the historical query period of the database) of each user terminal are determined. Based on the above query operation initiation time domain layout and query operation initiation network domain layout, the listening frequency and / or listening time interval of the query request process initiated by each user terminal and the corresponding network node are adjusted, thereby ensuring that the query requests initiated by the user terminal are obtained quickly and accurately.
[0057] Furthermore, different user clients may have identical or partially identical data query requests from the database. To effectively integrate all user client data query requests and reduce the workload of redundant database queries, a semantic comparison is performed on the query terms contained in all query requests initiated by all user clients. This determines the similarity relationship of query targets among all query requests (i.e., the similarity of different query requests in terms of query target content). Based on the above query target similarity relationship and the initiation time of each query request, all query requests are integrated to obtain several query plans for several user clients. These query plans contain several query terms that do not overlap in content and are arranged in an order (corresponding to the order of initiation time). These query plans completely cover the query needs of all user clients. A tree neural network is then used to process these query plans to obtain all query target content and their minimum query criteria. This generates several query elements, each containing a query target content and its corresponding minimum query criteria. Subsequent database queries are performed on each query element as a unit. Only when data consistent with the above query target content and meeting the above minimum query criteria is the required data correctly retrieved. Finally, all query elements are arranged to generate query structure features. The arrangement of all query elements can be, but is not limited to, in the order of their required deadlines.
[0058] In another embodiment, the database is processed by a graph convolutional neural network to obtain the data element relationship information of the database, thereby generating a data element layout; the query feature structure and the data element layout are processed by a graph convolutional neural network to obtain the query path arrangement for the database, including:
[0059] Based on the image data update time and image data labels in the database, a number of image data are selected and retained; graph convolutional neural network processing is performed on the image data to obtain the semantic relationship identifiers and arrangements of the image data, thereby generating the data element layout.
[0060] The query feature structure and data element layout are processed by a graph convolutional neural network to obtain the connection relationships between all query elements under the query feature structure and the image data with semantic association under the data element layout; the database internal path mapping and priority adjustment are performed on all connection relationships to obtain the query path arrangement of the database.
[0061] The beneficial effects of the above embodiments are that the database continuously receives data from external sources during operation to supplement and update its own data. The database contains a large amount of data, and the image data within it is limited by its own data format, making it impossible for the database to form an effective and accurate index for each image data, thus reducing the traceability of image data within the database. Therefore, firstly, based on the image data update time and image data tags in the database, it is determined whether the image data update time (i.e., the editing and update time within the database) is after a preset time point or whether the source identity tag of the image data is within a preset identity whitelist. If so, the corresponding image data is retained; otherwise, it is removed. Then, a graph convolutional neural network is used to process the semantic relationship identifiers of all retained image data to obtain the semantic content similarity relationships of all retained image data. Based on these semantic content similarity relationships, all retained image data are clustered and arranged, with image data having strong semantic content similarity relationships arranged centrally, improving the orderly arrangement of image data within the database.
[0062] Furthermore, the query feature structure and data element layout are processed using a graph convolutional neural network to obtain the connection relationships between all query elements under the query feature structure and the semantically related image data under the data element layout. These connection relationships refer to the query matching relationships between query elements and image data, achieving accurate mapping between query elements and image data in the database. Based on all connection relationships, all acquisition paths for the image data corresponding to each connection relationship are determined within the database. Then, based on the path length of each acquisition path, the priority is adjusted to obtain the query path arrangement for the database, facilitating subsequent orderly query access to the database according to this arrangement.
[0063] In another embodiment, an execution strategy for query path arrangement is generated based on the actual data change status of the database; according to the execution strategy, target data is obtained by querying the database, including:
[0064] Monitor the real-time data write path within the database to determine the data access congestion intervals within the database; based on the distribution of all data access congestion intervals within the database, generate an execution strategy for query path arrangement; wherein, the execution strategy includes the strategy for the actual execution interval of the query path arrangement within the database;
[0065] Content extraction and verification are performed on data successfully accessed during the implementation of the strategy, and the extracted and verified data is used as the target data to be retrieved from the database.
[0066] The beneficial effects of the above embodiments are that the database consumes its own data transmission channel resources while receiving data from external sources, thereby affecting user access to the database. Therefore, during actual query access, it is necessary to avoid data transmission congestion channels or intervals caused by data writing to the database. To this end, the data transmission channel occupancy of the real-time data write path within the database is monitored to determine the data access congestion intervals within the database. It can be understood that the aforementioned data access congestion intervals refer to the intervals where the bandwidth occupied by the data transmission channel within the database exceeds a preset bandwidth threshold. Then, based on the distribution of all data access congestion intervals within the database, an execution strategy for query path arrangement is generated. This execution strategy is then used as a basis to adjust the actual execution interval strategy of the query path within the database, thereby avoiding query path execution within the aforementioned data access congestion intervals and improving data query efficiency. Furthermore, the data successfully accessed during the implementation of the strategy is subjected to content extraction and verification to determine whether there are any garbled characters in the successfully accessed data. If no garbled characters are found, the content extraction and verification of the above data is determined to be successful, and the data that has passed the extraction and verification is used as the target data to be obtained from the database. If garbled characters are found, the content extraction and verification of the above data is determined to be unsuccessful, and the data is queried from the database again to improve the query efficiency and accuracy of the database.
[0067] In one embodiment, the aforementioned monitoring of real-time data write paths within the database to determine data access congestion zones within the database can be implemented through the following steps:
[0068] S1. Monitor the real-time data write bandwidth usage and query waiting queue length of each data access interval in the database; determine the personalized query latency sensitivity parameter of the user terminal based on the historical query log of the user terminal that initiated the current query; calculate the dynamic congestion index of each data access interval based on the real-time data write bandwidth usage, query waiting queue length and the personalized query latency sensitivity parameter; mark the intervals where the dynamic congestion index exceeds a preset threshold as data access congestion intervals.
[0069] The dynamic congestion index is calculated according to the following formula (1):
[0070] (1)
[0071] in, This represents the dynamic congestion index of the i-th data access interval at the current time t. It is a dimensionless value, and the larger the value, the more congested the data access interval. This represents the data write bandwidth utilization rate of the i-th data access interval at the current time t, which is collected in real time by the database system monitoring module. This represents the total bandwidth capacity of the i-th data access interval, which is a preset system constant. This represents the length of the query queue waiting to be processed for the i-th data access interval at the current time t; This represents the maximum allowed query queue length, which is a preset system constant used for normalization. This represents a personalized parameter indicating query latency sensitivity, characterizing the user's tolerance for query latency. The value range is, for example, [0,1]. A larger value indicates greater sensitivity to latency. This parameter is calculated by analyzing the historical query initiation time-domain layout of the user or set by the user configuration file. α, β, and γ are weighting coefficients, corresponding to the weights of write load, queue load, and user preference components, respectively, satisfying α + β + γ = 1. Their values can range from [0, 1] and can be determined through training and optimization using historical performance data or set by the system administrator based on experience. λ represents an adjustment coefficient, ranging from positive real numbers. λ can be set to a reasonable value based on experience, for example, λ = 2.0; alternatively, a λ value mapping table can be preset based on the user type or the criticality level of the data range. If the user is a real-time analysis type (e.g., ...), ... If the sensitivity is > 0.8), then set λ = 3.0 (high sensitivity, strong amplification); if the user end is batch processing type (e.g. If the sensitivity is less than 0.3, then set λ = 0.5 (low sensitivity, weak amplification); if it is for ordinary interactive users, then set λ = 2.0.
[0072] The above formula comprehensively calculates the congestion level of a data access interval at a specific moment by quantifying three dimensions: data write load, query queue pressure, and user personalization tolerance. It weights and synthesizes objective load and subjective preference to identify performance bottleneck intervals, rather than relying solely on a single indicator (such as CPU utilization).
[0073] The above-mentioned execution strategy for query path arrangement, based on the distribution of all data access congestion intervals within the database, can be specifically implemented as S2:
[0074] S2. Based on the distribution of all marked data access congestion intervals in the database, dynamically adjust the query path arrangement to generate a strategy for avoiding the actual execution interval of the data access congestion interval, which is then used as the execution strategy.
[0075] Specifically, if If the congestion exceeds the preset congestion threshold, the part of the original planned path involving the i-th data access interval will be adjusted to pass through an adjacent or backup interval with a lower dynamic congestion index in the execution strategy.
[0076] The above-mentioned content extraction and verification of data successfully accessed during the implementation of the execution strategy, and the data that passes the extraction and verification, are used as the target data to be obtained from the database query. This can be specifically implemented as follows: steps S3-S4:
[0077] S3. Execute the query according to the execution strategy. For successfully accessed data, extract its semantic completeness and access response time. Determine its source credibility personalized parameter according to the image data tag corresponding to the successfully accessed data. Calculate the verification weight of each successfully accessed data based on the semantic completeness, access response time and the source credibility personalized parameter.
[0078] The verification weight for successful data access is calculated according to the following formula (2):
[0079] (2)
[0080] in, The verification weight for the k-th successfully accessed data is a dimensionless value; the larger the value, the higher the necessity for performing strict content verification on this data. The semantic integrity score for the kth successfully accessed data can be obtained by evaluating the text description or visual features of the data through natural language processing or image feature analysis models. It can be based on metrics such as keyword coverage, syntactic structure integrity, and feature vector richness. The minimum query standard (minimum text length or minimum feature dimension) corresponding to the kth successfully accessed data. To obtain the actual access response time for the kth successfully accessed data, a timer can be used to record it during the query execution process; The maximum normal response time allowed or expected by the system is , and is a preset system constant used for normalization. This is a personalized parameter representing the source credibility of the k-th successfully accessed data, indicating the credibility of the image data source storing the k-th successfully accessed data. Its value range is typically [0, 1], with a larger value indicating a more credible source. It can be calculated based on information such as the source identity within the image data tag, historical update quality score, and digital signature validity. θ is the verification weight allocation coefficient, used to balance the importance of data integrity and acquisition process anomalies in the verification decision, with a value range of [0, 1]. is a preset value, which can be preset according to the system's emphasis on data integrity or response anomalies; for example, θ = 0.6. μ is the attenuation coefficient, a positive real number, whose value can be preset; for example, μ = 2.0, which allows the source credibility to significantly adjust the verification weight.
[0081] The above formula is used to dynamically evaluate the credibility of each returned data entry and determine the allocation of verification resources accordingly. It takes into account the integrity of the data itself ( ) and the abnormality of the acquisition process ( ), and introduce source credibility ( The formula uses as a correction factor. The principle behind this formula is that the higher the completeness of the data, the more normal the response, and the more reliable the source, the lower the likelihood that rigorous verification is required.
[0082] S4. For successful access data whose verification weight exceeds the preset verification threshold, perform content extraction verification operation; use the data that passes the content extraction verification as the final target data obtained from the database query.
[0083] This step is the decision execution step, which is based on the calculation in S3. As a result, if If the value exceeds the preset verification threshold, the content extraction and verification process for that data will be triggered (such as verifying the hash value, checking the data format integrity, and performing a quick comparison with an authoritative source). Otherwise, the data can be directly returned as the target data.
[0084] The above embodiments have the following beneficial effects:
[0085] The dynamic congestion index is calculated by integrating real-time write load, query queue pressure, and user-specific latency sensitivity. This index more accurately reflects the actual access pressure in different areas within the database. Based on this index, the query execution path can be dynamically adjusted to proactively avoid real-time congested areas and intelligently guide query traffic to relatively idle areas, thereby reducing average query response time and improving overall throughput.
[0086] Introduced query latency sensitivity ( ) and the credibility of the data source ( Two personalized parameters. The former ensures that query requests from highly sensitive users receive a more proactive congestion avoidance response; the latter enables the system to differentiate the rigor of query result verification based on the credibility of the data source, thus achieving on-demand allocation and precise deployment of system resources (computing resources and verification resources).
[0087] By calculating the verification weights ( This approach quantifies and integrates the semantic integrity of the data, the anomalies in the acquisition process, and the credibility of the source, intelligently generating a "credibility score" for each returned data item. Additional verification is performed only on data with scores exceeding a threshold, avoiding the performance overhead of blindly performing comprehensive verification while ensuring effective screening of suspicious data. This achieves an optimized balance between performance and accuracy, ultimately outputting highly reliable target data.
[0088] Please see Figure 2 As shown, an embodiment of this application provides a database query system based on a graph neural network. This graph neural network-based database query system includes:
[0089] The query plan generation module is used to listen to the query requests from several user terminals, preprocess all query requests, and obtain query plans for several user terminals.
[0090] The query structure determination module is used to perform neural network processing on the query plan to obtain the query feature structure.
[0091] The database processing module is used to perform graph convolutional neural network processing on the database to obtain the data element relationship information of the database, and thereby generate the data element layout.
[0092] The query path determination module is used to process the query feature structure and data element layout using a graph convolutional neural network to obtain the query path arrangement for the database.
[0093] The execution strategy determination module is used to generate an execution strategy for query path arrangement based on the actual data change status of the database.
[0094] The target data acquisition module is used to retrieve target data from the database according to the execution strategy.
[0095] The beneficial effects of the above embodiments are that the database query system based on graph neural networks integrates query requests initiated by the user terminal into query plans and uses graph convolutional neural networks to form the data element layout within the database, thereby forming a precise query association between the user terminal and the database and improving the query efficiency and accuracy of the database.
[0096] In another embodiment, the query plan generation module is used to listen to query requests from several user terminals, preprocess all query requests, and obtain query plans for several user terminals, including:
[0097] Based on the historical query logs of several user terminals, the historical query initiation characteristics of several user terminals are determined. Among them, the historical query initiation characteristics include the time domain layout and network domain layout of the query operation initiation during the historical query period of the user terminal to the database. Based on the historical query initiation characteristics, the query request listening mode of each of the several user terminals is adjusted.
[0098] Semantic comparison is performed on the query terms of each query request to determine the similarity of query targets among all query requests; based on the similarity of query targets and the initiation time of each query request, all query requests are integrated to obtain several query plans for the user end.
[0099] The query structure determination module is used to perform neural network processing on the query plan to obtain the query feature structure, including:
[0100] The query plan is processed by a tree neural network to obtain all the query target content and their minimum query criteria. The minimum query criteria refer to the minimum text length of the query target content. Based on all the query target content and their minimum query criteria, query elements that correspond one-to-one with all the query target content are generated and arranged to generate query structure features.
[0101] In another embodiment, the database processing module is used to perform graph convolutional neural network processing on the database to obtain data element relationship information of the database, thereby generating a data element layout, including:
[0102] Based on the image data update time and image data labels in the database, a number of image data are selected and retained; graph convolutional neural network processing is performed on the image data to obtain the semantic relationship identifiers and arrangements of the image data, thereby generating the data element layout.
[0103] The query path determination module uses graph convolutional neural networks to process the query feature structure and data element layout to obtain the query path arrangement for the database, including:
[0104] The query feature structure and data element layout are processed by a graph convolutional neural network to obtain the connection relationships between all query elements under the query feature structure and the image data with semantic association under the data element layout; the database internal path mapping and priority adjustment are performed on all connection relationships to obtain the query path arrangement of the database.
[0105] In another embodiment, the execution strategy determination module is used to generate an execution strategy for query path arrangement based on the actual data change status of the database, including:
[0106] Monitor the real-time data write path within the database to determine the data access congestion intervals within the database; based on the distribution of all data access congestion intervals within the database, generate an execution strategy for query path arrangement; wherein, the execution strategy includes the strategy for the actual execution interval of the query path arrangement within the database;
[0107] The target data acquisition module is used to retrieve target data from the database according to the execution strategy, including:
[0108] Content extraction and verification are performed on data successfully accessed during the implementation of the strategy, and the extracted and verified data is used as the target data to be retrieved from the database.
[0109] The database query system based on graph neural networks of the present invention operates and has the same effect as the database query method based on graph neural networks described above, and will not be described again here.
[0110] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. This disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims. Thus, if these modifications and variations of the invention fall within the scope of the claims of the invention and their equivalents, the invention is also intended to include these modifications and variations.
Claims
1. A database query method based on graph neural networks, characterized in that, include: Listen to the query requests from several user terminals, preprocess all query requests, and obtain the query plan for the several user terminals; The query plan is processed by a neural network to obtain the query feature structure; The database is processed by a graph convolutional neural network to obtain the data element relationship information of the database, thereby generating a data element layout; the query feature structure and the data element layout are processed by a graph convolutional neural network to obtain the query path arrangement of the database. Based on the actual data change status of the database, an execution strategy for the query path arrangement is generated; based on the execution strategy, the target data is obtained by querying the database.
2. The database query method based on graph neural networks as described in claim 1, characterized in that: Listen to the query requests from several user terminals, preprocess all query requests, and obtain the query plan for the several user terminals; The query plan is processed by a neural network to obtain a query feature structure, including: Based on the historical query logs of several user terminals, the historical query initiation characteristics of the several user terminals are determined; wherein, the historical query initiation characteristics include the time domain layout and network domain layout of the query operation initiation during the historical query of the database by the user terminals; based on the historical query initiation characteristics, the query request listening mode of each of the several user terminals is adjusted. Semantic comparison is performed on the query terms of each query request to determine the similarity of query targets among all query requests; based on the similarity of query targets and the initiation time of each query request, all query requests are integrated to obtain the query plan for the several user terminals; The query plan is processed by a tree neural network to obtain all the query target content and their minimum query criteria; wherein, the minimum query criteria refers to the minimum text length of the query target content; based on all the query target content and their minimum query criteria, query elements corresponding one-to-one with all the query target content are generated and arranged to generate query structure features.
3. The database query method based on graph neural networks as described in claim 1, characterized in that: The database is processed by a graph convolutional neural network to obtain the data element relationship information of the database, thereby generating a data element layout; the query feature structure and the data element layout are processed by a graph convolutional neural network to obtain a query path arrangement for the database, including: Based on the image data update time and image data tags in the database, a number of image data are selected and retained; graph convolutional neural network processing is performed on the image data to obtain the semantic relationship identifiers and arrangements of the image data, thereby generating a data element layout. The query feature structure and the data element layout are processed by a graph convolutional neural network to obtain the connection relationships between all query elements under the query feature structure and the image data with semantic association under the data element layout; all connection relationships are mapped and prioritized within the database to obtain the query path arrangement for the database.
4. The database query method based on graph neural networks as described in claim 1, characterized in that: Based on the actual data change status of the database, an execution strategy for arranging the query path is generated; According to the execution strategy, the target data is obtained by querying the database, including: Monitor the real-time data write path within the database to determine the data access congestion intervals within the database; generate an execution strategy for the query path arrangement based on the distribution of all data access congestion intervals within the database; wherein, the execution strategy includes the strategy for the actual execution interval of the query path arrangement within the database; The data successfully accessed during the implementation of the execution strategy is extracted and verified, and the data that passes the extraction and verification is used as the target data obtained from the database.
5. A database query system based on graph neural networks, characterized in that, include: The query plan generation module is used to listen to the query requests of several user terminals, preprocess all query requests, and obtain the query plans of the several user terminals. The query structure determination module is used to perform neural network processing on the query plan to obtain the query feature structure; The database processing module is used to perform graph convolutional neural network processing on the database to obtain the data element relationship information of the database, thereby generating a data element layout. The query path determination module is used to perform graph convolutional neural network processing on the query feature structure and the data element layout to obtain the query path arrangement for the database. The execution strategy determination module is used to generate the execution strategy for the query path arrangement based on the actual data change status of the database. The target data acquisition module is used to query the database to obtain target data according to the execution strategy.
6. The database query system based on graph neural networks as described in claim 5, characterized in that: The query plan generation module is used to listen to query requests from several user terminals, preprocess all query requests, and obtain query plans for the several user terminals, including: Based on the historical query logs of several user terminals, the historical query initiation characteristics of the several user terminals are determined; wherein, the historical query initiation characteristics include the time domain layout and network domain layout of the query operation initiation during the historical query of the database by the user terminals; based on the historical query initiation characteristics, the query request listening mode of each of the several user terminals is adjusted. Semantic comparison is performed on the query terms of each query request to determine the similarity of query targets among all query requests; based on the similarity of query targets and the initiation time of each query request, all query requests are integrated to obtain the query plan for the several user terminals; The query structure determination module is used to perform neural network processing on the query plan to obtain the query feature structure, including: The query plan is processed by a tree neural network to obtain all the query target content and their minimum query criteria; wherein, the minimum query criteria refers to the minimum text length of the query target content; based on all the query target content and their minimum query criteria, query elements corresponding one-to-one with all the query target content are generated and arranged to generate query structure features.
7. The database query system based on graph neural networks as described in claim 5, characterized in that: The database processing module is used to perform graph convolutional neural network processing on the database to obtain the data element relationship information of the database, and thereby generate a data element layout, including: Based on the image data update time and image data tags in the database, a number of image data are selected and retained; graph convolutional neural network processing is performed on the image data to obtain the semantic relationship identifiers and arrangements of the image data, thereby generating a data element layout. The query path determination module is used to perform graph convolutional neural network processing on the query feature structure and the data element layout to obtain a query path arrangement for the database, including: The query feature structure and the data element layout are processed by a graph convolutional neural network to obtain the connection relationships between all query elements under the query feature structure and the image data with semantic association under the data element layout; all connection relationships are mapped and prioritized within the database to obtain the query path arrangement for the database.
8. The database query system based on graph neural networks as described in claim 5, characterized in that: The execution strategy determination module is used to generate an execution strategy for the query path arrangement based on the actual data change status of the database, including: Monitor the real-time data write path within the database to determine the data access congestion intervals within the database; generate an execution strategy for the query path arrangement based on the distribution of all data access congestion intervals within the database; wherein, the execution strategy includes the strategy for the actual execution interval of the query path arrangement within the database; The target data acquisition module is used to query the database to obtain target data according to the execution strategy, including: The data successfully accessed during the implementation of the execution strategy is extracted and verified, and the data that passes the extraction and verification is used as the target data obtained from the database.