Data processing method and device, computer equipment, readable storage medium and program product
By identifying the query intent and rewriting the query text, combining the query rule set and display method, the data query accuracy and relevance problems of search engines in complex business scenarios are solved, and the user's information acquisition efficiency is improved.
Patent Information
- Application Number
- CN202510597632.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-08-08
AI Technical Summary
In the prior art, search engines are difficult to achieve the accuracy and relevance of data query in complex business scenarios, affecting the user's data acquisition efficiency.
By receiving data query requests, identifying query intent, rewriting query text, obtaining query rulesets, and using search engines to conduct data query, combining result display methods to improve query accuracy and relevance.
It realizes efficient and accurate data query in complex business scenarios, and improves user information acquisition efficiency.
Smart Images

Figure CN120448439A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information retrieval technology, and in particular to a data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art
[0002] With the development of information technology, the amount of business data that enterprises need to process has experienced explosive growth. To improve the efficiency of business data processing, search engines have gradually been used to query and retrieve business data. However, related technologies typically use search engines to directly retrieve business data based on user-entered query terms. In complex business scenarios, this can easily lead to inaccurate and inappropriate search results, hindering user data acquisition efficiency. Summary of the Invention
[0003] Based on this, it is necessary to provide a data processing method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical issues.
[0004] In a first aspect, the present application provides a data processing method, comprising:
[0005] Receive a data query request, and obtain a first query text and query request parameters of the data query request;
[0006] performing intent recognition on the data query request according to the first query text and the query request parameters to obtain the query intent of the data query request;
[0007] rewriting the first query text according to the query intent and the query request parameters to obtain a second query text;
[0008] Obtaining a query rule set corresponding to the query intent;
[0009] performing a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set to obtain a data query result corresponding to the data query request;
[0010] Display the data query results according to the result display method corresponding to the query request parameters.
[0011] In one embodiment, the first query text is rewritten according to the query intent and the query request parameters to obtain a second query text, including: performing data normalization processing on the first query text to obtain a processed first query text; performing semantic analysis on the processed first query text to obtain a semantic analysis result; performing word meaning expansion processing on the processed first query text according to the semantic analysis result to obtain an expanded first query text; obtaining a rewriting rule set according to the query intent and the query request parameters; and rewriting the expanded first query text using the rewriting rule set to obtain a second query text.
[0012] In one embodiment, the expanded first query text is rewritten using the rewriting rule set to obtain a second query text, including: taking the expanded first query text as the current text; determining the matching of each rewriting rule with the query intent and the query request parameters in turn according to the priority order of each rewriting rule in the rewriting rule set, and if there is a match, rewriting the current text according to the rewriting rule; when the rewriting termination condition is met, obtaining the second query text based on the rewritten current text.
[0013] In one embodiment, a data query operation is performed using a search engine based on the second query text, the query request parameters and the query rule set to obtain a data query result corresponding to the data query request, including: determining the matching of each query rule with the second query text and the query request parameters in turn according to the priority order of each query rule in the query rule set, and if there is a match, constructing a query action according to the query rule; when a construction termination condition is met, obtaining a query statement of the search engine based on the second query text and each query action; and using the search engine to perform a data query operation based on the query statement to obtain the data query result.
[0014] In one embodiment, the method further includes: obtaining rule configuration information in response to a query rule configuration operation; parsing the rule configuration information to obtain the query intent, matching conditions, query actions, and priority information corresponding to the rule configuration information; constructing a query rule containing the matching conditions and the query action, and adding the query rule to the query rule set corresponding to the query intent according to the priority information.
[0015] In one embodiment, the search engine is a distributed search engine based on an inverted index; the method further includes: obtaining business data; performing data cleaning and data standardization on the business data to obtain processed business data; creating an inverted index based on the processed business data; and the inverted index is used by the search engine to perform data query operations.
[0016] In a second aspect, the present application further provides a data processing device, comprising:
[0017] A request parsing module, configured to receive a data query request and obtain a first query text and query request parameters of the data query request;
[0018] an intent recognition module, configured to perform intent recognition on the data query request based on the first query text and the query request parameters to obtain the query intent of the data query request;
[0019] a text rewriting module, configured to rewrite the first query text according to the query intent and the query request parameters to obtain a second query text;
[0020] A rule acquisition module, configured to acquire a query rule set corresponding to the query intent;
[0021] a data query module, configured to perform a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set, and obtain a data query result corresponding to the data query request;
[0022] The result display module is used to display the data query result according to the result display method corresponding to the query request parameter.
[0023] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0024] Receive a data query request, and obtain a first query text and query request parameters of the data query request;
[0025] performing intent recognition on the data query request according to the first query text and the query request parameters to obtain the query intent of the data query request;
[0026] rewriting the first query text according to the query intent and the query request parameters to obtain a second query text;
[0027] Obtaining a query rule set corresponding to the query intent;
[0028] performing a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set to obtain a data query result corresponding to the data query request;
[0029] Display the data query results according to the result display method corresponding to the query request parameters.
[0030] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0031] Receive a data query request, and obtain a first query text and query request parameters of the data query request;
[0032] performing intent recognition on the data query request according to the first query text and the query request parameters to obtain the query intent of the data query request;
[0033] rewriting the first query text according to the query intent and the query request parameters to obtain a second query text;
[0034] Obtaining a query rule set corresponding to the query intent;
[0035] performing a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set to obtain a data query result corresponding to the data query request;
[0036] Display the data query results according to the result display method corresponding to the query request parameters.
[0037] In a fifth aspect, the present application further provides a computer program product, comprising a computer program, which, when executed by a processor, implements the following steps:
[0038] Receive a data query request, and obtain a first query text and query request parameters of the data query request;
[0039] performing intent recognition on the data query request according to the first query text and the query request parameters to obtain the query intent of the data query request;
[0040] rewriting the first query text according to the query intent and the query request parameters to obtain a second query text;
[0041] Obtaining a query rule set corresponding to the query intent;
[0042] performing a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set to obtain a data query result corresponding to the data query request;
[0043] Display the data query results according to the result display method corresponding to the query request parameters.
[0044] The above-mentioned data processing method, apparatus, computer equipment, computer-readable storage medium and computer program product first receive a data query request and obtain a first query text and query request parameters of the data query request, then perform intent recognition on the data query request based on the first query text and query request parameters to obtain the query intent of the data query request, then rewrite the first query text based on the query intent and query request parameters to obtain a second query text, and simultaneously obtain a query rule set corresponding to the query intent, then perform a data query operation using a search engine based on the second query text, query request parameters and query rule set to obtain a data query result corresponding to the data query request, and finally display the data query result according to the result display method corresponding to the query request parameters. This solution, after receiving a data query request, first identifies the intent of the data query request to obtain the query intent, and rewrites the first query text in combination with the query intent and query request parameters, thereby obtaining a second query text that can accurately reflect the user's data query needs; and by obtaining a query rule set corresponding to the query intent, it is possible to flexibly adapt to diverse business needs in different business scenarios and obtain query rules that are targeted at the current data query request; then, in combination with the query rule set, the second query text and the query request parameters, a search engine is used to perform data query, thereby achieving efficient and accurate query of the business data required by the user and obtaining data query results that are highly relevant to the user's data query request; finally, the data query results are displayed using the result display method corresponding to the query request parameters, thereby being able to display the data query results in a user-friendly manner, which is conducive to improving the user's information acquisition efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments of the present application or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying any creative work.
[0046] Figure 1 A diagram of an application environment of a data processing method in one embodiment;
[0047] Figure 21 is a flow chart of a data processing method in one embodiment;
[0048] Figure 3 FIG. 1 is a flow chart of obtaining a second query text in one embodiment;
[0049] Figure 4 A schematic diagram of a process for obtaining data query results in one embodiment;
[0050] Figure 5 is a schematic structural diagram of a data processing system in one embodiment;
[0051] Figure 6 is a structural block diagram of a data processing device in one embodiment;
[0052] Figure 7 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0054] The data processing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store data that server 104 needs to process. The data storage system can be integrated on server 104 or placed on the cloud or other network servers. The data storage system can be used to store query rule sets, business data, and other related data. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projectors, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. Head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. Server 104 can be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server providing cloud computing services.
[0055] In an exemplary embodiment, Figure 2 As shown, a data processing method is provided, which is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:
[0056] Step S201: Receive a data query request and obtain a first query text and query request parameters of the data query request.
[0057] Specifically, a user can submit a data query request to a server through interaction with a terminal. The server can receive the data query request from the terminal and obtain a first query text and query request parameters corresponding to the request. The first query text can be the query content entered by the user through the terminal, such as "mobile phones priced below X yuan." The query request parameters can include the request time of the data query request and requesting user information, which can include user identification, user type, etc.
[0058] Step S202: performing intent recognition on the data query request according to the first query text and the query request parameters to obtain the query intent of the data query request.
[0059] By performing intent recognition on the data query request based on the first query text and query request parameters, the data query request can be classified to obtain the query intent of the data query request. For example, for a data query request with the first query text "mobile phones priced below X yuan," intent recognition can be used to determine that the query type corresponding to the data query request is a product search query, and the corresponding query intent can be obtained based on the classification result.
[0060] In an exemplary embodiment, performing intent recognition on a data query request based on a first query text and query request parameters to obtain the query intent of the data query request may include: extracting query features based on the first query text and query request parameters; performing intent classification on the data query request based on the first query text, query request parameters and query features to obtain an intent classification result; and obtaining the query intent of the data query request based on the intent classification result.
[0061] Specifically, based on the first query text and query request parameters, multiple query features of the data query request can be extracted, including but not limited to the query text's character length, number of tokens, whether it contains numbers, whether it contains special characters, whether it ends with a question mark, as well as the user's recent query history and the time period of the request. Based on the first query text, query request parameters, and query features, an intent classification service can be used to classify the data query request.
[0062] Exemplarily, the intent classification service can integrate multiple query features of data query requests to classify the intent of data query requests, where the character length and number of tokens of the query text can help distinguish simple queries from complex queries, whether it contains numbers can help identify specific query types such as product numbers and price ranges, whether it contains special characters can help identify whether it indicates advanced search syntax or special query formats, whether it ends with a question mark can help identify question-and-answer queries, and the user's recent query history can provide the user's historical behavior context, thereby associating the user's common query intent types and interest query intent types. The time period to which the request time belongs can help determine the query intent pattern associated with a specific time period.
[0063] Among them, the intent classification service can determine the main intent type of the data query request, the confidence score corresponding to the main intent type, all possible intent types, etc. based on the first query text, query request parameters and query features, and construct a query intent object based on these data to obtain the query intent corresponding to the data query request.
[0064] Optionally, before performing intent recognition on a data query request, the first query text may be preprocessed by text cleaning, data standardization, spelling correction, etc., and then intent recognition may be performed based on the processed first query text and query request parameters.
[0065] Step S203: rewrite the first query text according to the query intent and the query request parameters to obtain a second query text.
[0066] The first query text may be rewritten based on the query intent and query request parameters of the data query request to obtain the second query text. For example, a rewriting rule for the first query text may be determined based on the query intent and query request parameters, and then the rewriting rule may be applied to rewrite the first query text. For example, the rewriting of the first query text may include word meaning expansion, etc.
[0067] Step S204: Obtain a query rule set corresponding to the query intent.
[0068] According to the query intent of the data query request, a corresponding query rule set can be obtained. The query rule set can include one or more query rules, and each query rule can correspond to one or more query actions, such as setting field weights, filtering fields, etc.
[0069] Optionally, the server may store multiple query rule configuration files, each of which may correspond to one or more query intents, so that according to the query intent of the data query request, the corresponding query rule configuration file may be obtained, and then the query rule set corresponding to the query intent may be obtained by parsing the query rule configuration file.
[0070] Step S205 : performing a data query operation using a search engine according to the second query text, the query request parameters and the query rule set, and obtaining a data query result corresponding to the data query request.
[0071] Among them, according to the second query text of the data query request, the query request parameters and the query rule set corresponding to the query intent, a search engine can be used to perform corresponding data query operations. Exemplarily, a query statement of the search engine can be constructed based on the second query text and the query request parameters according to each query rule in the query rule set, and then a data query operation can be performed by inputting the query statement into the search engine. Exemplarily, the search engine used in this application can be a distributed search engine based on an inverted index, which can query business data according to the query statement and return data query results that match the query statement.
[0072] Step S206: Display the data query results according to the result display method corresponding to the query request parameters.
[0073] Among them, based on the requesting user information included in the query request parameters, the user ID, user type, and other information corresponding to the user who initiated the data query request can be obtained, and then the result display method corresponding to the user can be obtained. Therefore, based on the result display method, the data query results can be displayed in a user-friendly manner.
[0074] Optionally, the result display method corresponding to the user may refer to the sorting method preferred by the user, etc. According to the result display method, the data query results may be sorted and optimized, specific results may be upgraded or downgraded, and then the data query results after sorting optimization may be displayed to the user.
[0075] Optionally, the result display mode corresponding to the user can be a result display mode that is predetermined based on the user's user profile and meets the user's personalized needs. In this step, the query request parameters can be directly used to query and obtain the result display mode.
[0076] In the above data processing method, after receiving the data query request, the data query request is firstly identified for intent to obtain the query intent, and the first query text is rewritten in combination with the query intent and the query request parameters, so as to obtain a second query text that can accurately reflect the user's data query needs; and by obtaining the query rule set corresponding to the query intent, it is possible to flexibly adapt to the diversified business needs in different business scenarios and obtain query rules that are targeted at the current data query request; then, in combination with the query rule set, the second query text and the query request parameters, a search engine is used to perform data query, so as to achieve efficient and accurate query of the business data required by the user and obtain data query results that are highly relevant to the user's data query request; finally, the data query results are displayed using the result display method corresponding to the query request parameters, so that the data query results can be displayed in a user-friendly manner, which is conducive to improving the user's information acquisition efficiency.
[0077] In an exemplary embodiment, Figure 3 As shown, the first query text is rewritten according to the query intent and query request parameters to obtain the second query text, which may include:
[0078] Step S301 : performing data standardization processing on the first query text to obtain a processed first query text.
[0079] After obtaining the first query text, data standardization processing can be performed on it first. Exemplarily, data standardization processing can include symbol standardization processing and error correction processing. Symbol standardization processing can include removing blank characters at the beginning and end of the character string in the first query text, replacing consecutive blank characters in the character string with a single space, converting Chinese punctuation marks into English punctuation marks, etc.; error correction processing can be first dividing the first query text into word units according to blank characters, and then checking each word unit separately to see if there is a spelling error. If it is determined that there is a spelling error, the best correction word is determined based on factors such as word frequency, edit distance, and context relevance, and the word unit with the spelling error is replaced with the best correction word. After performing symbol standardization processing and error correction processing on the first query text in sequence, a processed first query text can be obtained.
[0080] Step S302: Perform semantic analysis on the processed first query text to obtain a semantic analysis result.
[0081] The processed first query text may be subjected to semantic analysis to obtain semantic analysis results. For example, the semantic analysis results may include information such as the tokens of the processed first query text, part-of-speech tags of each token, entity recognition results, and dependency syntactic relationships.
[0082] For example, in semantic analysis, the processed first query text can be segmented to obtain the word elements it contains, and then for each word element, its corresponding part of speech, whether it is a named entity (for example, whether it is a person's name, a place name, an organization name, etc.), whether it is a keyword (usually a content word such as a noun or verb), and the grammatical relationship between each word element can be analyzed to form a syntactic tree structure, and then a semantic analysis result containing this information can be obtained.
[0083] Optionally, in this step, a natural language processing model may be used to perform semantic analysis on the processed first query text and output corresponding semantic analysis results.
[0084] Step S303 : performing word meaning expansion processing on the processed first query text according to the semantic analysis result to obtain an expanded first query text.
[0085] According to the semantic analysis result, the processed first query text is subjected to word meaning expansion processing, wherein the word meaning expansion processing may refer to obtaining synonyms and near synonyms of words in the processed first query text and adding them to the first query text.
[0086] Exemplarily, in this step, only the keywords in the processed first query text can be expanded in sense to avoid noise. For each keyword, it can be further determined whether it is an entity, and different sense expansion strategies can be used to obtain synonyms and near-synonyms for entity words and common words. Then, the original word and its synonyms and near-synonyms can be combined using OR logic to expand the semantic coverage. Optionally, when the first query text is expanded in sense, its original query structure can be maintained, and only the content at the keyword position can be replaced.
[0087] Step S304: Obtain a rewriting rule set according to the query intent and query request parameters.
[0088] The corresponding rewriting rule set can be retrieved based on the query intent and query request parameters of the data query request. The rewriting rule set can include one or more rewriting rules, each of which corresponds to one or more rewriting actions, such as converting expressions, deleting redundant words, etc.
[0089] Optionally, the server can store multiple rewriting rule configuration files, each of which can be associated with one or more query intents, user types, and request time periods, so that according to the query intent and query request parameters of the data query request, the corresponding rewriting rule configuration file can be obtained, and then the corresponding rewriting rule set can be obtained by parsing the rewriting rule configuration file.
[0090] Step S305: rewrite the expanded first query text using the rewriting rule set to obtain a second query text.
[0091] The expanded first query text can be rewritten using each rewriting rule in the rewriting rule set to obtain the second query text. For example, when rewriting using the rewriting rule set, each rewriting rule can be used sequentially to rewrite the expanded first query text, and subsequent rewriting rules can be used to process the output of previous rewriting rules, thereby achieving chained application of rewriting rules.
[0092] In this embodiment, by performing data standardization processing on the first query text, the expression accuracy of the first query text can be improved, and by performing semantic analysis on the first query text and then expanding the meaning of the first query text based on the semantic analysis results, the semantic understanding ability of the first query text can be improved, and a query text with higher search efficiency can be obtained. At the same time, in this embodiment, a rewriting rule set is obtained based on the query intent and query request parameters, and a targeted rewriting rule set can be obtained by combining the user's current data query needs and user characteristics, historical behavior, scene characteristics and other factors, so that the first query text can be rewritten using the rewriting rule set to obtain a second query text that can accurately reflect the user's real data query needs. Subsequent data query operations based on the second query text can achieve more accurate and efficient retrieval of the business data required by the user, and obtain data query results with higher relevance.
[0093] In an exemplary embodiment, rewriting the expanded first query text using a rewriting rule set to obtain a second query text may include: taking the expanded first query text as the current text; determining the matching of each rewriting rule with the query intent and query request parameters in turn according to the priority order of each rewriting rule in the rewriting rule set; if there is a match, rewriting the current text according to the rewriting rule; when the rewriting termination condition is met, obtaining the second query text according to the rewritten current text.
[0094] Specifically, each rewrite rule in the rewrite rule set can have a corresponding priority order, and each rewrite rule can include a rewrite condition and a rewrite action. The rewrite condition can be used to indicate the conditions that a data query request that matches the rewrite rule must meet, such as the query intent must meet a specific intent type, or the query request parameters must correspond to a specific request time period or a specific user type.
[0095] Among them, when rewriting the expanded first query text using the rewriting rule set, the first rewriting rule can be obtained as the current rule according to the priority order of each rewriting rule, and the expanded first query text can be used as the current text. According to the rewriting conditions of the current rule, the matching of the current rule with the query intent and the query request parameters is judged. If it matches, the current text is rewritten and updated according to the rewriting action of the current rule. Then, the next rewriting rule can be used as the current rule, and the rewritten current text can be used as the current text. The above process is repeated until the rewriting termination condition is met, and the second query text can be obtained according to the rewritten current text. Optionally, the rewriting termination condition can be that all rewriting rules in the rewriting rule set are traversed, or the current rule is marked as a termination rule, or the number of applied rewriting rules reaches a preset value, etc.
[0096] In this embodiment, by performing priority management on the rewriting rules and rewriting the first query text using each rewriting rule of the rewriting rule set in order of priority, precise control of the text rewriting process can be achieved, and important rewriting rules can be executed first, which is beneficial to improving the accuracy of the second query text and improving the accuracy of subsequent data queries.
[0097] In an exemplary embodiment, Figure 4 As shown, according to the second query text, the query request parameters and the query rule set, a data query operation is performed using a search engine to obtain a data query result corresponding to the data query request, which may include:
[0098] Step S401 : According to the priority order of each query rule in the query rule set, the matching of each query rule with the second query text and the query request parameters is determined in sequence. If they match, a query action is constructed according to the query rule.
[0099] Each query rule in the query rule set may have a corresponding priority order, and each query rule may include query conditions and query action information.
[0100] The query conditions can be used to indicate the conditions that a data query request must meet to match the query rule. For example, they can include specific content that the second query text or query request parameters must contain, or that the query request parameters must correspond to a specific request time period or a specific user type. Exemplarily, the query conditions can include a field name, a matching parameter, and a matching reference value. The field name can indicate the field to be matched, such as the second query text, the request time, or the requesting user information. The matching parameter can indicate the relationship that must be met between the field content corresponding to the field name and the matching reference value. For example, these conditions can include equality (strict equality between the field content and the matching reference value), string containment check (the field content is a string and contains the matching reference value), regular expression matching (the field content matches the matching reference value as a regular expression), greater than comparison (the field content is a numeric value and is greater than the matching reference value), less than comparison (the field content is a numeric value and is less than the matching reference value), and set containment check (the field content is an array and contains the matching reference value).
[0101] The query action information can be used to indicate the content that needs to be constructed in the query statement. For example, the query action information can include an action type and action object parameters. The action type can include a weight setting action, a filter adding action, a sort setting action, etc. The action object parameters can include the parameters required to construct the query action, such as the query field name and weight value corresponding to the weight setting action, the query field name and filter condition corresponding to the filter adding action, and the query field name and sort direction corresponding to the sort setting action.
[0102] Among them, for each query rule in the query rule set, the first query rule can be obtained as the current rule according to the priority order, and the matching of the current rule with the second query text and the query request parameters can be judged according to the query conditions of the current rule. If they match, the corresponding query action can be created according to the query action information of the current rule. Then, the next query rule can be used as the current rule, and the above process can be repeated until the construction termination condition is met. Optionally, the construction termination condition can be that all query rules in the query rule set are traversed, or the current rule is marked as a termination rule, or the number of applied query rules reaches a preset value, etc. Among them, creating a query action can refer to constructing a query clause according to the query action information, and merging the query clause into the query statement of the search engine. Among them, the query statement of the search engine can be an object containing the second query text pre-constructed according to the query grammar of the search engine. By constructing query actions according to the query rules in sequence, query clauses corresponding to each query action can be added to the query statement in sequence.
[0103] Step S402: When the construction termination condition is met, a query statement of the search engine is obtained according to the second query text and each query action.
[0104] When the construction termination condition is met, a query statement including the second query text and query clauses corresponding to each query action can be obtained.
[0105] Step S403: Using a search engine, perform a data query operation according to the query statement to obtain a data query result.
[0106] By inputting a query statement into a search engine, the search engine can be used to perform a data query operation on the business data and obtain corresponding data query results. Optionally, in this step, the query statement can be serialized into a JSON string as the request body and passed to the search engine via a POST request, so that the search engine can perform a data query operation based on the query statement.
[0107] In this embodiment, by performing priority management on query rules, it is possible to ensure that important query rules are evaluated and processed first, which is beneficial to improving the accuracy of query statements and further improving the precision and efficiency of data queries.
[0108] In an exemplary embodiment, the method may also include: obtaining rule configuration information in response to a query rule configuration operation; parsing the rule configuration information to obtain the query intent, matching conditions, query actions, and priority information corresponding to the rule configuration information; constructing a query rule containing matching conditions and query actions, and adding the query rule to the query rule set corresponding to the query intent according to the priority information.
[0109] The user can configure the query rules by performing a query rule configuration operation through a terminal. For example, the user can configure the query rules by interacting with a graphical interface or uploading a configuration file. In response to the query rule configuration operation, the server can obtain the content entered by the user through the graphical interface or the configuration file uploaded by the user, thereby obtaining the corresponding rule configuration information.
[0110] For example, the rule configuration information may include the user's natural language description of the query rule and the priority information set by the user for the query rule. The server may parse the natural language description by utilizing, for example, a natural language processing model to obtain the corresponding query intent, matching conditions, and query actions. For example, the natural language description of the query rule provided by the user may be "If the query contains a brand noun, then the weight of the field corresponding to the brand is increased by 5 times." The server may parse the query to obtain that the corresponding query intent is a product query, the matching condition is that the query text contains a brand noun, and the corresponding query action is to increase the field weight of the query field corresponding to the brand noun contained in the query text by 5 times.
[0111] Thus, the server can construct a query rule including a matching condition and a query action, and add the query rule to the query rule set corresponding to the query intent according to the priority information.
[0112] Optionally, users can modify existing query rules by interacting with a graphical interface or uploading configuration files. The server can have a rule version management function. Whenever a query rule is modified, the server can automatically generate a version number for the new rule and archive the old version of the rule.
[0113] Optionally, the query rule set may be stored in the server in the form of a query rule profile, and each query rule profile may be associated with one or more query intents to be applied to different business scenarios.
[0114] In this embodiment, users can construct query rules through query rule configuration operations, which can effectively simplify the query rule construction process, enable users to flexibly configure complex business logic without modifying the code, and can efficiently and quickly construct query rules suitable for different business scenarios.
[0115] In an exemplary embodiment, the search engine may be a distributed search engine based on an inverted index. The method may further include: obtaining business data; performing data cleaning and data standardization on the business data to obtain processed business data; creating an inverted index based on the processed business data; and using the inverted index to perform data query operations on the search engine.
[0116] The search engine used in this application may be a distributed search engine based on an inverted index. In order to apply the search engine to data queries on business data, an inverted index needs to be established based on the business data.
[0117] The server can connect to the data interfaces of one or more data sources to acquire and process business data in real time. After acquiring the business data, the server can perform data cleaning and data standardization to obtain processed business data. For example, data cleaning for business data can include deduplication, and data standardization can include error correction and format standardization. For example, data containing spelling errors can be automatically corrected according to preset error correction rules; date fields in different formats can be uniformly converted to a standard format.
[0118] After obtaining the processed business data, the server can construct an inverted index based on the data and store it, so that in subsequent data queries, the search engine can perform data query operations on the business data based on the inverted index.
[0119] In this embodiment, by performing data cleaning and data standardization on the business data before establishing the inverted index, and then establishing the inverted index based on the processed business data, the noise in the index can be effectively reduced, which is conducive to improving the accuracy of data query.
[0120] In one embodiment, a data processing method in a specific embodiment is provided.
[0121] Specifically, the data processing method in this embodiment can be performed as follows: Figure 5 The data processing system shown in the figure is executed. The system may include a rule engine module, a query processing module, a business data processing module, a search execution module and a result processing module.
[0122] The rule engine module allows business personnel to define and modify query rules through a graphical interface or simple text editing. Business personnel can log in to the rule engine module's user interface and define query rules using a graphical drag-and-drop widget or a text editor. Business personnel can describe query rules using natural language or a rule description language. For example, a query rule can be defined as "For the electronics category, if the query includes 'value for money,' then increase the weight of products with a review score above 4.5." The rule configuration unit can obtain rule configuration information in response to the business personnel's query rule configuration operation. The rule engine can parse the rule configuration information into condition and action objects, sort them by priority, and save them to the rule library. The rule engine module can also include a rule template library, from which business personnel can obtain rule templates and configure query rules based on the rule templates. The rule engine module also supports multi-dimensional definition of query rules. The rule engine module also has rule version management. Whenever a business personnel modifies a query rule, the system automatically generates a version number for the new rule and archives the old version of the rule. Optionally, the rule engine module can also precompile query rules, parse them into memory data structures to reduce runtime parsing time, compile conditional expressions into executable code to improve evaluation efficiency, and build a rule dependency graph to optimize the execution order of rules. Optionally, the rule engine module can also utilize a multi-level cache architecture to store rules through memory, distributed cache, persistent storage, etc., identify and preload hot spot rules, and dynamically adjust the cache expiration time based on the frequency of rule data updates to avoid cache failure.
[0123] The business data processing module can connect to the data interfaces of one or more data sources to acquire and process business data in real time. After acquiring the business data, the data preprocessing unit can perform data cleansing (including deduplication) and data standardization (including error correction and format standardization) on the business data to obtain processed business data. The index building unit can then create an inverted index based on the processed business data. The inverted index can be used by search engines for data queries.
[0124] The query processing module can receive a data query request submitted by a user through the query input unit and obtain a first query text and query request parameters. The query processing unit and the query understanding unit can then perform intent recognition on the data query request based on the first query text and query request parameters to obtain the query intent of the data query request. The first query text can then be rewritten based on the query intent and query request parameters to obtain a second query text. The query processing module can then transmit the second query text, query request parameters, and query intent to the rule engine module.
[0125] Exemplarily, after obtaining the first query text, the query processing module can first use the query preprocessing unit to perform data standardization processing on the query text, including removing redundant spaces, standardizing punctuation, performing spelling checking and correction to fix possible spelling errors, etc. Then, the query processing module can use the query understanding unit to perform intent recognition on the processed first query text and query parameters to obtain the query intent of the data query request. At the same time, the query understanding unit can perform semantic analysis on the processed first query text, extract structured information such as keywords and entities in the query, obtain semantic analysis results, and perform word meaning expansion processing on the first query text based on the semantic analysis results to obtain an expanded first query text. Then, the query understanding unit can obtain a rewriting rule set applicable to the data query request from the rule engine module based on the query intent and query request parameters, and use the rewriting rule set to rewrite the expanded first query text to obtain a second query text.
[0126] For example, after loading a set of rewriting rules based on query intent and query request parameters, the query understanding unit can apply each rewriting rule in order of priority, ensuring that important rules are executed first. It also supports rule chaining, allowing subsequent rules to process the output of previous rules. If the applied rule is a terminating rule, the rewriting process ends prematurely. Furthermore, the query understanding unit can fully record the rule application process to facilitate subsequent debugging and optimization.
[0127] Among them, after obtaining the second query text, query request parameters and query intent from the query processing module, the rule engine module can obtain the corresponding query rule set according to the query intent, and transmit the second query text, query request parameters and query rule set to the search execution module.
[0128] Among them, after the search execution module obtains the second query text, query request parameters and query rule set from the rule engine module, it can load the various query rules in the query rule set through the query construction unit therein, and then determine the matching of each query rule with the second query text and query request parameters in turn according to the priority order of each query rule in the query rule set. If it matches, it constructs a query action according to the query rule (for example, increasing the weight of a specific field, adding filtering conditions, setting sorting rules, etc.). Finally, when the construction termination condition is met, it can generate a query statement containing a search engine according to the second query text and each query action. Then, the search execution module can use the search engine to perform data query operations through the search execution unit therein, search for content that matches the query statement in the inverted index of the business data processing module, and return the corresponding data query results. Among them, after obtaining the data query results, the search execution unit can send the data query results to the result processing module.
[0129] Among them, after the result processing module obtains the data query results from the search execution module, it can post-process the data query results through the result processing unit, and then present the processed data query results through the result display unit. Among them, the result processing unit can obtain the result display method corresponding to the query request parameters, and perform sorting optimization and other processing on the data query results according to the display method. For example, it can upgrade or downgrade specific results and generate result explanations to explain why certain results are ranked in front. The result display unit can present the processed data query results and result explanations to the user in a user-friendly manner. Among them, the result display method corresponding to the query request parameters can be a display method determined according to preset rules and the user portrait corresponding to the query request parameters.
[0130] The data processing system according to this embodiment can configure query rules and query business data through the following steps:
[0131] In step S1, a business operator logs in to the operation interface of the rule engine module and defines search rules by graphical drag and drop components or text editor. The rule engine parses the rules into condition and action objects, sorts them by priority, and saves them to the rule library.
[0132] In step S2, when the user enters a search query, the query processing module receives the data query request and obtains the corresponding first query text and query request parameters, and performs data standardization processing on the first query text, including removing redundant spaces, standardizing punctuation, spelling checking and correction, etc., to obtain a processed first query text.
[0133] In step S3, the query processing module performs intent recognition and semantic analysis on the processed first query text and query request parameters to obtain the query intent and semantic analysis results of the data query request, and performs word meaning expansion processing on the processed first query text based on the semantic analysis results to obtain the expanded first query text, and then rewrites the expanded first query text according to the rewriting rule set corresponding to the query intent and query request parameters to obtain the second query text.
[0134] Step S4: The search execution module loads a query rule set applicable to the query intent, sorts them by priority, and evaluates, in turn, whether the conditions of each rule match the second query text and the query request parameters.
[0135] Step S5: When the query rule matches the data query request, the search execution module executes the action defined by the rule, such as increasing the field weight, adding field filtering, etc.
[0136] Step S6: After completing the execution of each query rule, the search execution module generates a query statement for the search engine, sends the query statement to the search engine for execution, and obtains the data query result obtained by the search engine based on the inverted index matching constructed according to the business data.
[0137] In step S7, the result processing module applies post-processing rules to the data query results, such as personalized sorting based on the user's historical behavior, and appropriately improves the sorting position of the query results that the user frequently clicks.
[0138] In step S8, the result processing module presents the processed data query results in a user-friendly manner and records the user's interaction with the results (such as user feedback submitted by the user) for subsequent optimization of query rules, rewriting rules, etc.
[0139] In this embodiment, by providing a data processing system that includes a rule engine module, the flexible configuration capabilities and efficient execution mechanism of the rule engine can be utilized to achieve intelligent, precise, and scalable business data search. Based on this solution, business personnel can independently define and adjust query logic without complex code modifications. Moreover, the system can dynamically apply different rule combinations based on the query text and query request parameters of the data query request to achieve accurate data query result sorting. At the same time, through rule version management and effect evaluation mechanisms, the system can continuously optimize search results and adapt to ever-changing business needs.
[0140] It should be understood that, although the steps in the flowcharts of the above embodiments are shown in sequence as indicated by the arrows, these steps are not necessarily performed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be performed in other orders. Moreover, at least a portion of the steps in the flowcharts of the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily to be performed in sequence, but can be performed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0141] Based on the same inventive concept, the present application also provides a data processing device for implementing the aforementioned data processing method. The implementation solution provided by this device is similar to the implementation solution described in the aforementioned method. Therefore, the specific limitations in one or more data processing device embodiments provided below can be found in the above-mentioned limitations on the data processing method and will not be repeated here.
[0142] In an exemplary embodiment, Figure 6 As shown, a data processing device 600 is provided, including:
[0143] The request parsing module 601 is configured to receive a data query request and obtain a first query text and query request parameters of the data query request;
[0144] An intent recognition module 602 is configured to perform intent recognition on the data query request based on the first query text and the query request parameters to obtain the query intent of the data query request;
[0145] A text rewriting module 603 is configured to rewrite the first query text according to the query intent and the query request parameters to obtain a second query text;
[0146] A rule acquisition module 604 is configured to acquire a query rule set corresponding to the query intent;
[0147] A data query module 605 is configured to perform a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set, to obtain a data query result corresponding to the data query request;
[0148] The result display module 606 is used to display the data query result according to the result display method corresponding to the query request parameter.
[0149] In an exemplary embodiment, the text rewriting module 603 is used to: perform data standardization processing on the first query text to obtain a processed first query text; perform semantic analysis on the processed first query text to obtain a semantic analysis result; perform word meaning expansion processing on the processed first query text based on the semantic analysis result to obtain an expanded first query text; obtain a rewriting rule set based on the query intent and the query request parameters; and rewrite the expanded first query text using the rewriting rule set to obtain a second query text.
[0150] In an exemplary embodiment, the text rewriting module 603 is used to: use the expanded first query text as the current text; determine the matching of each rewriting rule with the query intent and the query request parameters in turn according to the priority order of each rewriting rule in the rewriting rule set; if they match, rewrite the current text according to the rewriting rule; when the rewriting termination condition is met, obtain the second query text based on the rewritten current text.
[0151] In an exemplary embodiment, the data query module 605 is used to: determine the matching of each query rule with the second query text and the query request parameters in turn according to the priority order of each query rule in the query rule set; if they match, construct a query action according to the query rule; when the construction termination condition is met, obtain the query statement of the search engine according to the second query text and each query action; use the search engine to perform a data query operation according to the query statement to obtain the data query result.
[0152] In an exemplary embodiment, the device also includes: a configuration acquisition module, which is used to obtain rule configuration information in response to a query rule configuration operation; a configuration parsing module, which is used to parse the rule configuration information to obtain the query intent, matching conditions, query actions, and priority information corresponding to the rule configuration information; a rule construction module, which is used to construct a query rule containing the matching conditions and the query action, and add the query rule to the query rule set corresponding to the query intent according to the priority information.
[0153] In an exemplary embodiment, the search engine is a distributed search engine based on an inverted index; the device also includes: a data acquisition module for acquiring business data; a preprocessing module for performing data cleaning and data standardization on the business data to obtain processed business data; an index establishment module for creating an inverted index based on the processed business data; the inverted index is used by the search engine to perform data query operations.
[0154] Each module in the above-mentioned data processing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0155] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store data such as query rule sets. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method is implemented.
[0156] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0157] In one embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0158] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0159] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0160] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0161] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the various embodiments provided herein may be, but are not limited to, general-purpose processors, central processing units (CPUs), graphics processing units (GPUs), digital signal processors (DSPs), programmable logic devices (PLDs), quantum computing-based data processing logic devices, artificial intelligence (AI) processors, and the like.
[0162] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0163] The above embodiments merely illustrate several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A data processing method, characterized in that: The method comprises: Receive a data query request, and obtain a first query text and query request parameters of the data query request; performing intent recognition on the data query request according to the first query text and the query request parameters to obtain the query intent of the data query request; rewriting the first query text according to the query intent and the query request parameters to obtain a second query text; Obtaining a query rule set corresponding to the query intent; performing a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set to obtain a data query result corresponding to the data query request; Display the data query results according to the result display method corresponding to the query request parameters.
2. The method according to claim 1, characterized in that The step of rewriting the first query text according to the query intent and the query request parameters to obtain a second query text includes: performing data standardization processing on the first query text to obtain a processed first query text; Performing semantic analysis on the processed first query text to obtain a semantic analysis result; performing word meaning expansion processing on the processed first query text according to the semantic analysis result to obtain an expanded first query text; Obtaining a rewriting rule set according to the query intent and the query request parameters; The expanded first query text is rewritten using the rewriting rule set to obtain a second query text.
3. The method according to claim 2, characterized in that The step of rewriting the expanded first query text by using the rewriting rule set to obtain a second query text includes: Using the expanded first query text as current text; According to the priority order of each rewriting rule in the rewriting rule set, the matching of each rewriting rule with the query intent and the query request parameters is determined in sequence, and if there is a match, the current text is rewritten according to the rewriting rule; When the rewriting termination condition is met, the second query text is obtained according to the rewritten current text.
4. The method according to claim 1, wherein The step of performing a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set to obtain a data query result corresponding to the data query request includes: According to the priority order of each query rule in the query rule set, the matching of each query rule with the second query text and the query request parameter is determined in sequence, and if there is a match, a query action is constructed according to the query rule; When the construction termination condition is met, obtaining a query statement of the search engine according to the second query text and each query action; The search engine is used to perform a data query operation according to the query statement to obtain the data query result.
5. The method according to claim 1, wherein The method further comprises: In response to a query rule configuration operation, obtaining rule configuration information; Parsing the rule configuration information to obtain query intent, matching conditions, query actions, and priority information corresponding to the rule configuration information; A query rule including the matching condition and the query action is constructed, and the query rule is added to a query rule set corresponding to the query intent according to the priority information.
6. The method according to any one of claims 1 to 5, characterized in that The search engine is a distributed search engine based on an inverted index; The method further comprises: Obtain business data; Performing data cleaning and data standardization on the business data to obtain processed business data; An inverted index is created based on the processed business data; the inverted index is used by the search engine to perform data query operations.
7. A data processing device, characterized in that: The device comprises: A request parsing module, configured to receive a data query request and obtain a first query text and query request parameters of the data query request; an intent recognition module, configured to perform intent recognition on the data query request based on the first query text and the query request parameters, and obtain the query intent of the data query request; a text rewriting module, configured to rewrite the first query text according to the query intent and the query request parameters to obtain a second query text; A rule acquisition module, configured to acquire a query rule set corresponding to the query intent; a data query module, configured to perform a data query operation using a search engine according to the second query text, the query request parameters, and the query rule set, and obtain a data query result corresponding to the data query request; The result display module is used to display the data query result according to the result display method corresponding to the query request parameter.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Searching method and system
CN104850554A
Commodity search recommendation method and system
CN114611010A
Method and system for regulating and controlling comprehensive query of multivariate data, computer equipment and medium
CN115329047A
Data query method, electronic equipment and computer readable storage medium
CN117112613A
Retrieval processing method and related equipment
CN119537672A