Data query processing method and system, electronic equipment and storage medium
By designing data query processing methods for query display modules, query erratic modules, query construction modules and result output modules in the XDR system, the problem of low efficiency and high threshold when querying big data is solved, and an efficient and convenient data query experience is achieved.
Patent Information
- Application Number
- CN202411754493.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-03-28
AI Technical Summary
In the XDR system, when users conduct data query, due to the large amount of data, many data fields, and complex field expression, the query efficiency is low and the threshold is high, which affects the user experience.
A data query processing method is designed, including query display module, query errata module, query construction module and result output module. By displaying related content in real time, assisting users in retrieval and reducing the requirements for using knowledge reserves; detecting query conditions through the query errata module to accurately prompt errors in real time, reducing the efficiency waste caused by erroneous input.
It effectively lowers the query threshold for users, improves query efficiency, improves user query experience, and promotes user work efficiency.
Smart Images

Figure CN119719436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud security technology, and in particular to a data query processing method, a query system, an electronic device and a computer-readable storage medium. Background Art
[0002] At present, there are massive data records in the XDR (Extended Detection and Response) system, and these records often have various associations. The current conventional method is to use specific conditions to substitute the spliced query statements for corresponding conditional queries. This method is the most direct and is applicable when the query conditions are relatively fixed. However, XDR belongs to a system that needs to connect to various atomic capabilities. The data recorded by it has the characteristics of large data volume, multiple data fields, and complex field expressions. In the process of querying data, there are problems such as large data volume, multiple data fields, and complex field expressions that cannot be effectively dealt with. In the process of querying data, users need to rely on corresponding knowledge reserves to perform corresponding data retrieval and have corresponding usage thresholds. In addition, users need to input repeatedly to retrieve results that meet their needs, which greatly reduces the user's query efficiency and seriously affects the user's experience of using XDR to query corresponding content. Summary of the invention
[0003] The embodiments of the present invention provide a data query processing method, system, electronic device and computer-readable storage medium to solve or partially solve the problems of high threshold and low query efficiency in the process of data retrieval based on XDR.
[0004] The embodiment of the present invention discloses a data query processing method, which is applied to a query system, wherein the query system at least includes a query display module, a query errata module connected to the query display module, a query construction module connected to the query errata module, and a result output module connected to the query construction module. The method includes:
[0005] The query display module obtains the query content input by the user, and if there is related content corresponding to the query content, displays the related content;
[0006] generating, by the query display module, a query condition corresponding to the query content and / or the associated content in response to a confirmation operation on the query content and / or the associated content;
[0007] The query condition is detected by the query correction module, and if there is no abnormality in the query condition, the query condition is transmitted to the query construction module;
[0008] Constructing a query statement corresponding to the query condition through the query construction module, and if target data corresponding to the query statement is found, transmitting the target data to the result output module;
[0009] The target data is displayed through the result output module.
[0010] The embodiment of the present invention further discloses a query system, which comprises at least a query display module, a query correction module connected to the query display module, a query construction module connected to the query correction module, and a result output module connected to the query construction module; wherein:
[0011] The query display module is used to obtain the query content input by the user, and if there is related content corresponding to the query content, display the related content;
[0012] The query display module is used to generate a query condition corresponding to the query content and / or the associated content in response to a confirmation operation on the query content and / or the associated content;
[0013] The query correction module is used to detect the query condition, and if there is no abnormality in the query condition, transmit the query condition to the query construction module;
[0014] The query construction module is used to construct a query statement corresponding to the query condition, and if target data corresponding to the query statement is found, the target data is transmitted to the result output module;
[0015] The result output module is used to display the target data.
[0016] The embodiment of the present invention further discloses an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0017] The memory is used to store computer programs;
[0018] The processor is used to implement the method described in the embodiment of the present invention when executing the program stored in the memory.
[0019] The embodiment of the present invention further discloses a computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, enables the processors to execute the method described in the embodiment of the present invention.
[0020] The embodiments of the present invention include the following advantages:
[0021] In an embodiment of the present invention, the query system may include a query display module, a query errata module connected to the query display module, a query construction module connected to the query errata module, and a result output module connected to the query construction module. When a user inputs a corresponding query operation on the query system, the system may obtain the query content input by the user through the query display module. If there is related content corresponding to the query content, the related content is displayed. By displaying the related content in real time, the user is assisted in searching, the requirement for the user's knowledge reserve is reduced, and the query threshold is lowered. At the same time, the query display module may respond to the confirmation operation on the query content and / or related content to generate The query conditions corresponding to the query content and / or related content are formed, and the query conditions are checked through the query correction module. If there is no abnormality in the query conditions, the query conditions are transmitted to the query construction module. By correcting the query conditions determined by the user, it is possible to accurately prompt errors in real time, reduce the efficiency waste caused by incorrect input, and ensure the user's retrieval efficiency. The query construction module constructs a query statement corresponding to the query conditions. If the target data corresponding to the query statement is queried, the target data is transmitted to the result output module, and the target data is displayed through the result output module, thereby effectively ensuring the user's query experience and promoting the user's work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flowchart of a data query processing method provided in an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of the structure of a query system provided in an embodiment of the present invention;
[0024] Figure 3 is a functional schematic diagram of a configuration module provided in an embodiment of the present invention;
[0025] Figure 4 is a functional schematic diagram of a query display module provided in an embodiment of the present invention;
[0026] Figure 5 is a functional schematic diagram of an errata query module provided in an embodiment of the present invention;
[0027] Figure 6 is a functional schematic diagram of a query construction module provided in an embodiment of the present invention;
[0028] Figure 7 It is a block diagram of an electronic device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] As an example, since XDR belongs to a system that needs to connect to various types of atomic capabilities, the data it records has the characteristics of large data volume, multiple data fields, and complex field expressions. In the process of querying data, there is an inability to effectively deal with problems such as large data volume, multiple data fields, and complex field expressions. In the process of querying data, users need to rely on corresponding knowledge reserves to perform corresponding data retrieval and have corresponding usage thresholds. Users need to input repeatedly to retrieve results that meet their needs, which greatly reduces the user's query efficiency and seriously affects the user's experience of using XDR to query corresponding content.
[0031] In this regard, in the present invention, by constructing a corresponding query system, users can perform corresponding data queries through the query system. The query system can include a query display module, a query errata module connected to the query display module, a query construction module connected to the query errata module, and a result output module connected to the query construction module. When the user enters a corresponding query operation on the query system, the system can obtain the query content entered by the user through the query display module. If there is related content corresponding to the query content, the related content is displayed. By displaying the related content in real time, the user is assisted in searching, the requirement for the user's knowledge reserve is reduced, and the query threshold is lowered. At the same time, the query display module can be used to respond to the query. The query conditions corresponding to the query conditions and / or related contents are generated, and the query conditions are checked through the query correction module. If there is no abnormality in the query conditions, the query conditions are transmitted to the query construction module. By correcting the query conditions determined by the user, errors can be accurately prompted in real time, reducing the efficiency waste caused by incorrect input, and ensuring the user's retrieval efficiency. The query construction module constructs a query statement corresponding to the query conditions. If the target data corresponding to the query statement is queried, the target data is transmitted to the result output module, and the target data is displayed through the result output module, thereby effectively ensuring the user's query experience and promoting the user's work efficiency.
[0032] Reference Figure 1 , shows a flowchart of a data query processing method provided in an embodiment of the present invention, which is applied to a query system, wherein the query system at least includes a query display module, a query errata module connected to the query display module, a query construction module connected to the query errata module, and a result output module connected to the query construction module, and specifically may include the following steps:
[0033] Step 101, obtaining the query content input by the user through the query display module, and if there is related content corresponding to the query content, displaying the related content;
[0034] Reference Figure 2 , showing a schematic diagram of the structure of the query system provided in an embodiment of the present invention, the query system can at least include a configuration module, a query display module connected to the configuration module, a query errata module connected to the query display module, a query construction module connected to the query errata module, and a result output module connected to the query construction module. Among them, the configuration module can be used to configure the capabilities and configuration of the query system; the query display module can be used to respond to the user's query operation and provide corresponding prompts according to the user's query operation; the query errata module can be used to errata the query conditions determined by the user, so as to detect whether there are corresponding problems with the query conditions determined by the user, and when the corresponding problems are detected, the corresponding prompt information is output through the query display module; the query construction module can be used to construct the corresponding query statement, and query the corresponding data in the corresponding database based on the query statement; the result output module is used to display the target data queried by the query construction module, so that the query display module can greatly reduce the user's knowledge reserve, realize the mutual compatibility of multi-atomic capability fields, and at the same time, it can accurately prompt errors in real time to reduce the efficiency waste caused by erroneous input. At the same time, the related information displayed by the query display module can effectively improve the user's query experience, promote work efficiency, and in terms of convenience of use, the display content through natural language can be optimized to greatly reduce the usage threshold, so that users can quickly understand the true meaning of the query.
[0035] In an embodiment of the present invention, for the configuration module of the query system, it can read the first configuration data of the configuration file, read the second configuration data of the database, and read the third configuration data of the interface, and construct fields according to the first configuration data, the second configuration data and the third configuration data, obtain the general log field for the query system, and then map different general log fields to a unified adaptation field. During the mapping process, if there is no adaptation field corresponding to the general log field, the corresponding adaptation field can be added, and then the adaptation field is globally associated in the query system, and the adaptation field is detected. If a modification action on the adaptation field is detected, a prompt message for the adaptation field is output, and the database action is obtained and configured in the query system.
[0036] In a specific implementation, corresponding sub-units may be constructed for the configuration module. The configuration module may include a configuration data reading sub-unit, a field construction sub-unit, a field mapping sub-unit, a global association sub-unit, a field detection sub-unit, a database action sub-unit, an integrated configuration manager, etc. The data configuration of the query system may be realized through the mutual cooperation between the sub-units.
[0037] The configuration data reading subunit can be used to read corresponding configuration data from different sources, for example, a configuration file can be read: first configuration data can be read from a specified configuration file. The configuration file can be in a format such as JSON, YAML (YAML Ain't Markup Language, a human-readable data serialization format); read a database: read second configuration data from a specified database table through a database connection; read an interface: read third configuration data from a specified API (Application Programming Interface) interface through an HTTP request, etc.
[0038] For the field construction subunit, it can construct a general log field according to the read configuration data. Specifically, the field construction subunit can merge the configuration data from the configuration file, database and interface into a unified data structure, and then construct the general log field according to the merged configuration data. Each field corresponds to a configuration item and contains its value.
[0039] The field mapping subunit can map the general log field to the adaptation field and add a new adaptation field when necessary. Specifically, the field mapping unit can map the general log field to the adaptation field. If the general log field already exists in the adaptation field, there is no need to add it; otherwise, add the corresponding adaptation field, and during the mapping process, if it is found that there is no adaptation field corresponding to the general log field, then add the adaptation field.
[0040] For the global association subunit, it can globally associate the adaptation fields in the query system, ensure that all modules and components can access these fields by globally associating the adaptation fields in the query system, and store the adaptation fields in global variables or databases for sharing in the system.
[0041] The field detection subunit can detect the modification action of the adaptation field and output a prompt message. Specifically, the field detection subunit can detect the modification action of the adaptation field regularly or in real time. If a modification is detected, a corresponding prompt message is output so as to notify relevant personnel of the modification of the adaptation field through the prompt message.
[0042] For the database action subunit, it can obtain database actions and configure them in the query system. Specifically, the database action subunit can obtain predefined database actions from the database, such as insert, update, delete, etc., and configure the obtained database actions in the query system to ensure that the system can execute these actions.
[0043] For the integrated configuration manager, it can integrate the above sub-units to form a complete configuration management process. Specifically, it initializes the configuration data reading sub-unit, field construction sub-unit, field mapping sub-unit, global association sub-unit, field detection sub-unit and database action sub-unit, and runs each sub-unit in the following order: read configuration data, build common log fields, map to adaptation fields, perform global association, detect field modification actions, and obtain and configure database actions.
[0044] After the configuration of the query system is initialized through the configuration module, the user can query the corresponding data through the query system. The query system can provide a corresponding query interface, and the user can enter the corresponding query operation in the query interface to query the data. In the specific implementation, after the user enters the corresponding query operation in the query interface, the query display module can obtain the query content corresponding to the query operation entered by the user, and detect the query content. If there is related content corresponding to the query content, the related content is displayed, thereby assisting the user in searching by displaying the related content in real time, reducing the requirements for the user's usage knowledge reserve, and lowering the query threshold.
[0045] In some feasible implementations, the query display module can first determine the query action and / or keyword corresponding to the query content, and then input the query action and / or keyword into a preset sorting model for query; if there is an alternative action associated with the query action, the corresponding target alternative action is determined; if there is a prompt word associated with the keyword, the corresponding target prompt word is determined, and then the first priority of the target alternative action and the second priority corresponding to the target prompt word are obtained, and the target alternative action is sorted according to the first priority and displayed, or the target prompt word is sorted according to the second priority and displayed, or the target alternative action and the target prompt word are sorted according to the first priority and displayed.
[0046] In a specific implementation, the query display module may first parse the query content input by the user, then use natural language processing (NLP) technology or regular expressions to parse the query content, extract query actions and / or keywords, and then search for alternative actions associated with the query action; search for prompt words associated with the query action according to the keywords, and if the corresponding target alternative actions and target prompt words are queried, the first priority of the target alternative actions and the second priority of the target prompt words may be determined according to a preset priority rule, and then the target alternative actions and target prompt words may be sorted according to the priorities and displayed. For example, if only the corresponding target alternative actions are queried, the target alternative actions may be sorted according to the first priority; if only the target prompt words are queried, the target prompt words may be sorted according to the second priority; if both are queried, the target alternative actions and target prompt words may be comprehensively sorted according to the first priority and the second priority, and then displayed to the user based on the sorted results, thereby assisting the user in searching by displaying the related content in real time, reducing the requirements for the user's usage knowledge reserve, and lowering the query threshold.
[0047] In one example, suppose the query content entered by the user is: "Find abnormal login events that occurred in the last 24 hours, focusing on events from IP address 192.168.1.1." The query display system is initialized to prepare for processing the query content entered by the user, and the query display module of the XDR system is started, and the necessary resources and configurations are loaded to prepare for receiving the query content entered by the user. Specifically, the operation process includes:
[0048] 1. Parsing query content
[0049] Function: Parse the query content entered by the user and determine the query action and / or keywords.
[0050] Input: The query entered by the user is "Search for abnormal login events that occurred in the last 24 hours, focusing on events from the IP address 192.168.1.1."
[0051] Processing: Use natural language processing (NLP) technology to parse the query content and extract query actions and / or keywords.
[0052] Query action: Find
[0053] Keywords: within the last 24 hours, abnormal login events, IP address 192.168.1.1
[0054] Output: Query action "search", keywords "within the last 24 hours", "abnormal login events" and "IP address 192.168.1.1".
[0055] 2. Determine the alternative actions and prompt words
[0056] Function: Determine the corresponding alternative actions and prompt words based on the query action and / or keyword.
[0057] Input: Query action "Search", keywords "within the last 24 hours", "abnormal login events", and "IP address 192.168.1.1".
[0058] deal with:
[0059] Alternative actions: Based on the query action "Find", find the associated alternative actions, such as "Filter", "Aggregate", "Sort", etc.
[0060] Prompt words: Based on the keywords "within the last 24 hours", "abnormal login events" and "IP address 192.168.1.1", search for related prompt words, such as "time range", "event type", "IP address", etc.
[0061] Output: target alternative actions "filter" and "sort", target prompt words "time range", "event type" and "IP address".
[0062] 3. Prioritize
[0063] Function: Determine the first priority of target alternative actions and the second priority of target prompt words.
[0064] Input: target alternative actions "filter" and "sort", target prompt words "time range", "event type" and "IP address".
[0065] deal with:
[0066] First priority: Determine the priority of the target alternative actions according to the preset priority rules. For example, the "filter" action has a higher priority than the "sort" action.
[0067] Second priority: Determine the priority of the target prompt word according to the preset priority rules. For example, "time range" has a higher priority than "event type" and "IP address".
[0068] Output: First priority "Filter", second priority "Time Range".
[0069] 4. Sorting and display
[0070] Function: Sort target alternative actions and target prompt words according to priority and display them.
[0071] Input: First priority "Filter", second priority "Time range".
[0072] deal with:
[0073] Sort target alternative actions: Sort target alternative actions by first priority, and the result is "filter" and "sort".
[0074] Sorting target prompt words: Sort the target prompt words according to the second priority, and the results are "time range", "event type", and "IP address".
[0075] Comprehensive sorting: According to the first priority and the second priority, the target alternative actions and target prompt words are comprehensively sorted, and the results are "Filter (time range)", "Filter (event type)", "Filter (IP address)", "Sort (time range)", "Sort (event type)", "Sort (IP address)".
[0076] Output: sorted target alternative actions and target prompt words, and display them to the user.
[0077] Display results
[0078] Function: Display the sorted results to the user.
[0079] Operation: The comprehensive sorting results of "Filter (time range)", "Filter (event type)", "Filter (IP address)", "Sort (time range)", "Sort (event type)", and "Sort (IP address)" are displayed to the user, and the user can perform further query and analysis based on these results.
[0080] It should be noted that, for the sorting model, the database type or query type used by the query system can be obtained, and the action configuration data corresponding to the query system can be determined according to the database type or query type, and then the query conditions and the following prompt words for the action configuration data can be obtained, and the action configuration data can be optimized by natural language according to the query conditions and the following prompt words, and the optimized expression information can be displayed, and then the initial sorting model and training data for the query system can be obtained, and then the initial sorting model can be iterated using the expression information and the training data, and the sorting model corresponding to the query system can be obtained based on the iterative results.
[0081] In one example, for the training process of the sorting model, the database type or query type used by the query system can be identified first, and the currently used database type (such as MySQL, PostgreSQL, Elasticsearch, etc.) or query type (such as simple query, complex query, associated query, etc.) can be determined through the configuration information of the query system or user input. Then, according to the identified database type or query type, the predefined action configuration data is searched. The action configuration data may include query actions, filtering conditions, sorting rules, etc. Then, the query conditions and the following prompt words are extracted from the action configuration data. The query conditions may include time range, event type, IP address, etc.; the following prompt words may include "recent", "abnormal", "focus", etc., and the query conditions and the following prompt words are combined to generate natural language expression information. For example, "time range: within the last 24 hours" and "event type: abnormal login event" are combined into "find abnormal login events that occurred within the last 24 hours". Then, the initial sorting model and training data for the query system can be obtained, and the initial sorting model can be obtained from the predefined model library, and the training data can be obtained from the historical query records or user feedback. Among them, the training data may include query content, query results, user feedback, etc. After completing the basic work of model training through the above process, you can start model training, including: data preprocessing: preprocess the representation information and training data and convert them into a format acceptable to the model; model training: use the preprocessed data to train the initial sorting model. Machine learning algorithms (such as decision trees, random forests, neural networks, etc.) can be used for training; model evaluation: evaluate the trained model and calculate the model's accuracy, recall and other indicators; model iteration: adjust and optimize the model based on the evaluation results, repeat the training and evaluation process until the model performance reaches the expected level, and finally save the final optimized sorting model and apply it in the query system. Optionally, the sorting model can automatically adjust the sorting order of the query results based on the query content and user needs to improve query efficiency and user experience.
[0082] Step 102, generating a query condition corresponding to the query content and / or the associated content by the query display module in response to a confirmation operation on the query content and / or the associated content;
[0083] In a specific implementation, the query system may generate query conditions corresponding to the query content and / or related content in response to a confirmation operation on the query content and / or related content through a query display module, so as to perform data query based on the corresponding query conditions.
[0084] In one example, the query display module can use natural language processing (NLP) technology or regular expressions to parse the user input content based on the query content and / or related content input by the user, extract key information, and convert the parsed key information into query conditions, and then display the generated query conditions to the user and wait for user confirmation. The user can confirm the query conditions by clicking a "Confirm" button or other confirmation operations, and then perform data queries based on the confirmed query conditions.
[0085] For example, a user enters the query content through the query system interface: "Find abnormal login events that occurred in the last 24 hours, focusing on events from IP address 192.168.1.1." The query display module can parse the content entered by the user and extract key information: time range: within the last 24 hours; event type: abnormal login event; IP address: 192.168.1.1, etc., and then display the extracted key information to the user. After the user confirms, the corresponding query conditions can be generated, as shown below, so that data retrieval can be performed based on the generated query conditions, etc.:
[0086] Time range condition: timestamp>=NOW()-INTERVAL 24HOUR
[0087] Event type condition: event_type = 'abnormal login event'
[0088] IP address condition: ip_address = '192.168.1.1'.
[0089] Step 103, the query condition is tested by the query correction module, and if there is no abnormality in the query condition, the query condition is transmitted to the query construction module;
[0090] After the query display module completes the confirmation of the query conditions, the query conditions can be transmitted to the query errata module so that the query system can detect the query conditions through the query errata module. If there are no abnormal problems with the query conditions, the query conditions will be transmitted to the query construction module. By correcting the query conditions determined by the user, errors can be accurately prompted in real time, reducing efficiency waste caused by incorrect input and ensuring user retrieval efficiency.
[0091] In some feasible implementations, the query errata module can pre-compile the query conditions, obtain the corresponding compiled statements, and determine whether the compiled statements have semantic problems or grammatical problems. If the compiled statements have semantic problems, the first problem point where the semantic problem occurs is located in the compiled statements, and a semantic error prompt message for the first problem point is output; if the compiled statements have grammatical problems, the second problem point where the grammatical problem occurs is located in the compiled statements, and a grammatical error prompt message for the second problem point is output; if the compiled statements have both semantic problems and grammatical problems, the third problem point where the semantic problem occurs is located in the compiled statements, and the fourth problem point where the grammatical problem occurs is located, and a semantic error prompt message for the third problem point is output, and a grammatical error prompt message for the fourth problem point is output.
[0092] In a specific implementation, when judging whether a compiled statement has a semantic problem or a grammatical problem, the query errata module can detect the compiled statement according to the corresponding grammatical detection conditions or semantic detection conditions. If the compiled statement has at least one of spelling errors, key sub-sequence errors, bracket matching errors, quotation mark usage errors, and semicolon usage errors, then it is confirmed that the compiled statement has a grammatical error; if the compiled statement does not have one of spelling errors, key sub-sequence errors, bracket matching errors, quotation mark usage errors, and semicolon usage errors, then it is confirmed that the compiled statement does not have a grammatical error; if the compiled statement has at least one of list reference non-existence, data type mismatch, logic error, function usage error, operator usage error, and permission error, then it is confirmed that the compiled statement has a semantic error; if the compiled statement does not have one of list reference non-existence, data type mismatch, logic error, function usage error, operator usage error, and permission error, then it is confirmed that the compiled statement does not have a semantic error, so that by correcting the query conditions determined by the user, it is possible to accurately prompt errors in real time, reduce efficiency waste caused by incorrect input, and ensure user retrieval efficiency.
[0093] Step 104, constructing a query statement corresponding to the query condition through the query construction module, and if target data corresponding to the query statement is found, transmitting the target data to the result output module;
[0094] After determining that the query statement does not have corresponding grammatical problems and / or semantic problems, the query errata module can transmit the query conditions to the query construction module so that the query system constructs a query statement corresponding to the query conditions through the query construction module. If the target data corresponding to the query statement is queried, the target data is transmitted to the result output module.
[0095] In a specific implementation, the query construction module can determine the query type corresponding to the query condition, determine the database language corresponding to the query type, and then convert the query condition into a query statement corresponding to the database language. Specifically, the query construction module can use natural language processing (NLP) technology or regular expressions to parse the query condition and extract keywords and conditions. According to the extracted keywords and conditions, the query type is determined. For example, if the query condition contains logical operators such as "AND" and "OR", it can be determined as a complex query; if it only contains one condition, it can be determined as a simple query. Then, the query construction module can select a suitable database language according to the query type, and establish a mapping relationship between the query type and the database language. For example, a simple query can use SQL, and a complex query can use Elasticsearch's query DSL, so as to select the corresponding database language according to the query type. Then, the query construction module parses the query condition into an internal data structure (such as a JSON object), and according to the grammatical rules of the selected database language, converts the parsed condition into a corresponding query statement, and then splices the converted condition into a complete database query statement, so as to query based on the query statement.
[0096] In one example, assuming that the query condition is: "Find all log records with an IP address of 192.168.1.1 and a time between 2023-10-01 and 2023-10-31", the query statement construction process may include:
[0097] 1. Determine the query type corresponding to the query condition
[0098] Parse the query conditions and extract keywords and conditions:
[0099] IP address: 192.168.1.1
[0100] Time range: 2023-10-01 to 2023-10-31
[0101] Based on the extracted keywords and conditions, it is determined that the query type is a complex query (including multiple conditions).
[0102] 2. Determine the database language that corresponds to the query type
[0103] Depending on the query type, choose the appropriate database language. Let's assume that we choose Elasticsearch's query DSL.
[0104] 3. Convert the query conditions into query statements corresponding to the database language
[0105] Convert the query conditions into Elasticsearch query DSL statements:
[0106] ① Condition parsing: parse the query conditions into JSON objects; ② Condition conversion: convert the parsed conditions into query statements according to the Elasticsearch query DSL syntax rules; ③ Generate query statements: splice the converted conditions into a complete Elasticsearch query DSL statement.
[0107] By integrating the above steps, a flexible and efficient query construction module can be implemented, which can determine the query type corresponding to the query conditions, select the appropriate database language, and convert the query conditions into query statements corresponding to the database language, thereby improving the flexibility and efficiency of the query system and ensuring that the system can adapt to different query requirements and changes.
[0108] Step 105: display the target data through the result output module.
[0109] When the query construction module performs data query based on the constructed query statement and finds the corresponding target data, the target data can be transmitted to the result output module so that the target data can be displayed through the result output module, thereby constructing a query statement corresponding to the query condition through the query construction module. If the target data corresponding to the query statement is found, the target data is transmitted to the result output module and displayed through the result output module, thereby effectively ensuring the user's query experience and promoting the user's work efficiency.
[0110] It should be noted that the embodiments of the present invention include but are not limited to the above examples. It is understandable that those skilled in the art can also make settings according to actual needs under the guidance of the ideas of the embodiments of the present invention, and the present invention is not limited to this.
[0111] In an embodiment of the present invention, the query system may include a query display module, a query errata module connected to the query display module, a query construction module connected to the query errata module, and a result output module connected to the query construction module. When a user inputs a corresponding query operation on the query system, the system may obtain the query content input by the user through the query display module. If there is related content corresponding to the query content, the related content is displayed. By displaying the related content in real time, the user is assisted in searching, the requirement for the user's knowledge reserve is reduced, and the query threshold is lowered. At the same time, the query display module may respond to the confirmation operation on the query content and / or related content to generate The query conditions corresponding to the query content and / or related content are formed, and the query conditions are checked through the query correction module. If there is no abnormality in the query conditions, the query conditions are transmitted to the query construction module. By correcting the query conditions determined by the user, it is possible to accurately prompt errors in real time, reduce the efficiency waste caused by incorrect input, and ensure the user's retrieval efficiency. The query construction module constructs a query statement corresponding to the query conditions. If the target data corresponding to the query statement is queried, the target data is transmitted to the result output module, and the target data is displayed through the result output module, thereby effectively ensuring the user's query experience and promoting the user's work efficiency.
[0112] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the following examples are used for exemplary description:
[0113] Reference Figure 3 , showing a functional schematic diagram of a configuration module provided in an embodiment of the present invention, the configuration module can be used to predefine general log fields, multi-atomic capability adaptation fields, and action list configurations, etc. Among them, for predefined general log fields, the configuration module can use configuration data read from configuration files, use database configuration information read, use interface reading to obtain configuration information, etc.; for multi-atomic capability adaptation fields, the configuration module can map different fields to existing unified adaptation fields, add new fields for non-existent fields, and use them as unified adaptation fields in the future, and then make a global association for the unified adaptation field mapping, and remind any action that modifies its definition; for action list configuration, the configuration module can sort out and configure common database actions (such as " a nd" operator, displayed as "and", etc.), and configure the parameters after a specific action (for example, the "and" operator cannot be directly followed by the " an d" operator, etc.)
[0114] Reference Figure 4, shows a functional schematic diagram of the query display module provided in an embodiment of the present invention. For the query display module, it can be used to confirm the action candidate list, prompt word optimization, sorting model optimization display and sorting model iteration, etc., to respond to the query operation input by the user and display the corresponding prompt content, etc. Among them, for confirming the action candidate list, the query display module can confirm the action configuration data according to the database type or query type used; for prompt word optimization, the configuration query unit can perform natural language optimization display expression according to the query conditions and possible subsequent prompt words (such as "field A ASC sorting", displayed as optimizing the display expression in the ascending order of field A), and the display expression is processed by configuring or accessing the language optimization model; for sorting model iteration, the sorting model can be iterated according to the configuration data, capability status, query user usage habits, field call evaluation rate, historical selection records and other data; for sorting model optimization display, the query configuration module can display the optimized possible prompt words in order according to the sorting model, so as to prompt the user with the corresponding related content through the prompt words.
[0115] Reference Figure 5 , showing a functional schematic diagram of the query errata module provided in an embodiment of the present invention, the query errata module can be used for query grammar and semantic precompilation, location problem, and analysis and display of possible errors. Among them, for query grammar and semantic precompilation, the query errata module can precompile through query statements to confirm whether there are grammar and semantic problems; for location problems, the query errata module can confirm grammar error problem points according to grammar errors, and confirm semantic error problem points according to semantic errors; for analysis and display of possible errors, the query errata module can confirm grammar error points according to configuration, and return possible error information, error location position and possible solutions, etc., and confirm semantic error points according to configuration, and return possible error information, error location position and possible solutions, etc. By correcting the query conditions determined by the user, it is possible to accurately prompt errors in real time, reduce efficiency waste caused by incorrect input, and ensure user retrieval efficiency.
[0116] Reference Figure 6 , shows a functional schematic diagram of a query construction module provided in an embodiment of the present invention. The query construction module can be used to confirm the query type and generate a corresponding query statement for query. The query construction module can call information to confirm the query type and determine the database language to be converted, and then construct a corresponding database query statement according to the statement information, and then perform data query based on the database query statement, and transmit the queried target data to the result display unit, which displays the target data.
[0117] Through the above process, data query with multiple and complex conditions is realized. The query display module can greatly reduce the user's knowledge reserve, realize the mutual compatibility of multiple atomic capability fields, and can accurately prompt errors in real time to reduce the efficiency waste caused by incorrect input. At the same time, the prompt word sorting constructed by the model can effectively improve the user's query experience and promote work efficiency. In terms of ease of use, the optimization of prompt words in natural language greatly reduces the usage threshold, allowing users to quickly understand the true meaning of the query.
[0118] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present invention are not limited by the order of the actions described, because according to the embodiments of the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
[0119] A structural block diagram of a processing system is also provided in an embodiment of the present invention, wherein the query system at least comprises a query display module, a query correction module connected to the query display module, a query construction module connected to the query correction module, and a result output module connected to the query construction module; wherein:
[0120] The query display module is used to obtain the query content input by the user, and if there is related content corresponding to the query content, display the related content;
[0121] The query display module is used to generate a query condition corresponding to the query content and / or the associated content in response to a confirmation operation on the query content and / or the associated content;
[0122] The query correction module is used to detect the query condition, and if there is no abnormality in the query condition, transmit the query condition to the query construction module;
[0123] The query construction module is used to construct a query statement corresponding to the query condition, and if target data corresponding to the query statement is found, the target data is transmitted to the result output module;
[0124] The result output module is used to display the target data.
[0125] In some feasible implementations, the query display module is specifically used to:
[0126] Determining a query action and / or a keyword corresponding to the query content;
[0127] Inputting the query action and / or the keyword into a preset sorting model for querying;
[0128] If there is an alternative action associated with the query action, determining a corresponding target alternative action;
[0129] If there is a prompt word associated with the keyword, determining a corresponding target prompt word;
[0130] Obtain the first priority of the target alternative actions and the second priority corresponding to the target prompt word, and sort the target alternative actions according to the first priority and display them, or sort the target prompt words according to the second priority and display them, or sort the target alternative actions and the target prompt words according to the first priority and the second priority and display them.
[0131] In some possible implementations, the ranking model is generated by a training module:
[0132] Obtaining the database type or query type used by the query system;
[0133] Determine action configuration data corresponding to the query system according to the database type or query type;
[0134] Obtaining a usage query condition for the action configuration data and a subsequent prompt word;
[0135] Performing natural language optimization on the action configuration data according to the usage query condition and the subsequent prompt word, and displaying the optimized expression information;
[0136] Obtaining an initial ranking model and training data for the query system;
[0137] The initial ranking model is iterated using the expression information and the training data, and a ranking model corresponding to the query system is obtained based on an iteration result.
[0138] In some feasible implementations, the query error module is specifically used to:
[0139] Precompiling the query condition to obtain a corresponding compilation statement;
[0140] Determine whether the compiled statement has semantic or grammatical problems;
[0141] If there is a semantic problem in the compiled statement, locating a first problem point where the semantic problem occurs in the compiled statement, and outputting a semantic error prompt message for the first problem point;
[0142] If there is a grammatical problem in the compiled statement, locating a second problem point where the grammatical problem occurs in the compiled statement, and outputting a grammatical error prompt message for the second problem point;
[0143] If the compiled statement has both a semantic problem and a grammatical problem, a third problem point where the semantic problem occurs is located in the compiled statement, a fourth problem point where the grammatical problem occurs is located, and a semantic error prompt message for the third problem point and a grammatical error prompt message for the fourth problem point are output.
[0144] In some feasible implementations, the query error module is specifically used to:
[0145] If the compiled statement has at least one of a spelling error, a key sub-sequence error, a bracket matching error, a quotation mark usage error, and a semicolon usage error, then it is determined that the compiled statement has a syntax error;
[0146] If the compiled statement does not have any of the following: spelling errors, key sub-sequence errors, bracket matching errors, quotation mark usage errors, and semicolon usage errors, then confirm that the compiled statement does not have any syntax errors;
[0147] If the compiled statement has at least one of the following: list reference not existing, data type mismatch, logic error, function usage error, operator usage error, and permission error, then it is confirmed that the compiled statement has a semantic error;
[0148] If the compiled statement does not contain any of the following: list reference does not exist, data type does not match, logic error, function usage error, operator usage error, and permission error, then it is confirmed that the compiled statement does not have any semantic error.
[0149] In some feasible implementations, the query construction module is specifically used to:
[0150] Determining a query type corresponding to the query condition;
[0151] Determining a database language corresponding to the query type;
[0152] The query condition is converted into a query statement corresponding to the database language.
[0153] In some feasible implementations, the query system further includes a configuration module connected to the query display module; wherein the configuration module is used to:
[0154] Reading first configuration data from a configuration file, reading second configuration data from a database, and reading third configuration data from an interface;
[0155] Perform field construction according to the first configuration data, the second configuration data, and the third configuration data to obtain a common log field for the query system;
[0156] Mapping different common log fields into a unified adaptation field;
[0157] If there is no adaptation field corresponding to the general log field, then add a corresponding adaptation field;
[0158] Globally associating the adaptation field in the query system, and detecting the adaptation field, and if a modification action on the adaptation field is detected, outputting a prompt message for the adaptation field;
[0159] A database action is obtained, and the database action is configured in the query system.
[0160] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0161] In addition, an embodiment of the present invention further provides an electronic device, including: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned data query processing method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0162] The embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above-mentioned data query processing method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0163] Figure 7 A schematic diagram of the hardware structure of an electronic device for implementing various embodiments of the present invention.
[0164] The electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709, a processor 710, and a power supply 711. Those skilled in the art will appreciate that the electronic device structure involved in the embodiments of the present invention does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently. In the embodiments of the present invention, the electronic device includes but is not limited to a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted terminal, a wearable device, and a pedometer.
[0165] It should be understood that in the embodiment of the present invention, the radio frequency unit 701 can be used for receiving and sending signals during information transmission or communication. Specifically, after receiving downlink data from the base station, it is sent to the processor 710 for processing; in addition, uplink data is sent to the base station. Generally, the radio frequency unit 701 includes but is not limited to an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, etc. In addition, the radio frequency unit 701 can also communicate with the network and other devices through a wireless communication system.
[0166] The electronic device provides users with wireless broadband Internet access through the network module 702, such as helping users to send and receive emails, browse web pages, and access streaming media.
[0167] The audio output unit 703 can convert the audio data received by the RF unit 701 or the network module 702 or stored in the memory 709 into an audio signal and output it as sound. Moreover, the audio output unit 703 can also provide audio output related to a specific function performed by the electronic device 700 (for example, a call signal reception sound, a message reception sound, etc.). The audio output unit 703 includes a speaker, a buzzer, a receiver, etc.
[0168] The input unit 704 is used to receive audio or video signals. The input unit 704 may include a graphics processor (GPU) 7041 and a microphone 7042, and the graphics processor 7041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The processed image frame can be displayed on the display unit 706. The image frame processed by the graphics processor 7041 can be stored in the memory 709 (or other storage medium) or sent via the radio frequency unit 701 or the network module 702. The microphone 7042 can receive sound and can process such sound into audio data. The processed audio data can be converted into a format output that can be sent to a mobile communication base station via the radio frequency unit 701 in the case of a telephone call mode.
[0169] The electronic device 700 also includes at least one sensor 705, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor and a proximity sensor, wherein the ambient light sensor can adjust the brightness of the display panel 7061 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 7061 and / or the backlight when the electronic device 700 is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, which can be used to identify the posture of the electronic device (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; the sensor 705 can also include a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, etc., which will not be repeated here.
[0170] The display unit 706 is used to display information input by the user or information provided to the user. The display unit 706 may include a display panel 7061, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0171] The user input unit 707 can be used to receive input digital or character information, and to generate key signal input related to user settings and function control of the electronic device. Specifically, the user input unit 707 includes a touch panel 7071 and other input devices 7072. The touch panel 7071, also known as a touch screen, can collect the user's touch operation on or near it (such as the user's operation on the touch panel 7071 or near the touch panel 7071 using any suitable object or accessory such as a finger, stylus, etc.). The touch panel 7071 may include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the contact point coordinates, and then sends it to the processor 710, receives the command sent by the processor 710 and executes it. In addition, the touch panel 7071 can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch panel 7071, the user input unit 707 may also include other input devices 7072. Specifically, other input devices 7072 may include but are not limited to a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail here.
[0172] Further, the touch panel 7071 may be covered on the display panel 7061. When the touch panel 7071 detects a touch operation on or near it, it is transmitted to the processor 710 to determine the type of the touch event, and then the processor 710 provides a corresponding visual output on the display panel 7061 according to the type of the touch event. It can be understood that in one embodiment, the touch panel 7071 and the display panel 7061 are used as two independent components to implement the input and output functions of the electronic device, but in some embodiments, the touch panel 7071 and the display panel 7061 can be integrated to implement the input and output functions of the electronic device, which is not limited here.
[0173] The interface unit 708 is an interface for connecting an external device to the electronic device 700. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device with an identification module, an audio input / output (I / O) port, a video I / O port, a headphone port, etc. The interface unit 708 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the electronic device 700 or may be used to transmit data between the electronic device 700 and an external device.
[0174] The memory 709 can be used to store software programs and various data. The memory 709 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 709 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0175] The processor 710 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It executes various functions of the electronic device and processes data by running or executing software programs and / or modules stored in the memory 709, and calling data stored in the memory 709, so as to monitor the electronic device as a whole. The processor 710 may include one or more processing units; preferably, the processor 710 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 710.
[0176] The electronic device 700 may also include a power supply 711 (such as a battery) for supplying power to each component. Preferably, the power supply 711 may be logically connected to the processor 710 through a power management system, thereby implementing functions such as charging, discharging, and power consumption management through the power management system.
[0177] In addition, the electronic device 700 includes some functional modules not shown, which will not be described in detail here.
[0178] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0179] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0180] The embodiments of the present invention are described above in conjunction with the accompanying drawings, but the present invention is not limited to the above-mentioned specific implementation modes, which are merely illustrative rather than restrictive. Under the guidance of the present invention, ordinary technicians in this field can also make many forms without departing from the scope of protection of the present invention and the claims, all of which are within the protection of the present invention.
[0181] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of the present invention can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0182] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0183] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0184] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0185] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0186] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.
[0187] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A data query processing method, characterized in that: Applied to a query system, the query system at least comprises a query display module, a query errata module connected to the query display module, a query construction module connected to the query errata module, and a result output module connected to the query construction module, the method comprises: The query display module obtains the query content input by the user, and if there is related content corresponding to the query content, displays the related content; generating, by the query display module, a query condition corresponding to the query content and / or the associated content in response to a confirmation operation on the query content and / or the associated content; The query condition is detected by the query correction module, and if there is no abnormality in the query condition, the query condition is transmitted to the query construction module; Constructing a query statement corresponding to the query condition through the query construction module, and if target data corresponding to the query statement is found, transmitting the target data to the result output module; The target data is displayed through the result output module.
2. The method according to claim 1, characterized in that If there is related content corresponding to the query content, displaying the related content includes: Determining a query action and / or a keyword corresponding to the query content; Inputting the query action and / or the keyword into a preset sorting model for querying; If there is an alternative action associated with the query action, determining a corresponding target alternative action; If there is a prompt word associated with the keyword, determining a corresponding target prompt word; Obtain the first priority of the target alternative actions and the second priority corresponding to the target prompt word, and sort the target alternative actions according to the first priority and display them, or sort the target prompt words according to the second priority and display them, or sort the target alternative actions and the target prompt words according to the first priority and the second priority and display them.
3. The method according to claim 2, characterized in that The ranking model is generated as follows: Obtaining the database type or query type used by the query system; Determine action configuration data corresponding to the query system according to the database type or query type; Obtaining a usage query condition for the action configuration data and a subsequent prompt word; Performing natural language optimization on the action configuration data according to the usage query condition and the subsequent prompt word, and displaying the optimized expression information; Obtaining an initial ranking model and training data for the query system; The initial ranking model is iterated using the expression information and the training data, and a ranking model corresponding to the query system is obtained based on an iteration result.
4. The method according to claim 1, characterized in that: The checking of the query condition and transmitting the query condition to the query building module if there is no abnormality in the query condition includes: Precompiling the query condition to obtain a corresponding compilation statement; Determine whether the compiled statement has semantic or grammatical problems; If there is a semantic problem in the compiled statement, locating a first problem point where the semantic problem occurs in the compiled statement, and outputting a semantic error prompt message for the first problem point; If there is a grammatical problem in the compiled statement, locating a second problem point where the grammatical problem occurs in the compiled statement, and outputting a grammatical error prompt message for the second problem point; If the compiled statement has both a semantic problem and a grammatical problem, a third problem point where the semantic problem occurs is located in the compiled statement, a fourth problem point where the grammatical problem occurs is located, and a semantic error prompt message for the third problem point and a grammatical error prompt message for the fourth problem point are output.
5. The method according to claim 4, characterized in that The determining whether the compiled statement has a semantic problem or a grammatical problem includes: If the compiled statement has at least one of a spelling error, a key sub-sequence error, a bracket matching error, a quotation mark usage error, and a semicolon usage error, then it is determined that the compiled statement has a syntax error; If the compiled statement does not have any of the following: spelling errors, key sub-sequence errors, bracket matching errors, quotation mark usage errors, and semicolon usage errors, then confirm that the compiled statement does not have any syntax errors; If the compiled statement has at least one of the following: list reference not existing, data type mismatch, logic error, function usage error, operator usage error, and permission error, then it is confirmed that the compiled statement has a semantic error; If the compiled statement does not contain any of the following: list reference does not exist, data type does not match, logic error, function usage error, operator usage error, and permission error, then it is confirmed that the compiled statement does not have any semantic error.
6. The method according to claim 1, characterized in that The constructing a query statement corresponding to the query condition includes: Determining a query type corresponding to the query condition; Determining a database language corresponding to the query type; The query condition is converted into a query statement corresponding to the database language.
7. The method according to any one of claims 1 to 6, characterized in that: The query system further includes a configuration module connected to the query display module, and the method further includes: Reading first configuration data of a configuration file, reading second configuration data of a database, and reading third configuration data of an interface through the configuration module; The configuration module constructs fields according to the first configuration data, the second configuration data and the third configuration data to obtain a general log field for the query system; Mapping different common log fields into unified adaptation fields through the configuration module; If there is no adaptation field corresponding to the general log field, adding a corresponding adaptation field through the configuration module; The adaptation field is globally associated in the query system through the configuration module, and the adaptation field is detected. If a modification action on the adaptation field is detected, a prompt message for the adaptation field is output; The database action is acquired through the configuration module, and the database action is configured in the query system.
8. A query system, characterized in that: The query system at least includes a query display module, a query correction module connected to the query display module, a query construction module connected to the query correction module, and a result output module connected to the query construction module; wherein, The query display module is used to obtain the query content input by the user, and if there is related content corresponding to the query content, display the related content; The query display module is used to generate a query condition corresponding to the query content and / or the associated content in response to a confirmation operation on the query content and / or the associated content; The query correction module is used to detect the query condition, and if there is no abnormality in the query condition, transmit the query condition to the query construction module; The query construction module is used to construct a query statement corresponding to the query condition, and if target data corresponding to the query statement is found, the target data is transmitted to the result output module; The result output module is used to display the target data.
9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is used to store computer programs; The processor is used to implement the method according to any one of claims 1 to 7 when executing the program stored in the memory.
10. A computer-readable storage medium having instructions stored thereon, which, when executed by one or more processors, cause the processors to perform the method according to any one of claims 1 to 7.