Information query method, device and system and storage medium
By generating structured query statements based on the association between user account and input information during user query process and selecting target index, the problem of single query information and cumbersome process is solved, and more efficient information query is achieved.
Patent Information
- Application Number
- CN202510504575.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-21
- Publication Date
- 2025-07-18
AI Technical Summary
In the prior art, the user query method is single, resulting in a reduced accuracy of query information, a cumbersome query process, and a low query efficiency.
By determining the association between user account information and input information, a target structured query statement is generated, and the target index is selected based on the amount of resource consumption, thereby indexing in the target database and obtaining query information.
It simplifies the user query input process, improves the accuracy and efficiency of query information, and reduces the consumption of index resources.
Smart Images

Figure CN120336356A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data processing, and in particular, to an information query method, device, system, and storage medium. Background Art
[0002] Data query and analysis are important links in daily operations and problem troubleshooting. Especially in the actual production operation environment, being able to obtain and analyze data in a timely and accurate manner is crucial for quick response and problem solving, that is, the query efficiency is the key to the speed of problem solving. In the current query method, the user selects the input control corresponding to the user's own permission range on the operation interface of the OMS (Order Management System) according to the user's permission, and indexes the query information that matches the user input information based on the database corresponding to the input control. Its query method is only based on the input content, and its query content is single, resulting in a decrease in the accuracy of the query information, and the user query input process is cumbersome, resulting in low query efficiency. Summary of the Invention
[0003] The present invention provides an information query method, device, system, and storage medium to at least solve the problems of single query content, resulting in a decrease in the accuracy of query information, and the cumbersome user query input process, resulting in low query efficiency. The technical solution of the present invention is as follows:
[0004] According to the first aspect of the embodiments of the present invention, an information query method is provided. A target database associated with the user account information and the user input information is determined; target associated information that matches the user input information is determined from the historical query information of the user account; a target structured query statement is generated according to the target associated information and the input information; a target index is determined according to the target structured query statement and the resource consumption amount during the execution of the candidate index corresponding to the target structured query statement, so as to perform indexing in the target database based on the target index to obtain target query information.
[0005] In one implementation, determining the target index according to the target structured query statement and the resource consumption amount during the execution of the candidate index corresponding to the target structured query statement includes: determining a plurality of candidate indexes corresponding to the target structured query statement; determining the resource consumption amount of each candidate index during the execution of the plurality of candidate indexes; selecting, from the plurality of candidate indexes, a candidate index whose resource consumption amount is lower than the preset resource amount as the target index.
[0006] In another implementation, the method further includes: determining that the resource consumption of each candidate index is higher than a preset resource amount; splitting the target structured query statement into multiple sub-structured query statements with a parallel relationship; determining multiple groups of target indexes corresponding to the multiple sub-structured query statements; one group of target indexes corresponding to one sub-structured query statement; invoking multiple threads to perform parallel index queries on the multiple groups of target indexes to obtain target query information; the number of multiple threads being the same as the number of the multiple sub-structured query statements.
[0007] In another implementation, splitting the target structured query statement into multiple sub-structured query statements with a parallel relationship includes: determining multiple conditional statements associated with logical operators in the target structured query statement; determining set phrases included in the multiple conditional statements; splitting the set phrases into multiple sub-set words with a parallel relationship; for each time a sub-set word in the multiple sub-set words is selected, using the selected sub-set word to replace the corresponding set phrase in the multiple conditional statements, and successively obtaining a sub-structured query statement to obtain multiple sub-structured query statements.
[0008] In another implementation, splitting the set phrases into multiple sub-set phrases with a parallel relationship includes: determining multiple first sub-set word sets including various sub-set inclusion relationships of the set phrase, and determining the target number of threads of the idle threads; according to the target number of threads and the target resource operation index parameters of each idle thread, selecting, from the multiple first sub-set word sets, the first sub-set word set that is the same as the target number of threads and / or the target resource operation index parameters, and determining it as multiple sub-set phrases with a parallel relationship; determining a second sub-set word set including a single-layer sub-set inclusion relationship of the set phrase, and determining the second sub-set word set as multiple sub-set words with a parallel relationship.
[0009] In another implementation, determining the target database associated with the user account information and the user input information includes: according to the mapping relationship between the user account identifier and the database, determining the candidate database associated with the target account identifier in the user account information; extracting semantic keywords from the user input information; screening out the target database related to the semantic keywords from the candidate databases.
[0010] In another implementation, the method further includes: in response to the user input information of the user account, displaying a target exception indication information indicating an abnormal input of the user account; based on the target exception indication information, determining a target exception handling method for handling the abnormal input of the user account, and displaying the target handling information indicating the target exception handling method on the user query page of the user account.
[0011] According to a second aspect of an embodiment of the present invention, there is provided an information query device, which includes: a first determination unit configured to determine a target database associated with user account information and user input information; a second determination unit configured to determine, from the historical query information of the user account, target associated information that matches the user input information; a generation unit configured to generate a target structured query statement according to the target associated information and the input information; and an indexing unit configured to determine a target index according to the target structured query statement and the resource consumption amount during the execution of the candidate index corresponding to the target structured query statement, so as to perform indexing in the target database based on the target index to obtain target query information.
[0012] According to a third aspect of an embodiment of the present invention, there is provided an information query system, which is configured to execute the information query method according to the first aspect and any possible implementation manner thereof.
[0013] According to a fourth aspect of an embodiment of the present invention, there is provided a computer-readable storage medium, on which instructions are stored. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device can execute the information query method according to the first aspect and any possible implementation manner thereof.
[0014] According to a fifth aspect of an embodiment of the present disclosure, there is provided a computer program product, which includes computer instructions. When the computer instructions run on an electronic device, the electronic device is enabled to execute the information query method according to the first aspect and any possible implementation manner thereof.
[0015] The technical solution provided by the embodiment of the present application at least brings the following beneficial effects: During the information query process of the present application, it is possible to directly select, based on the received user input information, a target database that matches the user account and the input information from multiple databases. In this way, all users only need to input relevant information on the same user query interface to determine, in all databases, a target database to which the user has query permission and that is related to the input information, without the user having to select the corresponding query interface from multiple query interfaces according to the known query permissions to determine the database, which simplifies the user query input process.
[0016] Meanwhile, compared with the fixed corresponding relationship between query interfaces with different functions and databases in related technologies, the above-mentioned association relationship between direct user account information and input information and the database to determine the target database has a more flexible corresponding relationship. For example, in related technologies, multiple query interfaces need to be configured for users, and users need to switch back and forth between different query interfaces multiple times to complete the input. However, a user account can be configured with multiple databases with multiple functions, and the user account only needs to input relevant information once on a unified query interface to automatically determine the target database, making the database positioning faster and easier.
[0017] Furthermore, in order to improve the information input efficiency of users during the query process and ensure that the provided query information is more sufficient and comprehensive while reducing the information input by users, according to the user's historical query habits, associated information that matches the user's input information is selected, and a query statement is generated based on multiple information dimensions of the associated information and the input information, so that the query statement fully matches the input information and the associated information. At the same time, in order to improve the indexing efficiency, the target index is determined based on the resource consumption for indexing, so as to reduce the indexing resource consumption and improve the information query efficiency.
[0018] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. Brief Description of the Drawings
[0019] The drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0020] Figure 1 is a schematic diagram of an information query system shown according to an exemplary embodiment;
[0021] Figure 2 is a flowchart of an information query method shown according to an exemplary embodiment;
[0022] Figure 3 is a block diagram of an information query device shown according to an exemplary embodiment;
[0023] Figure 4 is a schematic diagram of an information query device shown according to an exemplary embodiment. Detailed Embodiments
[0024] In order to enable those of ordinary skill in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings.
[0025] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of the present disclosure are used to distinguish similar objects, and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present disclosure described here can be implemented in an order other than those illustrated or described here. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0026] Before introducing the information query method provided by the embodiments of the present application in detail, the application scenarios and implementation frameworks involved in the embodiments of the present application will be briefly introduced.
[0027] First, the application scenarios involved in the present application will be briefly introduced.
[0028] Data query and analysis are important links in daily operations and problem troubleshooting. Especially in the actual production operation environment, being able to obtain and analyze data in a timely and accurate manner is crucial for quick response and problem solving, that is, the query efficiency is the key to the speed of problem solving. In the current query method, the user selects the input control corresponding to the user's own permission range on the operation interface of the OMS (Order Management System) according to the user's permission, and indexes the query information matching the user input information based on the database corresponding to the input control. Its query method is only based on the input content, and its query content is single, resulting in a decrease in the accuracy of the query information, and the user query input process is cumbersome, resulting in low query efficiency.
[0029] In view of the above problems, the present application proposes an information query method, which can directly select the target database that matches the user account and input information from multiple databases based on the received user input information. In this way, all users only need to enter relevant information on the same user query interface to determine the target database that the user has query permission and is related to the input information in all databases, without the user having to select the corresponding query interface from multiple query interfaces according to the known query permission to determine the database, which simplifies the user query input process. Further, in order to improve the information input efficiency of the user during the query process and ensure that the provided query information is more sufficient and comprehensive while reducing the user input information, the associated information that matches the user input information is selected according to the user's historical query habits, and a query statement is generated based on multiple information dimensions of the associated information and the input information, so that the query statement fully matches the input information and the associated information. At the same time, in order to improve the indexing efficiency, the target index is determined based on the resource consumption to reduce the indexing resource consumption and improve the information query efficiency.
[0030] Secondly, the implementation architecture involved in this application will be briefly introduced below.
[0031] Figure 1 It is a schematic diagram of an information query system provided by the present disclosure. As Figure 1 shown, the information query system includes a terminal device 11 and a server 12. The terminal device 11 and the server 12 are communicatively connected via a wired network or a wireless network.
[0032] In response to the user inputting information on the input interface of the terminal device 11, the terminal device 11 selects a target database from multiple databases of the server 12 that is consistent with the account permissions of the user account and is associated with the user input information. And according to the historical query information of the user account, it selects historical associated information (i.e., target associated information) that is relevant to the user input information but not the input. Based on the historical associated information and the user input information, it constructs a target structured query statement. Further, it determines the resource consumption amount of each candidate index corresponding to the target structured query statement during the index execution process, and selects the candidate index with the least resource consumption amount for information indexing to obtain the query information.
[0033] For ease of understanding, the information query method provided by this application will be specifically introduced below in conjunction with the accompanying drawings. This information query method is applied to the above information query system.
[0034] Figure 2 It is a flowchart of an information query method shown according to an exemplary embodiment. As Figure 2 shown, this information query method includes the following steps.
[0035] S11, determine the target database associated with the user account information and the user input information.
[0036] The user account information includes the user's access permission information for the database.
[0037] The mapping relationship set between the user account and the database.
[0038] In some implementation manners, based on the access permissions of the user account to the database, a mapping relationship between each user account and each database is pre-configured. First, determine one or more databases to which the user account has access permissions. Then, extract keywords from the user input information and / or the target associated information, and screen out the target database that matches the keywords from the above one or more databases.
[0039] The server directly selects a target database that matches the user account and input information from multiple databases based on the received user input information. In this way, all users only need to enter relevant information on the same user query interface to determine, among all databases, the target database to which the user has query permission and that is relevant to the input information, without the user having to select the corresponding query interface from multiple query interfaces according to the known query permissions to determine the database, simplifying the query process for the user to determine the target database. At the same time, compared with the fixed corresponding relationship between query interfaces with different functions and databases in the related art, the above method of determining the target database based on the direct association relationship between user account information and input information and the database has a more flexible corresponding relationship. For example, in the related art, multiple query interfaces need to be configured for the user, and the user needs to switch back and forth between different query interfaces multiple times to complete the input. However, a single user account can be configured with multiple databases with multiple functions, and the user only needs to enter relevant information once on the unified query interface to automatically determine the target database, making the database location faster and easier.
[0040] In some embodiments, different query interface identifiers correspond to different databases for the user to query the corresponding ones after passing the permission authentication. By using the information query method of the present application, only a unified user retrieval input interface needs to be set on the user terminal interface for inputting information. The server can automatically call the relevant database and the relevant information display interface or information query interface according to the user account permission, without the user having to search one by one among multiple query interfaces based on the query permissions known to the user.
[0041] S12. Determine the target associated information that matches the user input information from the historical query information of the user account.
[0042] Based on the historical query habits of the user account, the target associated information that the user has not entered but is likely to be entered currently is also used as the query information for querying, so that the displayed query information conforms to the user's query habits.
[0043] S13. Generate a target structured query statement according to the target associated information and the input information.
[0044] Using the target associated information and the input information as the query basis for query information improves the accuracy of generating the structured query statement.
[0045] S14. Determine the target index according to the target structured query statement and the resource consumption amount during the execution of the candidate index corresponding to the target structured query statement, and perform indexing in the target database based on the target index to obtain the target query information.
[0046] Select a target index with less resource consumption, and perform indexing in the target database to obtain target query information with less resource consumption.
[0047] In the above embodiment, in order to improve the information input efficiency of the user during the query process, based directly on the association relationship between the user account and the input information, the target database is accurately determined from multiple databases. First, based directly on the received user input information, the target database that matches the user account and the input information is selected from multiple databases. In this way, all users only need to input relevant information on the same user query interface, and then the target database that the user has query permission for and is related to the input information can be determined in all databases. There is no need for the user to select the corresponding query interface from multiple query interfaces according to the known query permission to determine the database, which simplifies the user query input process.
[0048] At the same time, compared with the fixed corresponding relationship between query interfaces with different functions and databases in the related art, the above method of determining the target database based on the direct association relationship between user account information and input information and the database has a more flexible corresponding relationship. For example, in the related art, multiple query interfaces need to be configured for the user, and the user needs to switch back and forth between different query interfaces multiple times to complete the input. However, for one user account, multiple databases with multiple functions can be configured. The user account only needs to input relevant information once on the unified query interface to automatically determine the target database, and the database positioning is faster and simpler.
[0049] Furthermore, in order to improve the information input efficiency of the user during the query process and ensure that the provided query information is more sufficient and comprehensive on the premise of reducing the user input information, according to the user's historical query habits, the associated information that matches the user input information is selected, and a query statement is generated based on multiple information dimensions of the associated information and the input information, so that the query statement fully matches the input information and the associated information. At the same time, in order to improve the indexing efficiency, the target index is determined for indexing based on the resource consumption, so as to reduce the index resource consumption and improve the information query efficiency.
[0050] As a refinement and extension of the specific implementation manner of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, the above embodiment is further described through the following implementation steps.
[0051] As an implementation manner, the above step S11 can determine the target database in the following way.
[0052] First, according to the mapping relationship between the user account identifier and the database, the candidate database associated with the target account identifier in the user account information is determined from multiple databases.
[0053] Second, extract semantic keywords from the user input information.
[0054] Thirdly, screen out the target database related to the semantic keywords from the candidate databases.
[0055] Each of the above databases is respectively associated with different preset keywords and different account identifiers.
[0056] As an implementation manner, in order to improve the indexing efficiency, select a candidate index with a low resource consumption as the target index to reduce resource consumption and improve the indexing speed. Specifically, firstly, determine multiple candidate indexes corresponding to the target structured query statement, and determine the resource consumption of each candidate index during the execution process of the multiple candidate indexes. Secondly, select a candidate index with a resource consumption lower than the preset resource amount from the multiple candidate indexes as the target index.
[0057] In some implementation manners, select the candidate index with the least resource consumption from the multiple candidate indexes as the target index.
[0058] As a preset resource amount determination method, in order to ensure the rationality of the preset resource amount setting, determine the above preset resource amount according to the resource consumption of each candidate index and the rated resource amount of the current processing thread.
[0059] In order to ensure that the target index with the lowest resource consumption is selected, first set the preset resource amount to be less than or equal to the rated resource amount to ensure the feasibility of information processing.
[0060] Then, when the resource consumption of each candidate index is less than the rated resource amount of the current processing thread, arrange the resource consumption of each candidate index in ascending order, and determine the resource consumption of the candidate index in the second order as the preset resource amount.
[0061] When the resource consumption of some of the candidate indexes is less than the rated resource amount of the current processing thread, re-screen the candidate indexes with a resource consumption less than the rated resource amount from the candidate indexes, and arrange them in ascending order, and determine the resource consumption of the candidate index in the second order after the re-screening as the preset resource amount. When the resource consumption of each candidate index is greater than or equal to the rated resource amount of the current processing thread, determine the rated resource amount as the preset resource amount.
[0062] As another implementation manner, for the case where the resource consumption of the candidate indexes is relatively large, by means of screening and splitting the query statement and increasing the number of threads, adopt parallel processing of multiple groups of indexes by multiple threads simultaneously to improve the indexing efficiency.
[0063] Specifically, first, judge the size relationship between the resource consumption of each candidate index and the corresponding preset resource amount.
[0064] Secondly, if it is determined that the resource consumption of each candidate index is higher than the preset resource amount, it means that the resource consumption of each candidate index is relatively high, and a large amount of resources are required during the indexing process. Then, the target structured query statement is split into multiple sub-structured query statements with a parallel relationship.
[0065] Thirdly, determine multiple groups of target indexes corresponding to the multiple sub-structured query statements, where one group of target indexes corresponds to one sub-structured query statement. Set a processing thread for each group of target indexes respectively, and call the multiple threads corresponding to the multiple groups of target indexes to perform parallel index queries on the multiple groups of target indexes to obtain the target query information, where the number of multiple threads is the same as the number of multiple sub-structured query statements.
[0066] As a way of generating a structured query statement, first determine the multiple conditional statements associated with the logical operators in the target structured query statement to determine the statement composition and statement structure in the target structured query statement. Then determine the set phrases included in each of the multiple conditional statements respectively. Determine that each set phrase is disassembled into multiple subset words.
[0067] For each time a subset word is selected from the multiple subset words, use the selected subset word to replace the corresponding set phrase in the multiple conditional statements, and obtain a sub-structured query statement each time, so as to obtain multiple conditional statements, where the number of multiple conditional statements is the same as the number of multiple subset words.
[0068] For any set phrase, sequentially replace any subset phrase in the multiple conditional statements with the corresponding subset phrase.
[0069] In this embodiment, the set phrases included in the conditional statements in the structured query statement are used to split the structured query statement to obtain multiple sub-structured statements.
[0070] As an embodiment, if the conditional statements in the structured query statement do not include any set phrases, then
[0071] For example, the target structured query statement is composed of (A and B) or C. A, B, and C are the three conditional statements.
[0072] The above set phrases can be, for example, "year" and "month", "China" and each province, etc., which can be disassembled into multiple subset words.
[0073] The set phrase "province" is disassembled into multiple subset words corresponding to multiple cities according to "city", or the set phrase "province" is disassembled into multiple subset words corresponding to multiple districts according to "district".
[0074] In one implementation, for a scenario where a collective phrase includes multiple subset inclusion relationships, that is, the collective phrase and the subset inclusion relationship are not unique, first determine multiple first subset word sets of the collective phrase that include multiple subset inclusion relationships, and determine the target number of threads of the idle threads. Then, according to the target number of threads and the target resource operation index parameters of each idle thread, select, from the multiple first subset word sets, the first subset word sets that are consistent with the target number of threads and / or the target resource operation index parameters, and determine them as multiple subset words in a parallel relationship.
[0075] The above-mentioned collective phrase and the subset inclusion relationship are not unique, which can be understood as that the collective phrase can divide the subset collective words at different granularities.
[0076] Exemplarily, the collective phrase "year" can be split into four subset words of spring, summer, autumn, and winter according to quarters; while "year" can be disassembled into 12 subset words of January, February, March,..., December according to months.
[0077] Based on this, for different granularity inclusion relationships, the number of subset words is not the same, more or less. Then, to ensure the feasibility of thread processing during operation, make the number of subset words less than the target number of threads, and the resource operation index parameter of each thread meets the processing requirements (for example, the available resource amount of each thread is greater than the resource consumption amount of the index).
[0078] Taking the collective phrase "year" in the above example as an example, when "year" is split according to quarters, four threads are required, while when it is divided by month, 12 threads are required. It is necessary to determine whether to disassemble by quarter or by month in combination with whether the system resources can provide 12 threads.
[0079] In some implementations, the mapping relationships between different preset collective phrases and subset word sets are prestored and set.
[0080] In another implementation, for a scenario where a collective phrase includes one subset inclusion relationship, that is, the collective phrase and the subset inclusion relationship are unique, first determine a second subset word set of the collective phrase that includes a single-layer subset inclusion relationship, and then directly determine the second subset word set as multiple subset words in a parallel relationship.
[0081] Exemplarily, the collective phrase "female students" can only be divided into a subset word set with a unique inclusion relationship, that is, "female students" can be split into female infants, female children, female youths, female middle-aged people, and female elderly people.
[0082] As an implementation, in order to reduce the risk that users blindly or ineffectively handle a fault when a fault occurs and improve the fault handling efficiency, the server will first respond to the user input information of the user account and display a target exception indication information indicating an abnormal input of the user account to prompt the user that a query fault has occurred. Based on the target exception indication information, determine a target exception handling method for handling the abnormal input of the user account, and display the target processing information indicating the target exception handling method on the user query page of the user account.
[0083] The above abnormal input of the user account includes one or more of the following abnormalities. First, the access permission of the user account is abnormal (for example, information matching the relevant input information and the target relevant information cannot be detected in the target database, or the target database associated with the user input information does not exist in the user account information association database). For this abnormality, based on the semantic keywords extracted from the user input information and / or the target relevant information, determine the database to be accessed, determine that there is no access permission to the database to be accessed, and generate the target processing information for opening the access permission to the database to be accessed. Second, the system processing is abnormal (for example, due to the system processing performance not meeting the processing requirements, a system exception occurs, resulting in the page not being displayed or remaining in the loading state all the time, etc.). For this abnormality, display the target processing information of the system exception.
[0084] In a specific embodiment, using the information query method in the above implementation, develop a system with functions such as "application startup traffic query", "query configuration center", "query CGW configuration", "query Bill table", "query recent trips", "query reimbursement data", "query master data", "query external plug-in fee control", etc.
[0085] First, the system includes an intelligent query recommendation subsystem based on dynamic data association. Specifically, through intelligent recommendation and optimization, users only need to input a small number of conditions, and the system can automatically recommend relevant query fields and conditions, simplify the query process, and improve the query efficiency. For example, when querying recent trips, users only need to input a time range, and the system can automatically recommend relevant query fields and generate the required SQL statement.
[0086] The specific operations of "data association algorithm", "intelligent recommendation", and "user feedback optimization" in the intelligent query recommendation subsystem based on dynamic data association are as follows.
[0087] Data association algorithm: Use machine learning or a rule engine to analyze the conditions input by the user and automatically associate relevant data tables. For example, machine learning models such as decision trees, random forests, or neural networks can be used to predict and recommend relevant data tables and query fields based on a small number of conditions input by the user.
[0088] Intelligent Recommendation: Based on historical query records and data relationships, recommend potentially relevant query fields or filtering conditions. The system can maintain a query history database to record users' query behaviors and results. By analyzing this data, a recommendation model is generated.
[0089] User Feedback Optimization: Continuously optimize the recommendation algorithm through users' feedback on the recommendation results. The system can provide a feedback mechanism that allows users to mark the accuracy of the recommendation results. This feedback data can be used to train and optimize the recommendation model.
[0090] Through intelligent recommendation and optimization, with the above subsystems, users only need to input a small number of conditions, and the system can automatically recommend relevant query fields and conditions, simplifying the query process and improving query efficiency.
[0091] Second, it includes an adaptive query optimization subsystem based on context awareness. Specifically, through context awareness and adaptive optimization, the system can dynamically adjust the query strategy according to different query scenarios and user roles, improving query efficiency. For example, when querying the Bill table, the system can select an appropriate index strategy based on the user role to optimize query performance and reduce query time.
[0092] Through context awareness and adaptive optimization, the above system can dynamically adjust the query strategy according to different query scenarios and user roles, improving query efficiency.
[0093] Third, it includes a data privacy protection and secure access control subsystem.
[0094] Specifically, access control: Role-Based Access Control (RBAC) and dynamic permission management to ensure that users can only access the data within their permissions. The system can define different roles and permissions and dynamically allocate access permissions according to the user's role.
[0095] Data Masking: Mask sensitive data (such as names, ID numbers) to ensure that the data cannot be reverse-engineered when displayed. Data masking algorithms, such as hash functions, data replacement, or data masking, can be used to process sensitive data.
[0096] Auditing and Logging: Record all query operations, provide an auditing function to ensure the transparency and traceability of data access. The system can maintain an audit log to record users' query operations, access times, and access content for security auditing and problem troubleshooting.
[0097] The above subsystems ensure data security and privacy protection and reduce the risk of data leakage through access control, data masking, and auditing functions. For example, when querying master data, the system will dynamically allocate access permissions according to the user role and mask sensitive data to ensure data security.
[0098] To implement the above functions, the information query device includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, in combination with the algorithm steps of each example described in the embodiments disclosed in this article, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.
[0099] The embodiments of the present disclosure also provide an information query device as Figure 3 shown, and the device includes: a first determination unit 31, a second determination unit 32, a generation unit 33, and an index unit 34.
[0100] The first determination unit 31 is configured to determine a target database associated with the user account information and the user input information; the second determination unit 32 is configured to determine target associated information matching the user input information from the historical query information of the user account; the generation unit 33 is configured to generate a target structured query statement according to the target associated information and the input information; the index unit 34 is configured to determine a target index according to the target structured query statement and the resource consumption amount during the execution of the candidate index corresponding to the target structured query statement, and perform indexing in the target database based on the target index to obtain target query information.
[0101] In one implementation manner, the index unit 34 is specifically configured to: determine multiple candidate indexes corresponding to the target structured query statement; determine the resource consumption amount of each candidate index during the execution of the multiple candidate indexes; select, from the multiple candidate indexes, a candidate index whose resource consumption amount is lower than the preset resource amount as the target index.
[0102] In another implementation manner, the index unit 34 is further specifically configured to: determine that the resource consumption amount of each candidate index is higher than the preset resource amount; split the target structured query statement into multiple sub-structured query statements with a parallel relationship; determine multiple groups of target indexes corresponding to the multiple sub-structured query statements; one group of target indexes corresponds to one sub-structured query statement; call multiple threads to perform parallel index queries on the multiple groups of target indexes to obtain target query information; the number of multiple threads is the same as the number of multiple sub-structured query statements.
[0103] In another implementation, the generating unit 33 is further specifically configured to: determine multiple conditional statements associated with logical operators in the target structured query statement; determine set phrases included in the multiple conditional statements; disassemble the set phrases into multiple subset words in a parallel relationship; for each subset word sequentially selected from the multiple subset words, replace the corresponding set phrase in the multiple conditional statements with the selected subset word to sequentially obtain a sub-structured query statement, so as to obtain multiple sub-structured query statements.
[0104] In another implementation, the generating unit 33 is further specifically configured to: determine multiple first subset word sets including various subset inclusion relationships of the set phrase, and determine the target number of threads of the idle threads; according to the target number of threads and the target resource operation index parameters of each idle thread, select a first subset word set that is consistent with the target number of threads and / or the target resource operation index parameters from the multiple first subset word sets, and determine it as multiple subset phrases in a parallel relationship; determine a second subset word set including a single-layer subset inclusion relationship of the set phrase, and determine the second subset word set as multiple subset words in a parallel relationship.
[0105] In another implementation, the first determining unit 31 is specifically configured to: determine a candidate database associated with the target account identifier in the user account information according to the mapping relationship between the user account identifier and the database; extract semantic keywords from the user input information; screen out a target database related to the semantic keywords from the candidate databases.
[0106] In another implementation, the first determining unit 31 is further configured to: in response to the user input information of the user account, display a target exception indication information indicating an abnormal input of the user account; based on the target exception indication information, determine a target exception handling method for handling the abnormal input of the user account, and display the target handling information indicating the target exception handling method on the user query page of the user account.
[0107] Regarding the device in the above embodiments, the specific manner in which each unit module performs operations has been described in detail in the embodiments related to the method, and will not be elaborated here.
[0108] Figure 4 It is a schematic diagram of an information query device provided by the present application. As Figure 4 , the information query device 50 may include at least one processor 501 and a memory 503 for storing processor-executable instructions. Among them, the processor 501 is configured to execute the instructions in the memory 503 to implement the information query method in the following embodiments.
[0109] In addition, the information query device 50 may further include a communication bus 502, at least one communication interface 504, an input device 506, and an output device 505.
[0110] The processor 501 may be a central processing unit (CPU), a microprocessing unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the solution of the present application.
[0111] The communication bus 502 may include a path for transmitting information between the above components.
[0112] The communication interface 504 uses any device such as a transceiver for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0113] The input device 506 is used to receive input signals and the output device 505 is used to output signals.
[0114] The memory 503 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or it may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processing unit through a bus. The memory may also be integrated with the processing unit.
[0115] Among them, the memory 503 is used to store the instructions for executing the solution of the present application and is controlled by the processor 501 to execute. The processor 501 is used to execute the instructions stored in the memory 503, thereby implementing the functions in the method of the present application.
[0116] In a specific implementation, as an embodiment, the processor 501 may include one or more CPUs, for example Figure 4CPU0 and CPU1 therein.
[0117] In a specific implementation, as an example, the information query device 50 may include multiple processors, such as Figure 4 processor 501 and processor 507 therein. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. The processors herein may refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).
[0118] The information query device, as shown in Figure 4 includes: a processor 501 and a memory 503 for storing executable instructions executable by the processor 501; wherein, the processor 501 is configured to execute the executable instructions to implement the information query method of any of the above possible implementation manners. And the same technical effects can be achieved. To avoid repetition, it will not be elaborated here.
[0119] The embodiment of the present application further provides a computer-readable storage medium. When the instructions in the computer-readable storage medium are executed by the processor of the information query device or the information query device, the information query device or the information query device can execute the information query method of any of the above possible implementation manners. And the same technical effects can be achieved. To avoid repetition, it will not be elaborated here.
[0120] The embodiment of the present application further provides a computer program product, including a computer program or instructions. The computer program or instructions are executed by the processor to implement the information query method of any of the above possible implementation manners. And the same technical effects can be achieved. To avoid repetition, it will not be elaborated here.
[0121] Those skilled in the art will readily think of other implementation manners of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application. These variations, uses, or adaptations follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and the embodiments are only regarded as exemplary, and the true scope and spirit of the present application are pointed out by the following claims.
[0122] It should be understood that the present application is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. An information query method, characterized in that, The method includes: Determine a target database associated with the user account information and the user input information; Determine target associated information that matches the user input information from the historical query information of the user account; Generate the target structured query statement according to the target associated information and the input information; Determine a target index according to the target structured query statement and the resource consumption amount during the execution of the candidate index corresponding to the target structured query statement, so as to perform indexing in the target database based on the target index to obtain the target query information.
2. The information query method according to claim 1, wherein The determining the target index according to the target structured query statement and the resource consumption amount during the execution of the candidate index corresponding to the target structured query statement includes: Determine multiple candidate indexes corresponding to the target structured query statement; Determine the resource consumption amount of each candidate index during the execution of the multiple candidate indexes; Select, from the multiple candidate indexes, a candidate index whose resource consumption amount is lower than a preset resource amount as the target index.
3. The information query method according to claim 2, wherein The method further includes: Determine that the resource consumption amount of each candidate index is higher than the preset resource amount; Split the target structured query statement into multiple sub-structured query statements with a parallel relationship; Determine multiple groups of target indexes corresponding to the multiple sub-structured query statements; one group of target indexes corresponds to one sub-structured query statement; Call multiple threads to perform parallel index queries on multiple groups of target indexes to obtain the target query information; the number of the multiple threads is the same as the number of the multiple sub-structured query statements.
4. The information query method according to claim 3, wherein The splitting the target structured query statement into multiple sub-structured query statements with a parallel relationship includes: Determine multiple conditional statements associated with logical operators in the target structured query statement; Determine set phrases included in the multiple conditional statements; Decompose the set phrase into multiple subset words with a parallel relationship; For each subset word selected from the multiple subset words in sequence, replace the corresponding set phrase in the multiple conditional statements with the selected subset word to obtain a sub-structured query statement in sequence, so as to obtain the multiple sub-structured query statements.
5. The information query method according to claim 4, wherein The decomposing the set phrase into multiple subset phrases with a parallel relationship includes: Determine multiple first subset word sets including various subset inclusion relationships in the set phrase, and determine the target thread number of idle threads; select, from the multiple first subset word sets, a first subset word set that is the same as the target thread number and / or the target resource operation index parameter of each idle thread, and determine it as the multiple subset phrases with a parallel relationship; Determine a second subset word set including a single-layer subset inclusion relationship in the set phrase, and determine the second subset word set as the multiple subset words with a parallel relationship.
6. The information query method according to any one of claims 1 to 5, characterized in that The determining the target database associated with the user account information and the user input information includes: Determine a candidate database associated with the target account identifier in the user account information according to the mapping relationship between the user account identifier and the database; Extract semantic keywords from the user input information; Screen out the target database related to the semantic keywords from the candidate databases.
7. The information query method according to any one of claims 1 to 5, characterized in that The method further includes: In response to the user input information of the user account, display a target exception indication information indicating that the user account input is abnormal; Based on the target exception indication information, determine a target exception handling method for handling the user account input exception, and display target processing information indicating the target exception handling method on the user query page of the user account.
8. An information query device, characterized in that, The device includes: A first determination unit configured to determine a target database associated with the user account information and the user input information; A second determination unit configured to determine target associated information matching the user input information from the historical query information of the user account; A generation unit configured to generate the target structured query statement according to the target associated information and the input information; An indexing unit configured to determine a target index according to the target structured query statement and the resource consumption amount during the execution of the candidate index corresponding to the target structured query statement, and perform indexing in the target database based on the target index to obtain the target query information.
9. An information query system, characterized in that, The information query system is configured to execute the information query method according to any one of claims 1-7.
10. A computer-readable storage medium, on which instructions are stored, characterized in that, When the instructions in the computer-readable storage medium are executed by the processor of the information query device, the information query device is enabled to execute the information query method according to any one of claims 1-7.