Information query method and device, electronic equipment, storage medium and product

By analyzing the difficulty level of query statements and system load information, and dynamically adjusting the query method, the problem of unreasonable allocation of computing resources was solved, achieving the best balance between query efficiency, cost and accuracy, and optimizing resource allocation.

CN122152861APending Publication Date: 2026-06-05BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING QIYI CENTURY SCI & TECH CO LTD
Filing Date
2026-02-04
Publication Date
2026-06-05

Smart Images

  • Figure CN122152861A_ABST
    Figure CN122152861A_ABST
Patent Text Reader

Abstract

The application provides an information query method and device, electronic equipment, storage medium and product. The method comprises: obtaining a query statement input by a user; analyzing the query statement to obtain a query difficulty coefficient of the query statement; the query difficulty coefficient is used to represent the difficulty of obtaining a query result corresponding to the query statement; obtaining system load information of a query system at a current time, the query system being a system used to perform an information query task; determining a target query mode corresponding to the query statement according to the query difficulty coefficient and the system load information; the target query mode is used to represent that the query cost of the query statement is in a direct proportional relationship with the query difficulty coefficient and in an inverse proportional relationship with the system load information; and performing information query processing on the query statement based on the target query mode. The application can realize reasonable allocation of computing resources and achieve the purpose of optimal balance of query efficiency, cost and accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information retrieval technology, and in particular to an information retrieval method, apparatus, electronic device, storage medium, and product. Background Technology

[0002] In information processing systems, information retrieval is a crucial link supporting the efficient operation of various core business processes. Currently, the commonly used retrieval methods typically include the following two: 1. Traditional Database Retrieval and Keyword Matching: This method offers fast response times, low costs, and efficient processing of structured data and explicit keyword queries. For example, it can be used to query a list of actors' works via SQL.

[0003] 2. Deep Analysis Based on Large Language Models: This method possesses powerful semantic understanding and logical reasoning capabilities, enabling it to handle complex and open-ended questions. For example, it can analyze character traits and summarize plot points.

[0004] Current information processing systems typically employ a single information query method. This method cannot achieve a reasonable allocation of computing resources (for example, using a heavyweight language model to process a simple database query results in a waste of a large amount of GPU (Graphics Processing Unit) computing power) and cannot achieve a balance between query efficiency, cost, and accuracy. Summary of the Invention

[0005] The purpose of this application is to provide an information query method, apparatus, electronic device, storage medium, and product to achieve a reasonable allocation of computing resources and an optimal balance between query efficiency, cost, and accuracy. The specific technical solution is as follows: In a first aspect of this application, an information retrieval method is provided, comprising: Get the query statement entered by the user; The query statement is analyzed to obtain the query difficulty coefficient; the query difficulty coefficient is used to characterize the difficulty of obtaining the query result corresponding to the query statement. Obtain the system load information of the query system at the current moment, where the query system refers to the system used to perform information query tasks; Based on the query difficulty coefficient and the system load information, the target query method corresponding to the query statement is determined; the target query method is used to characterize that the query cost and query difficulty of the query statement are directly proportional to the query difficulty coefficient and inversely proportional to the system load information. The query statement is processed based on the target query method.

[0006] In a second aspect of this application, an information query device is provided, comprising: The query statement retrieval module is used to retrieve the query statement input by the user. The difficulty coefficient acquisition module is used to analyze the query statement and obtain the query difficulty coefficient of the query statement; the query difficulty coefficient is used to characterize the difficulty of obtaining the query result corresponding to the query statement; The system load acquisition module is used to acquire the system load information of the query system at the current moment, wherein the query system refers to the system used to perform information query tasks. The target query method determination module is used to determine the target query method corresponding to the query statement based on the query difficulty coefficient and the system load information; the target query method is used to characterize that the query cost and query difficulty of the query statement are directly proportional to the query difficulty coefficient and inversely proportional to the system load information; The information query module is used to perform information query processing on the query statement based on the target query method.

[0007] In another aspect of this application, an electronic device is also provided, including 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; Memory, used to store computer programs; The processor, when executing a program stored in memory, implements any of the information query methods described above.

[0008] In another aspect of this application, a computer-readable storage medium is also provided, wherein instructions are stored therein, which, when executed on a computer, cause the computer to perform any of the information query methods described above.

[0009] In another aspect of this application, a computer program product containing instructions is also provided, on which a computer program is stored, which, when run on a computer, causes the computer to execute any of the information query methods described above.

[0010] The solution provided in this application analyzes the difficulty of user-input queries and determines the appropriate query method based on the analyzed query difficulty coefficient and the current system load. Information is then retrieved according to the determined query method. In this process, query difficulty analysis enables differentiated query processing, avoiding the consumption of GPU and other computing resources, reducing the ineffective use of high-cost computing resources, and achieving on-demand resource allocation. By dynamically adjusting the processing path based on system load information, the overall system throughput can be maximized while ensuring the quality of critical and complex query processing, achieving optimal resource allocation and reaching the best balance between query efficiency, cost, and accuracy. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.

[0012] Figure 1 A flowchart illustrating the steps of an information query method provided in this application embodiment; Figure 2 A flowchart illustrating the steps of a method for obtaining a query difficulty coefficient provided in this application embodiment; Figure 3 A flowchart illustrating the steps of a method for obtaining lexical feature values ​​provided in this application embodiment; Figure 4 A flowchart illustrating the steps of a method for obtaining syntactic feature values ​​provided in this application embodiment; Figure 5 A flowchart illustrating the steps of a method for obtaining logical feature values ​​provided in this application embodiment; Figure 6 A flowchart illustrating the steps of a target query method determination method provided in this application embodiment; Figure 7 A flowchart illustrating the steps of another target query method provided in this application embodiment; Figure 8 A flowchart illustrating the steps of an information query method provided in this application embodiment; Figure 9 A flowchart illustrating the steps of another information query method provided in this application embodiment; Figure 10 A flowchart illustrating the steps of another information query method provided in this application embodiment; Figure 11 A flowchart illustrating the steps of a structured information generation method provided in this application embodiment; Figure 12 A schematic diagram of an adaptive routing content retrieval process provided in an embodiment of this application; Figure 13 This is a schematic diagram of the structure of an information query device provided in an embodiment of this application; Figure 14 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0013] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0014] Figure 1 A flowchart illustrating the steps of an information method provided in this application embodiment is shown below. Figure 1 As shown, the information query method may include steps 101, 102, 103, 104 and 105.

[0015] Step 101: Obtain the query statement entered by the user.

[0016] The embodiments of this application can be applied to query systems, that is, the executing entity is the query system. In this example, the query system refers to a system used to perform information query tasks, which may include hardware resources (CPU (Central Processing Unit), GPU, memory, etc.) and software modules (database, search engine, language model, etc.). In specific implementations, the query system may be a technical system related to content retrieval on a certain video platform, etc.

[0017] In this embodiment, the query statement refers to the natural language query content entered by the user. It can be a simple factual question (such as "Who is the lead actor in the TV series 'XXX'?") or a complex analytical question (such as "Analyze the character's personality change trajectory in the early part of the script").

[0018] When users search for certain information (such as TV series or movies starring a certain actor, or TV series of the same type as XX TV series), they can enter a query statement.

[0019] In its implementation, the query system can provide a user interface (such as a search box, voice input interface, etc.). Users can input query statements through the user interface, such as entering query text through the search box to obtain the query statement, or entering query voice through the voice input interface and converting the voice into text to obtain the query statement.

[0020] Step 102: Analyze the query statement to obtain the query difficulty coefficient of the query statement; the query difficulty coefficient is used to characterize the difficulty of obtaining the query result corresponding to the query statement.

[0021] The query difficulty coefficient is a numerical indicator that quantifies the complexity of a query statement. It is obtained by analyzing and calculating the query statement and is used to characterize the difficulty of obtaining the query results corresponding to the query statement.

[0022] After receiving the user's query, the query can be analyzed to obtain the query difficulty coefficient. Specifically, the lexical, syntactic, and logical features of the query can be analyzed to obtain corresponding lexical, syntactic, and logical feature values. The query difficulty coefficient is then calculated by combining these three feature values. This implementation process will be illustrated in the following embodiments. Figure 2 A detailed description will not be repeated here.

[0023] Step 103: Obtain the system load information of the query system at the current moment. The query system refers to the system used to perform information query tasks.

[0024] System load information refers to a set of key indicators that reflect the current operating status of the query system, including at least CPU utilization, memory usage, GPU utilization, and GPU memory usage, used to determine whether system resources are sufficient.

[0025] When allocating query methods for query statements, the system load information of the query system at the current moment can be obtained. In specific implementations, system monitoring tools (such as operating system interfaces) can be used to collect hardware metrics of the query system in real time, such as CPU utilization, memory usage, GPU utilization, and GPU memory usage, to analyze the system load information of the query system at the current moment. Alternatively, a hardware metric collection thread can be pre-run in the query system. This thread can collect hardware metrics such as CPU utilization, memory usage, GPU utilization, and GPU memory usage in real time and analyze them to obtain the system load information of the query system at the current moment.

[0026] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application. In practical applications, other methods can also be used to obtain the system load information of the query system, and this embodiment does not limit this.

[0027] Step 104: Determine the target query method corresponding to the query statement based on the query difficulty coefficient and the system load information; the target query method is used to characterize that the query cost and query difficulty of the query statement are directly proportional to the query difficulty coefficient and inversely proportional to the system load information.

[0028] The target query method refers to the optimal query method determined based on the query difficulty coefficient and system load information. It can be used to characterize the relationship between query cost and query difficulty, which is directly proportional to the query difficulty coefficient and inversely proportional to the system load information. In this example, the target query method can include any one of the following: fast table lookup method, intelligent retrieval method, and deep analysis method. Specific definitions of these three query methods will be provided in the following embodiments. Figure 7 A detailed description will not be repeated here.

[0029] After obtaining the query difficulty coefficient of the query statement and the system load information of the query system at the current moment, the target query method corresponding to the query statement can be determined based on the query difficulty coefficient and system load information. Specifically, the query difficulty coefficient is positively correlated with the query cost and query difficulty of the query method, that is, the higher the query difficulty coefficient, the higher the query cost and query difficulty of the matching query method. The system load information is negatively correlated with the query cost and query difficulty of the query method, that is, the higher the current load of the query system, the lower the query cost and query difficulty of the matching query method. Based on this correspondence, decision rules are pre-established in the query system, defining query methods corresponding to different combinations of difficulty coefficients and loads, mapping the query difficulty coefficient to three levels of complexity: low, medium, and high, and combining the system load information to match the optimal query method (i.e., the target query method).

[0030] The process of determining the target query method by combining query difficulty coefficient and system load information will be described in the following embodiments. Figure 6 A detailed description will not be repeated here.

[0031] Step 105: Perform information query processing on the query statement based on the target query method.

[0032] After determining the target query method corresponding to the query statement, the query statement can be processed according to the target query method. That is, the query statement is processed according to at least one of the following methods: fast table lookup, intelligent retrieval, and deep analysis, to obtain the final query result, which is then output to respond to the user's input query statement. The specific query processing procedure will be described in detail in the following embodiments, and will not be repeated here.

[0033] This application's embodiments analyze the difficulty of user-input queries and, based on the analyzed query difficulty coefficient and current system load, determine the appropriate query method to retrieve information from the query. In this process, query difficulty analysis enables differentiated query processing, avoiding the consumption of GPU and other computing resources, reducing the ineffective use of high-cost computing resources, and achieving on-demand resource allocation. By dynamically adjusting the processing path based on system load information, the overall system throughput can be maximized while ensuring the quality of critical and complex query processing, achieving optimal resource allocation and reaching the best balance between query efficiency, cost, and accuracy.

[0034] Next, combined Figure 2 The process of obtaining the query difficulty coefficient of a query statement is described in detail.

[0035] Reference Figure 2 The diagram illustrates a flowchart of a method for obtaining a query difficulty coefficient according to an embodiment of this application. Figure 2 As shown, the method for obtaining the query difficulty coefficient may include steps 201, 202, 203, and 204.

[0036] Step 201: Perform lexical feature analysis on the segmented text of the query statement to obtain the lexical feature value corresponding to the query statement. The lexical feature value is used to reflect the degree of correlation between the query content and the target domain, where the target domain refers to the domain to which the query statement belongs.

[0037] In this embodiment, segmented text refers to the sequence of words obtained after segmenting the query statement, which is the basic unit of lexical feature analysis.

[0038] The target domain refers to the professional field involved in the query (such as film and television production, content operation, entertainment information, etc.).

[0039] Lexical feature values ​​are numerical values ​​(ranging from 0 to 1) that quantify the degree of relevance between query content and the target domain. Higher values ​​indicate a stronger relevance to the domain.

[0040] After receiving the query statement entered by the user, the query statement can be preprocessed. That is, after receiving the original query string, the system first performs standardization processing, including: converting full-width characters to half-width characters, removing extra spaces, and unifying the case of the text, so as to provide a standardized description for subsequent processes.

[0041] The query statement can be segmented into words to obtain the segmented text of the query statement. Specifically, this can be done using a word segmentation model or a word segmentation tool.

[0042] Then, lexical feature analysis can be performed on the segmented text to obtain the lexical feature values ​​corresponding to the query statement. In practical applications, a corresponding domain-specific thesaurus can be pre-built for the target domain, and the segmented text can be compared with the words in the domain thesaurus to statistically obtain the lexical feature values ​​corresponding to the query statement. For example, taking the film and television industry as the target domain, a pre-built "film and television thesaurus" can be loaded into the query system, which includes film and television works titles, actor names, director names, character names, production terms (such as "long take" and "montage"), and operational terms (such as "user retention rate" and "completion rate"). By comparing the segmented query with this thesaurus, the lexical feature values ​​of the query statement can be calculated. This implementation process will be combined with the following embodiments. Figure 3 A detailed description will not be repeated here.

[0043] Step 202: Perform syntactic analysis on the query statement to obtain the syntactic feature value corresponding to the query statement. The syntactic feature value is used to measure the sentence structure complexity of the query statement.

[0044] Syntactic feature values ​​(ranging from 0 to 1) are used to measure the complexity of the sentence structure of a query statement. Higher values ​​indicate more complex sentence structures.

[0045] After obtaining the query statement, syntactic analysis can be performed to obtain the corresponding syntactic feature values. Specifically, dependency parsing can be performed on the query statement to obtain its syntactic tree. By analyzing the generated syntactic tree, two key indicators can be extracted: the depth of the syntactic tree (reflecting the complexity of the sentence structure) and the number and type of interrogative words (e.g., "what is" corresponds to a simple query, while "why / how" corresponds to a complex query). Syntactic feature values ​​are then calculated based on these indicators. This implementation process will be combined with the following embodiments. Figure 4 A detailed description will not be repeated here.

[0046] Step 203: Perform logical feature analysis on the query statement to obtain the logical feature value corresponding to the query statement. The logical feature value is used to characterize the complexity of the logical relationship contained in the query statement.

[0047] Logical feature values ​​are values ​​(ranging from 0 to 1) used to characterize the complexity of logical relationships contained in a query statement. Higher values ​​indicate more complex logical relationships.

[0048] After receiving the user's query, logical feature analysis can be performed to obtain the corresponding logical feature values. Specifically, keyword matching can be used to identify whether the query contains analytic verbs (such as "analyze," "compare," "summarize," "predict") and logical connectives (such as "because," "therefore," "and," "or," etc.). The presence of these words significantly increases the logical complexity of the query. The logical feature values ​​can be calculated by the number of analytic verbs and logical connectives. This implementation process will be combined with the following embodiments. Figure 5 A detailed description will not be repeated here.

[0049] Step 204: Perform a weighted summation of the lexical feature values, the syntactic feature values, and the logical feature values ​​to obtain the query difficulty coefficient.

[0050] After obtaining the lexical, syntactic, and logical feature values, these values ​​can be weighted and summed to obtain the query difficulty coefficient. Specifically, the query difficulty coefficient = Q1 * lexical feature value + Q2 * syntactic feature value + Q3 * logical feature value. Here, Q1, Q2, and Q3 are weight coefficients pre-trained and calibrated using a large amount of historical query data, reflecting the contribution of different features to the overall complexity. The query difficulty coefficient is a floating-point number between 0 and 1, and the system maps it to three levels: "low," "medium," and "high" based on a preset threshold.

[0051] This application embodiment quantifies the query statement from three dimensions: lexical relevance, sentence structure complexity, and logical relationship complexity, and calculates the comprehensive difficulty coefficient using a weighted summation method. This objectively and accurately assesses the complexity of the query, providing a scientific basis for selecting the optimal query method based on difficulty, thereby achieving precise and intelligent query processing.

[0052] Next, combined Figure 3 The calculation process for lexical feature values ​​is described in detail.

[0053] Reference Figure 3 The diagram illustrates a flowchart of a method for obtaining lexical feature values ​​provided in an embodiment of this application. Figure 3 As shown, the method for obtaining vocabulary feature values ​​may include steps 301, 302, 303, and 304.

[0054] Step 301: Obtain the target domain to which the query statement belongs.

[0055] In this embodiment, after obtaining the query statement, the target field to which the query statement belongs can be obtained. In practical applications, a hybrid field recognition method of "rule matching + machine learning" can be adopted. Specifically, a field keyword library can be preset (for example, the film and television production field includes "script", "shot", "editing", etc., and the operation field includes "viewing volume", "completion rate", "audience", etc.). And perform a preliminary keyword match on the query statement. If the proportion of matching a certain field keyword exceeds 60%, directly determine that field. For fuzzy queries (mixing multiple field keywords), use a pre-trained field classification model (such as a text classification model based on BERT) for prediction, and output the field with the highest probability.

[0056] Of course, not limited to this. In specific implementations, other methods can also be used to determine the target field to which the query statement belongs, such as manual annotation, etc. This embodiment does not limit this.

[0057] Step 302: Perform word segmentation on the query statement to obtain the segmented text of the query statement.

[0058] Word segmentation processing refers to the process of splitting a complete query statement into independent words according to semantic units.

[0059] After obtaining the query statement input by the user, word segmentation can be performed on the query statement to obtain the segmented text of the query statement. For example, Chinese word segmentation tools (such as Jieba, HanLP) can be used to perform basic word segmentation on the query statement, and the exclusive word segmentation dictionary of the film and television field (including proper nouns such as "montage") identified through step 302 can be loaded to optimize the word segmentation accuracy. At the same time, stop words such as "de", "he" and other words without actual meaning can be removed to obtain the final segmented text. Or, use a word segmentation model such as Word2Vec to perform word segmentation on the query statement to obtain the segmented text, etc.

[0060] Step 303: Match the segmented text with the text in the field word library corresponding to the target field to obtain the target segmented text that matches successfully in the segmented text.

[0061] The field word library refers to a collection of professional vocabulary constructed for a specific target field, including professional terms, proper nouns, common expressions, etc. in that field. For example, taking the film and television field as an example, the film and television field word library can include: names of film and television works, names of actors, names of directors, names of characters, production terms (such as "long shot", "montage"), operation terms (such as "user retention rate", "completion rate"), etc.

[0062] The target segmented text refers to the words in the segmented text that match successfully with the target field word library.

[0063] After obtaining the segmented text of the query statement and the target domain to which the query statement belongs, the segmented text can be matched with the text in the domain thesaurus corresponding to the target domain to obtain the target segmented text that successfully matches the segmented text. Specifically, the domain thesaurus corresponding to the target domain can be loaded into the query system, and an exact matching algorithm can be used to compare each word in the segmented text with the domain thesaurus. During the matching process, all successfully matched words can be recorded to form a set of target segmented text.

[0064] Step 304: Calculate the ratio between the number of target segmented texts and the number of segmented texts, and use this ratio as the vocabulary feature value.

[0065] After obtaining the target segmented text, the number of target segmented texts and the number of segmented texts in the query statement (i.e., the total number of all segmented texts) can be calculated. Then, the ratio between the number of target segmented texts and the total number of segmented texts can be calculated, and this ratio is used as the lexical feature value. That is, lexical feature value = number of domain-specific terms (i.e., the number of target segmented texts) / total number of segmented texts. For example, if the number of target segmented texts is N, and the total number of segmented texts in the query statement is M (where N and M are both positive integers), then the lexical feature value = N / M.

[0066] This application embodiment accurately identifies the domain to which the query belongs and matches it with the corresponding domain thesaurus, which can objectively quantify the degree of relevance between the query content and the professional field, providing a reliable vocabulary dimension basis for subsequent query difficulty assessment, and improving the accuracy of query complexity analysis and domain adaptability.

[0067] Next, combined Figure 4 The process of obtaining syntactic feature values ​​is described in detail.

[0068] according to Figure 4 The diagram illustrates a flowchart of a method for obtaining syntactic feature values ​​according to an embodiment of this application. Figure 4 As shown, the method for obtaining syntactic feature values ​​may include steps 401, 402, and 403.

[0069] Step 401: Perform dependency parsing on the query statement to obtain the syntax tree corresponding to the query statement.

[0070] In this embodiment, dependency parsing is a natural language processing technique used to analyze the grammatical dependencies between words in a sentence and reveal the syntactic structure of the sentence.

[0071] A syntax tree is a tree-like structure generated through dependency parsing, where nodes represent words and edges represent the dependency relationships between words, visually displaying the hierarchical grammatical structure of a sentence.

[0072] After receiving the user's query, dependency parsing can be performed to obtain the corresponding syntax tree. Specifically, NLP (Natural Language Processing) toolkits (such as spaCy and HanLP) can be used to perform dependency parsing on the query. These toolkits identify dependency relationships between words (such as subject-verb, verb-object, and modification relationships) through pre-trained syntactic analysis models and visualize the analysis results in a tree structure, forming a syntax tree.

[0073] Step 402: Analyze the syntax tree to obtain the syntax tree depth, the number of interrogative words, and the types of interrogative words.

[0074] Syntax tree depth refers to the path length from the root node of the syntax tree to the deepest leaf node, reflecting the complexity of the sentence structure.

[0075] Interrogative words are words that express an interrogative tone, such as "what," "why," "how," and "how much."

[0076] Interrogative word type refers to the category based on the complexity of the question expressed by the interrogative word, including simple questions (such as "what" and "who") and complex questions (such as "why" and "how").

[0077] After obtaining the syntax tree of the query statement, the syntax tree can be segmented to obtain the syntax tree depth, the number of interrogative words, and the types of interrogative words.

[0078] The depth of the syntax tree can be calculated as follows: starting from the root node, traverse the entire syntax tree and record the number of nodes along the longest path. The path length is equal to the number of nodes minus 1. For example, if the query is "Why is the viewership rating of TV series 'XX' higher than that of the first one?", the syntax tree depth is: the path from the root node "viewership rating" to the deepest node "first one" is "viewership rating → higher → higher → first one", which has 4 nodes. Therefore, the syntax tree depth is 4 - 1 = 3, and so on.

[0079] Number of interrogative words: 1 interrogative word "why" was identified.

[0080] Question type: "Why" belongs to complex questions, and its type is complex question.

[0081] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.

[0082] Step 403: Perform a weighted summation of the syntactic tree depth, the number of interrogative words, and the type value corresponding to the interrogative word type to obtain the syntactic feature value.

[0083] The type value refers to the quantitative value assigned to different question word types. The type value for simple questions is 0, and the type value for complex questions is 1 (which can be adjusted according to actual needs).

[0084] After obtaining the syntactic tree depth, the number of interrogative words, and the types of interrogative words, we can perform a weighted sum of the syntactic tree depth, the number of interrogative words, and the type values ​​corresponding to the interrogative word types to obtain the syntactic feature value. That is, syntactic feature value = syntactic tree depth × q1 + number of interrogative words × q2 + interrogative word type value (0 for simple queries, 1 for complex queries).

[0085] This application embodiment performs dependency parsing on query statements, extracts and quantifies features such as syntactic tree depth, number and type of interrogative words, and can objectively assess the complexity of sentence structure, providing an important basis for determining the query difficulty coefficient and improving the accuracy and refinement of query complexity analysis.

[0086] Next, combined Figure 5 The process of obtaining logical feature values ​​is described in detail.

[0087] Reference Figure 5 The diagram illustrates a flowchart of a method for obtaining logical feature values ​​according to an embodiment of this application. Figure 5 As shown, the logical feature value acquisition method may include steps 501, 502 and 503.

[0088] Step 501: Perform word segmentation on the query statement to obtain the query segmented text of the query statement.

[0089] In this embodiment, the query segmented text refers to the sequence of words obtained after segmenting the query statement, which is the basic unit of logical feature analysis.

[0090] After receiving the query statement input by the user, the query statement can be segmented into words to obtain the segmented text of the query statement. In this step, the segmentation process for the corresponding query statement is similar to the segmentation process in step 301 above. The specific implementation can be referred to the description of step 301 above, and will not be described in detail here.

[0091] Step 502: Match the segmented query text with the text in the logical dynamic lexicon to obtain the analytical verbs and logical connectives in the segmented query text. The analytical verbs refer to the words in the query statement that embody the query action, and the logical connectives refer to the words in the query statement that connect different information units.

[0092] The logical dynamic lexicon contains two types of professional vocabulary: analytical verbs and logical connectives. The lexicon can be dynamically updated according to business scenarios.

[0093] Analytical verbs are words that express the action of querying. They usually indicate verbs that require thinking activities such as analysis, comparison, and reasoning, such as "analyze", "compare", "summarize", "predict", and "evaluate".

[0094] Logical connectives are words used to connect different information units and express logical relationships, such as "because", "therefore", "and", "or", "but", "if", etc.

[0095] After obtaining the segmented query text, it can be matched with text in a dynamic logical lexicon to obtain the analytical verbs and logical connectives in the segmented query text. Specifically, a dynamic logical lexicon can be pre-loaded into the query system, containing sub-lexicons of analytical verbs such as ["analyze", "compare", "summarize", "predict", "evaluate", "infer", "inductive"] and logical connectives such as ["because", "therefore", "and", "or", "but", "if", "and", "simultaneously"]. Each word in the segmented query text is then precisely matched against the dynamic logical lexicon, and the successfully matched analytical verbs and logical connectives are recorded.

[0096] Step 503: Calculate the sum of the number of analytical verbs and the number of logical connectives, and use this sum as the logical feature value.

[0097] After matching the analytic verbs and logical connectives in the segmented query text, the number of analytic verbs and logical connectives can be counted, and the sum of these two counts can be calculated. This sum can then be used as the logical feature value. For example, if the number of analytic verbs is A and the number of logical connectives is B (both A and B are positive integers), the logical feature value = A + B, etc.

[0098] This application embodiment constructs a logical dynamic lexicon and matches and identifies analytical verbs and logical connectives in query statements. The sum of the two is used as a logical feature value, which can intuitively quantify the logical complexity of query statements. This provides a key basis for comprehensively assessing query difficulty and effectively improves the accuracy of query complexity analysis.

[0099] Next, combined Figure 6 The process of determining the target query method is described in detail.

[0100] Reference Figure 6 The diagram illustrates a flowchart of the steps involved in determining a target query method according to an embodiment of this application. Figure 6As shown, the method for determining the target query method may include steps 601 and 602.

[0101] Step 601: Determine the query complexity corresponding to the query statement based on the query difficulty coefficient and the preset coefficient threshold.

[0102] In this embodiment, the system threshold refers to a pre-set critical value used to classify query complexity levels, including low-medium threshold and medium-high threshold, etc.

[0103] Query complexity refers to the level of query complexity determined by the query difficulty coefficient and coefficient threshold, and is usually divided into three levels: low, medium and high.

[0104] After obtaining the query difficulty coefficient, the query complexity can be determined based on the query difficulty coefficient and a pre-set threshold. For example, the low-to-medium threshold is 0.3, and the medium-to-high threshold is 0.7. By comparing the query difficulty coefficient with the threshold, if the query difficulty coefficient is ≤0.3, it is determined as "low complexity". If 0.3 < query difficulty coefficient ≤0.7, it is determined as "medium complexity". If the query difficulty coefficient >0.7, it is determined as "high complexity", and so on.

[0105] Step 602: Determine the target query method corresponding to the query statement based on the query complexity and the system load information.

[0106] After obtaining the query complexity of the query statement, the target query method can be determined based on the query complexity and system load information. This implementation process will be illustrated in the following embodiments. Figure 7 A detailed description will not be repeated here.

[0107] This application embodiment presets a threshold to convert the query difficulty coefficient into an intuitive complexity level, and dynamically selects the optimal query method in combination with the system's real-time load information, realizing intelligent scheduling of query processing. This not only ensures the processing quality of complex queries, but also improves the processing efficiency of simple queries, effectively balancing query accuracy, response speed, and resource consumption.

[0108] In this embodiment, the query complexity can include any one of a first complexity, a second complexity, and a third complexity, where the first complexity is lower than the second complexity, and the second complexity is lower than the third complexity. That is, the first complexity, the second complexity, and the third complexity represent low, medium, and high levels of complexity, respectively.

[0109] Query methods can include: fast table lookup, intelligent retrieval, and deep analysis, with the query cost and difficulty increasing sequentially from fast table lookup to intelligent retrieval and deep analysis. Fast table lookup is a basic query method with low cost, low resource consumption, and high efficiency, only meeting standardized and simple query needs, and the query results are basic structured information. Intelligent retrieval is an advanced query method with medium cost, medium resource consumption, and medium efficiency, suitable for moderately complex queries requiring similarity retrieval and semantic parsing, and the richness and matching degree of the query results are better than fast table lookup. Deep analysis is a high-cost, high-resource consumption, and low-efficiency advanced query method, capable of splitting complex statements, iteratively searching, and deeply integrating them, meeting highly complex and personalized deep query needs, and offering the best completeness and accuracy of the query results among the three.

[0110] Next, combined Figure 7 The implementation process of determining the target query method by combining query complexity and system load is described in detail.

[0111] Reference Figure 7 The diagram illustrates a flowchart of another target query method for determining the target query method provided in an embodiment of this application. Figure 7 As shown, the method for determining the target query method may include steps 701, 702, 703, 704, 705, and 706.

[0112] Step 701: When the query complexity is the first complexity, determine that the target query method is the fast table lookup method. The fast table lookup method refers to the method of converting the query statement into a structured query statement through a query statement template and querying information from the database.

[0113] In this embodiment, the fast table lookup method is suitable for simple queries. It directly accesses the database to obtain results using a structured query language. That is, it converts the query statement into a structured query statement using a query statement template and then retrieves information from the database.

[0114] When the query complexity of the query statement is of the first complexity, the target query method can be determined to be the fast table lookup method. That is, when the query statement is of low complexity, there is no need to consider the system load, and the fast table lookup method can be used directly to query information.

[0115] Step 702: When the query complexity is the second complexity and the system load information indicates that the current load of the query system is greater than or equal to the first load threshold, the target query method is determined to be the fast table lookup method.

[0116] If the query complexity is second-order, and the system load information indicates that the current load of the querying system is greater than or equal to the first load threshold, then the target query method for the query statement can be determined as the fast table lookup method. That is, when the query statement is of medium load, and the current system load is high, the fast table lookup method can be used to retrieve information.

[0117] Step 703: When the query complexity is the second complexity and the system load information indicates that the current load of the query system is less than the first load threshold, the target query method is determined to be an intelligent retrieval method. The intelligent retrieval method refers to the method of using a large language model to process the similarity retrieval results corresponding to the query statement and the query statement to generate query results. The similarity retrieval results refer to the results obtained by retrieving the query vector corresponding to the query statement in the vector database.

[0118] The first load threshold is a critical value used to determine the system load status, such as setting it to 80% GPU utilization, and is used to determine the best query method for the second complexity query.

[0119] Intelligent retrieval refers to a method that uses a large language model to process the similarity search results and the query statement to generate query results.

[0120] Similarity search results refer to the results obtained by searching a vector database using the query vector corresponding to the query statement.

[0121] After obtaining the query complexity, if the query complexity is determined to be second-order complexity, and the system load information indicates that the current load of the querying system is below the first load threshold, then the target query method can be determined to be the intelligent retrieval method. That is, when the query statement has a medium load and the current system load is low, the intelligent retrieval method can be directly used for information retrieval.

[0122] Step 704: When the query complexity is the third complexity and the system load information indicates that the current load of the query system is greater than or equal to the second load threshold and less than the third load threshold, the target query method is determined to be the intelligent retrieval method.

[0123] The third load threshold refers to the critical value used for decision-making regarding high-complexity query methods, such as setting it to 90% GPU utilization and 90% CPU utilization.

[0124] If the query complexity is third-degree, and the system load information indicates that the current load of the query system is greater than or equal to the second load threshold but less than the third load threshold, then the target query method can be determined as the intelligent retrieval method. That is, when the query is high-complexity and the current load of the query system is relatively high, a downgraded query can be performed, i.e., using the intelligent retrieval method for information retrieval.

[0125] Step 705: When the query complexity is the third complexity and the system load information indicates that the current load of the query system is less than the second load threshold, the target query method is determined to be the deep analysis method. The deep analysis method refers to the method of splitting the query statement into multiple sub-query statements, iteratively retrieving them, and then processing the retrieval results by a large language model to convert them into a structured query statement to obtain the query result.

[0126] The second load threshold refers to a critical value used for decision-making regarding high-complexity query methods, such as setting it to 70% GPU utilization.

[0127] Deep analysis refers to the method of breaking down a query statement into multiple subqueries, iteratively retrieving them, and then using a large language model to process the retrieval results and transform them into a structured query statement to obtain the query results.

[0128] If the query complexity is third-order, and the system load information indicates that the current load of the querying system is less than the second load threshold, then the target query method for the query statement can be determined to be deep analysis. That is, when the query statement is high-complexity and the current system load is low, deep analysis is used for information retrieval.

[0129] Step 706: If the query complexity is the third complexity and the system load information indicates that the current load of the query system is greater than or equal to the third load threshold, determine that the target query method is the query rejection method.

[0130] If the query complexity is third-order, and the system load information indicates that the current load of the querying system is greater than or equal to the third load threshold, then the target query method can be determined as query rejection. That is, if the query is high-complexity and the current system load is too high, the query will be rejected.

[0131] During this process, if the query is highly complex and the system load is currently too high, the query can be queued for a preset time (e.g., 3 minutes, 10 minutes, etc.). If the system load decreases after the preset time, falling between the first and second load thresholds, then intelligent retrieval will be used for information retrieval. If the load falls below the first load threshold, then deep analysis will be used for information retrieval. If the system load remains too high, the query will be rejected.

[0132] This application embodiment establishes a multi-level decision-making mechanism based on query complexity and system load, which realizes intelligent adaptation and dynamic degradation of query processing methods. While ensuring system stability, it maximizes the use of computing resources, balances query response speed, result quality and resource consumption, and significantly improves the system's adaptability and user experience under different load scenarios.

[0133] Next, combined Figure 8 The process of information retrieval using the fast table lookup method is described in detail.

[0134] Reference Figure 8 The diagram illustrates a flowchart of an information query method provided in an embodiment of this application. Figure 8 As shown, the information query method may include steps 801, 802 and 803.

[0135] Step 801: When the target query method is the fast table lookup method, extract the target entity information from the query statement.

[0136] In this embodiment, target entity information refers to the key entities extracted from the query statement, which are the core elements for constructing structured queries, such as work names, personal names, attribute words, etc.

[0137] If the target query method is a fast table lookup method, then the target entity information can be extracted from the query statement.

[0138] In practical implementation, fast table lookup methods primarily rely on the company's relational databases (such as MySQL), data warehouses (such as Hive / Doris), and search engines (such as Elasticsearch). For the query statement, a named entity recognition model can be used to process the query and identify the entities within it. Entity types can include: work titles, person names, attribute words (such as director, viewership ratings, etc.), and by combining contextual semantics, non-critical entities can be filtered out to determine the target entity information.

[0139] Step 802: Fill the target entity information into the pre-built query template to generate a structured query statement.

[0140] A query template is a pre-built, structured query statement template that includes a fixed format and placeholders for entities to be filled. In this example, the query template may include an SQL query template or a DSL (Domain-Specific Language) query template, etc.

[0141] After obtaining the target entity information, it can be populated into a pre-built query template to generate a structured query statement. Specifically, the corresponding query template can be matched according to the type of the target entity information. An example query template is "SELECT [attribute] FROM [table name] WHERE work name='[work name]'". The extracted target entity information is then used to replace the placeholders in the template to generate a structured query statement that conforms to database syntax.

[0142] Step 803: Perform information query based on the structured query statement to obtain the query information corresponding to the query statement.

[0143] After obtaining the structured query statement, information can be retrieved based on it to obtain the corresponding query information. Specifically, a connection can be established with the database, and the structured query statement can be executed to obtain the query results returned by the database. Then, the query results can be formatted and converted into natural language or a user-friendly format to obtain the final query information.

[0144] This application embodiment generates structured query statements by extracting target entity information and filling in a preset query template. This enables quick retrieval of query results from the database, significantly improving the response speed of simple queries while ensuring the accuracy of the query results and effectively reducing system resource consumption.

[0145] Next, combined Figure 9 The process of using intelligent retrieval methods for information retrieval is described in detail.

[0146] Reference Figure 9 The diagram illustrates a flowchart of another information query method provided in an embodiment of this application. Figure 9 As shown, the information query method may include steps 901, 902, 903 and 904.

[0147] Step 901: If the target query method is intelligent retrieval, convert the query statement into a query vector.

[0148] In this embodiment, the query vector refers to a high-dimensional numerical vector obtained by transforming the query statement through an embedding model, which is used for similarity matching in the vector database.

[0149] When the target query method is intelligent retrieval, the query statement can be converted into a query vector. Specifically, the query statement can be input into a pre-trained text embedding model to output a fixed-dimensional vector representation (such as 768-dimensional vectors), and the output vector can be normalized to obtain the query vector for subsequent similarity calculation.

[0150] Step 902: Use the query vector to search in the vector database to obtain the retrieval information of the query vector.

[0151] Vector databases are databases specifically designed for storing and retrieving vector data, supporting efficient similarity searches (such as cosine similarity calculation).

[0152] Retrieval information refers to the original text information (such as document fragments, content summaries, etc.) corresponding to vectors that are similar to the query vector and are retrieved from a vector database.

[0153] After obtaining the query vector, it can be used to search in a vector database to obtain the retrieval information. Specifically, you can first connect to a vector database (such as Milvus or FAISS), which stores vector data of film and television content (such as episode synopsis, style tags, etc.). Then, you can calculate the cosine similarity between the query vector and the vectors in the database, sort them in descending order of similarity, and take the original text information corresponding to the top N (N is a positive integer) results as the retrieval information.

[0154] Step 903: Package the search information and the query statement to generate structured prompt information.

[0155] Structured prompts refer to input text formed by combining query statements and retrieval information according to a preset format, which is used to guide large language models to generate target results.

[0156] After obtaining the search information, it can be packaged with the query statement to generate structured prompts. Specifically, a preset prompt template can be loaded, and the query statement and search information can be filled and combined according to the template format. For excessively long search information, it can be truncated or summarized to ensure that it meets the model input length limit, so as to obtain structured prompts.

[0157] Step 904: Process the structured prompt information based on the large language model to obtain the query information corresponding to the query statement.

[0158] Large language models refer to pre-trained language models (such as lightweight LLMs) that have the ability to understand and generate natural language, and are used to generate answers based on retrieval information and query requirements.

[0159] After obtaining the structured prompts, the prompts can be processed based on a large language model to obtain the query information corresponding to the query statement. Specifically, the large language model pre-loaded in the query system can be used to understand and generate responses based on the prompts, outputting a satisfactory answer. Post-processing of the model output (removing redundant content, formatting the display, etc.) can then be performed to obtain the final query information.

[0160] This application embodiment obtains relevant information through vector retrieval and generates answers by combining it with a large language model. It utilizes the efficient retrieval capabilities of the vector database and leverages the understanding and generation advantages of the language model. While ensuring the efficiency of medium-complexity query processing, it improves the relevance of the results and the quality of natural language expression, achieving a balance between efficiency and effectiveness.

[0161] Next, combined Figure 10 The process of information retrieval using in-depth analysis methods is described in detail.

[0162] Reference Figure 10 The diagram illustrates a flowchart of another information query method provided in an embodiment of this application. Figure 10 As shown, the information query method may include steps 1001, 1002 and 1003.

[0163] Step 1001: When the target query method is a deep analysis method, the query statement is transformed according to the identified query intent of the query statement to obtain at least one sub-query statement corresponding to the query statement, and the dependency relationship between the at least one sub-query statement.

[0164] In this embodiment, query intent refers to the core needs of the user when entering a query statement, such as "analyze market potential" or "compare data differences", which need to be identified through semantic understanding.

[0165] A subquery is a simple query that is obtained by breaking down the original query according to the query intent. It can be executed independently and is the basic unit for implementing complex queries.

[0166] Dependency refers to the logical relationship between subqueries (such as "the result of subquery A is the retrieval condition of subquery B" or "the results of subquery C and subquery D need to be merged for analysis").

[0167] When the target query method is deep analysis, the intent of the user's input query can be identified. Based on the identified query intent, the query can be broken down to obtain at least one subquery and the dependencies between at least one subquery. Specifically, a pre-trained "query intent recognition model" (based on BERT and other architectures optimized for film and television business scenarios) can be pre-loaded into the query system. The original query is input, and the core intent is identified (e.g., "analyze the market potential of a script and output audience profile"). Then, the original query can be broken down into independent subqueries according to the intent: first, the basic information required to complete the core intent is identified (e.g., market potential requires "historical box office of similar scripts" and "target user scale"; audience profile requires "age distribution" and "regional preferences"). Then, each basic information requirement is converted into a subquery. The dependencies between subqueries are analyzed using a logical relationship recognition algorithm: if subquery B requires the result of subquery A as a retrieval condition (e.g., "subquery A: get a list of similar scripts; subquery B: query the historical box office of scripts in the list"), it is marked as a dependency relationship "A→B". If the results of subqueries C and D need to be merged (e.g., "C: audience age distribution; D: audience regional preference"), then mark them as parallel relationships such as "C∩D".

[0168] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.

[0169] Step 1002: Based on the dependency relationship, process the retrieval information obtained by using the at least one subquery statement to generate structured information.

[0170] After obtaining at least one subquery statement and the dependencies between them, information retrieval can be performed using at least one subquery statement to retrieve information associated with it, i.e., retrieved information. Then, based on the dependencies between the at least one subquery statement, the retrieved information is processed to obtain structured information. Specifically, at least one subquery statement can be used to perform information retrieval in both a vector database and a structured database, and then the retrieved information is integrated and processed according to the dependencies to obtain structured information. This implementation process will be discussed in the following embodiments. Figure 12 A detailed description will not be repeated here.

[0171] Step 1003: Process the structured information based on the large language model to obtain the query information corresponding to the query statement.

[0172] After obtaining the structured information, a large language model can be used to process it and obtain the query information corresponding to the query statement. Specifically, the structured information can be input into the large language model, and generation parameters can be set (temperature 0.3 to ensure rigorous analysis; maximum length 1024 to cover complete logic) to guide the model to generate results according to the logic of "analysis → reasoning → conclusion" (such as first comparing the differences between "X" and similar scripts, then inferring market potential, and finally summarizing audience characteristics).

[0173] Simultaneously, the model output can be post-processed (removing redundant reasoning processes and formatting point-by-point displays) to obtain the final query information.

[0174] This application's embodiments utilize query intent decomposition, multi-source retrieval integration, and deep reasoning with a large language model. This deep analysis approach accurately covers the core needs of highly complex queries. By improving the rigor of the analysis through logical decomposition and dependency management, it ultimately provides users with high-quality, in-depth query results, effectively supporting the professional needs of video platforms in areas such as internal creative decision-making and market analysis.

[0175] Next, combined Figure 12 The process of generating structured information is described in detail.

[0176] Reference Figure 12 The diagram illustrates a flowchart of the steps involved in a structured information generation method provided in an embodiment of this application. Figure 12 As shown, the structured information generation method may include steps 1201, 1202, 1203 and 1204.

[0177] Step 1201: Use the at least one subquery statement to perform a retrieval in the structured database to obtain the first retrieval information of the at least one subquery statement.

[0178] In this embodiment, the first retrieval information refers to the structured data (such as tables and field values) retrieved by the subquery statement from a structured database (such as MySQL or Hive).

[0179] After obtaining at least one subquery statement, it can be used to retrieve information from a structured database, yielding the first retrieval information for that subquery statement. Specifically, subqueries can be executed in dependency order (first executing subqueries without dependencies, then executing subqueries that depend on their results). For each subquery, the "Text-to-SQL module" is invoked: first, the target entity in the subquery is extracted (e.g., "suspense + workplace" theme in subquery 1), then a preset SQL template is matched (e.g., "SELECT script name FROM script library WHERE theme=?"), generating a structured query statement. A connection is established with a structured database (e.g., MySQL / Hive storing basic script information and box office data), the SQL statement is executed, and structured results (e.g., tables, key-value pairs) are obtained, serving as the first retrieval information and associated with the corresponding subquery.

[0180] Step 1202: Use the at least one subquery statement to perform a retrieval in the vector database to obtain the second retrieval information of the at least one subquery statement.

[0181] The second type of retrieval information refers to the unstructured information (such as document fragments and comment summaries) retrieved by the subquery from vector databases (such as Milvus and FAISS).

[0182] After obtaining at least one subquery, a retrieval can be performed in the vector database using at least one subquery to obtain the second retrieval information for that subquery. Specifically, for each subquery, a text embedding model (such as Sentence-BERT optimized for the film and television industry) can be invoked to convert the subquery into a high-dimensional query vector (e.g., 768-dimensional). This vector vector is then connected to the vector database, and the cosine similarity between the query vector and the vectors in the database is calculated. The top N results are sorted by similarity, and the corresponding original text information (such as comment excerpts or report summaries) is extracted as the second retrieval information and associated with the corresponding subquery.

[0183] Step 1203: Based on the dependency relationship, integrate the first search information and the second search information to generate target search information.

[0184] The target retrieval information refers to the complete information set formed by integrating the first retrieval information and the second retrieval information according to the subquery dependency relationship, which must cover the core needs of the original query.

[0185] After obtaining the first and second search information, they can be integrated based on dependencies to generate the target search information. Specifically, integration can be layered according to dependencies: first, integrate information with dependencies (e.g., linking first search information 1 with 2 and 3 to clarify "box office and age data corresponding to similar script lists"), then merge information with parallel relationships (e.g., merging first search information 3 with second search information 4 into "audience profile information"), etc. Finally, the integrated information can be deduplicated (e.g., duplicate box office data) and supplemented (e.g., supplementing missing regional proportions with similar script data) to form target search information covering all core needs of the original query.

[0186] Step 1204: When the target retrieval information meets the query requirements of the query statement, the target retrieval information is filled into a pre-built structured prompt template to generate structured information. The query requirements refer to the criteria for determining whether the target search information is sufficient to answer the original query (such as "includes market size data + user preference analysis" or "covers key indicators of both sides").

[0187] Structured prompt templates are pre-designed templates used to standardize the format of target retrieval information, making it easier for large language models to accurately understand and generate results.

[0188] Structured information refers to text that meets the input requirements of a large language model after the target retrieval information is filled into a structured prompt template.

[0189] After obtaining the target retrieval information, it can be determined whether the target retrieval information meets the query requirements of the query statement, that is, whether the target retrieval information is sufficient to answer the user's question. If not, a new query statement is output and the retrieval is performed again until it is determined that it can answer the question or the maximum number of iterations is reached.

[0190] If the target retrieval information meets the query requirements of the query statement, the target retrieval information will be filled into the pre-built structured prompt template to generate structured information.

[0191] This application embodiment performs parallel retrieval of the split subquery statement using a structured database and a vector database. It relies on the structured database to ensure the accuracy and structured features of the first retrieval information, and uses the vector database to achieve semantic relevance and similarity matching of the second retrieval information. It fully integrates the retrieval advantages of different types of databases, ensuring that the generated structured information can accurately and compliantly match the core requirements of the original query statement.

[0192] Next, combined Figure 12 The system modules shown provide a complete description of the information query process described above. (Refer to...) Figure 12 The diagram illustrates a content retrieval process for adaptive routing provided in an embodiment of this application.

[0193] like Figure 12 As shown, this application provides an adaptive query processing system. Its core idea is to achieve intelligent traffic routing and scheduling when processing query requests from users or internal employees. The system comprises three closely cooperating core modules: a query difficulty analyzer, an intelligent path selector, and a multi-path processing engine. First, the query difficulty analyzer performs rapid lexical, grammatical, and logical analysis on the input natural language query to quantify its complexity. Then, the intelligent path selector selects one of three preset processing paths based on the difficulty score provided by the analyzer and the real-time monitored system load. Finally, the multi-path processing engine executes the query by calling the corresponding processing method according to the selector's instructions: if the "fast table lookup method" is selected, the answer is directly accessed from the structured database; if the "intelligent retrieval method" is selected, a simple vector retrieval is performed to obtain the data, which is then fed into a lightweight language model for analysis; if the "deep analysis method" is selected, a deep content retrieval is performed first, followed by complex semantic reasoning using a larger language model. Through this mechanism, an intelligent query system that automatically balances processing depth, response speed, and computational cost can be achieved, ensuring that every computational resource is used effectively.

[0194] Module 1: Query Difficulty Analyzer. This module can receive user query input (natural language problem) and transform an abstract, qualitative natural language problem into a calculable and comparable quantitative value (i.e., calculate the query difficulty coefficient based on lexical feature values, syntactic feature values, and logical feature values) through multi-dimensional linguistic feature extraction. The module then determines the query complexity of the query statement based on the query difficulty coefficient and a set threshold.

[0195] Module 2: Intelligent Path Selector. Based on the real-time system load and query complexity monitored by the system load monitoring system, it determines which processing path a query request should take. Its principle is rule-based real-time decision-making to optimize the allocation of system resources. Implementation method: 1. Information input: Query complexity received from Module 1; 2. Real-time system load received from a parallel system resource monitoring service.

[0196] System load monitoring can be a lightweight background process that collects key performance indicators (KPIs) at a fixed frequency (e.g., every 2 seconds) through the standard interface of the operating system or dedicated tools (such as the nvidia-smi command-line tool to query GPU status), forming a vector containing information such as CPU utilization, memory usage, GPU utilization, and GPU memory usage.

[0197] At the core of the intelligent route selector is a decision table, or a simple state machine. This decision table is pre-configured by the system administrator and defines the route selection under different conditions. A simplified example of the decision table is shown in Table 1 below: Table 1 Decision Path

[0198] As shown in Table 1 above, it presents the rules for determining the query processing decision path based on query complexity level, GPU load, and other conditions (mainly CPU load).

[0199] 1. When the query complexity level is "low", the decision path is "fast table lookup method" regardless of GPU load and other conditions.

[0200] 2. If the complexity level is "Medium": If the GPU load is less than 80%, the "intelligent search method" is used.

[0201] If the GPU load is greater than or equal to 80%, then the "fast lookup table method" is used.

[0202] 2. Complexity level is "High": When the GPU load is less than 80%, use the "deep analysis method".

[0203] When the GPU load is greater than or equal to 80%, if the CPU load is less than 90%, the "intelligent retrieval method" is used; if the CPU load is greater than or equal to 90%, the "queue or reject" method is used.

[0204] Module 3: Multi-path Processing Engine. This module is the system's execution unit, integrating three processing pipelines with varying capabilities and costs. It executes instructions from Module 2, invoking the specified pipeline to process the query.

[0205] This application's embodiments differentiate query requests at the source, providing a decision-making basis for subsequent intelligent scheduling. It transforms fuzzy natural language problems into quantifiable difficulty scores, enabling automated and refined resource allocation—the cornerstone of the entire adaptive system. A dynamic path selection strategy combining "query difficulty" and "system load" dual indicators achieves a leap from "static rules" to "dynamic adaptation." System decisions are no longer rigid but can be flexibly adjusted based on real-time conditions (e.g., GPU overload due to midday rendering tasks). This ensures system stability and robustness under different loads, maximizing throughput for simple tasks while maintaining performance for complex tasks. Simultaneously, through three processing paths with different resource consumption levels—fast table lookup, intelligent retrieval, and deep analysis—precise matching of query complexity and computing resources is achieved. Simple queries retrieve results directly from the database, medium queries use lightweight models for inference, and complex queries call ultra-large models for deep analysis. Compared to traditional single-processing modes, this architecture reduces overall resource consumption while ensuring processing quality for queries of varying complexity.

[0206] Reference Figure 13 The diagram shows a structural schematic of an information query device provided in an embodiment of this application. Figure 13 As shown, the information query device 1300 may include the following modules: The query statement acquisition module 1310 is used to acquire the query statement input by the user; The difficulty coefficient acquisition module 1320 is used to analyze the query statement and obtain the query difficulty coefficient of the query statement; the query difficulty coefficient is used to characterize the difficulty of obtaining the query result corresponding to the query statement; The system load acquisition module 1330 is used to acquire the system load information of the query system at the current moment, wherein the query system refers to the system used to perform information query tasks. The target query method determination module 1340 is used to determine the target query method corresponding to the query statement based on the query difficulty coefficient and the system load information; the target query method is used to characterize that the query cost and query difficulty of the query statement are directly proportional to the query difficulty coefficient and inversely proportional to the system load information; The information query module 1350 is used to perform information query processing on the query statement based on the target query method.

[0207] Optionally, the difficulty coefficient acquisition module includes: The vocabulary feature value acquisition unit is used to perform vocabulary feature analysis on the segmented text of the query statement to obtain the vocabulary feature value corresponding to the query statement. The vocabulary feature value is a value used to reflect the degree of correlation between the query content and the target domain, where the target domain refers to the domain to which the query statement belongs. The syntactic feature value acquisition unit is used to perform syntactic analysis on the query statement to obtain the syntactic feature value corresponding to the query statement. The syntactic feature value is used to measure the sentence structure complexity of the query statement. A logical feature value acquisition unit is used to perform logical feature analysis on the query statement to obtain the logical feature value corresponding to the query statement. The logical feature value is a value used to characterize the complexity of the logical relationship contained in the query statement. The difficulty coefficient acquisition unit is used to perform weighted summation on the lexical feature values, the syntactic feature values, and the logical feature values ​​to obtain the query difficulty coefficient.

[0208] Optionally, the vocabulary feature value acquisition unit includes: The target domain acquisition subunit is used to acquire the target domain to which the query statement belongs; The word segmentation text acquisition subunit is used to perform word segmentation processing on the query statement to obtain the word segmentation text of the query statement; The target word segmentation acquisition subunit is used to match the segmented text with the text in the domain lexicon corresponding to the target domain to obtain the target word segmented text that has been successfully matched in the segmented text; The lexical feature value acquisition subunit is used to calculate the ratio between the number of target segmented texts and the number of segmented texts, and use this ratio as the lexical feature value.

[0209] Optionally, the syntactic feature value acquisition unit includes: The syntax tree acquisition sub-unit is used to perform dependency parsing on the query statement to obtain the syntax tree corresponding to the query statement; The interrogative word acquisition subunit is used to analyze the syntax tree to obtain the syntax tree depth, the number of interrogative words, and the interrogative word type; The syntactic feature value acquisition subunit is used to perform a weighted summation of the syntactic tree depth, the number of interrogative words, and the type value corresponding to the interrogative word type to obtain the syntactic feature value.

[0210] Optionally, the logical feature value acquisition unit includes: The query segmentation acquisition subunit is used to perform segmentation processing on the query statement to obtain the query segmented text of the query statement; The related word acquisition subunit is used to match the query segmented text with the text in the logical dynamic lexicon to obtain the analytical verbs and logical related words in the query segmented text. The analytical verbs refer to the words in the query statement that reflect the query action, and the logical related words refer to the words in the query statement that are used to connect different information units. The logical feature value acquisition subunit is used to calculate the sum of the number of analytical verbs and the number of logical connectives, and use this sum as the logical feature value.

[0211] Optionally, the target method determination module includes: The complexity determination unit is used to determine the query complexity corresponding to the query statement based on the query difficulty coefficient and a pre-set coefficient threshold. The target method determination unit is used to determine the target query method corresponding to the query statement based on the query complexity and the system load information.

[0212] Optionally, the query complexity includes any one of a first complexity, a second complexity, and a third complexity, wherein the first complexity is lower than the second complexity, and the second complexity is lower than the third complexity; The query methods include: fast table lookup, intelligent retrieval, and deep analysis, wherein the query processing complexity increases sequentially from fast table lookup to intelligent retrieval to deep analysis.

[0213] Optionally, the target mode determination unit includes: The first determining subunit is used to determine the target query method as the fast table lookup method when the query complexity is the first complexity. The fast table lookup method refers to the method of converting the query statement into a structured query statement through a query statement template and querying information from the database. The second determining subunit is used to determine that the target query method is a fast table lookup method when the query complexity is the second complexity and the system load information indicates that the current load of the query system is greater than or equal to the first load threshold.

[0214] Optionally, the target mode determination unit includes: The third determining subunit is used to determine the target query method as an intelligent retrieval method when the query complexity is the second complexity and the system load information indicates that the current load of the query system is less than the first load threshold. The intelligent retrieval method refers to the method of using a large language model to process the similarity retrieval results corresponding to the query statement and the query statement to generate query results. The similarity retrieval results refer to the results obtained by searching the vector database through the query vector corresponding to the query statement. The fourth determining subunit is used to determine that the target query method is the intelligent retrieval method when the query complexity is the third complexity and the system load information indicates that the current load of the query system is greater than or equal to the second load threshold and less than the third load threshold.

[0215] Optionally, the target mode determination unit includes: The fifth determining subunit is used to determine the target query method as a deep analysis method when the query complexity is the third complexity and the system load information indicates that the current load of the query system is less than the second load threshold. The deep analysis method refers to the method of splitting the query statement into multiple sub-query statements, iteratively retrieving them, and then processing the structured query statement by a large language model to obtain the query result. The structured query statement is the query statement obtained by transforming the result obtained by iterative retrieval. The sixth determining subunit is used to determine that the target query method is a query rejection method when the query complexity is the third complexity and the system load information indicates that the current load of the query system is greater than or equal to the third load threshold.

[0216] Optionally, the information query module includes: The target entity extraction unit is used to extract target entity information from the query statement when the target query method is a fast table lookup method; The query statement generation unit is used to fill the target entity information into a pre-built query template to generate a structured query statement; The first information acquisition unit is used to perform information query based on the structured query statement to obtain the query information corresponding to the query statement.

[0217] Optionally, the information query module includes: The query statement conversion unit is used to convert the query statement into a query vector when the target query method is intelligent retrieval. The information retrieval unit is used to perform a retrieval in the vector database using the query vector to obtain the retrieval information of the query vector; The prompt information generation unit is used to package the search information and the query statement to generate structured prompt information; The second information acquisition unit is used to process the structured prompt information based on a large language model to obtain the query information corresponding to the query statement.

[0218] Optionally, the information query module includes: The sub-statement acquisition unit is used to, when the target query method is a deep analysis method, transform the query statement according to the identified query intent of the query statement to obtain at least one sub-query statement corresponding to the query statement, and the dependency relationship between the at least one sub-query statement; A structured information generation unit is used to process the retrieval information obtained by using the at least one subquery statement according to the dependency relationship, and generate structured information. The third information acquisition unit is used to process the structured information based on a large language model to obtain the query results corresponding to the query statement.

[0219] Optionally, the structured information generation unit includes: The first retrieval information acquisition subunit is used to perform a retrieval in the structured database using the at least one subquery statement to obtain the first retrieval information of the at least one subquery statement; The second retrieval information acquisition subunit is used to perform a retrieval in the vector database using the at least one subquery statement to obtain the second retrieval information of the at least one subquery statement. The target retrieval information generation subunit is used to integrate the first retrieval information and the second retrieval information according to the dependency relationship to generate target retrieval information; The structured information generation subunit is used to fill the target retrieval information into a pre-built structured prompt template to generate structured information when the target retrieval information meets the query requirements of the query statement.

[0220] This application's embodiments analyze the difficulty of user-input queries and, based on the analyzed query difficulty coefficient and current system load, determine the appropriate query method to retrieve information from the query. In this process, query difficulty analysis enables differentiated query processing, avoiding the consumption of GPU and other computing resources, reducing the ineffective use of high-cost computing resources, and achieving on-demand resource allocation. By dynamically adjusting the processing path based on system load information, the overall system throughput can be maximized while ensuring the quality of critical and complex query processing, achieving optimal resource allocation and reaching the best balance between query efficiency, cost, and accuracy.

[0221] This application also provides an electronic device, such as... Figure 14 As shown, it includes a processor 1401, a communication interface 1402, a memory 1403, and a communication bus 1404. The processor 1401, the communication interface 1402, and the memory 1403 communicate with each other through the communication bus 1404. Memory 1403 is used to store computer programs; When processor 1401 executes a program stored in memory 1403, it performs the following steps: Get the query statement entered by the user; The query statement is analyzed to obtain the query difficulty coefficient; the query difficulty coefficient is used to characterize the difficulty of obtaining the query result corresponding to the query statement. Obtain the system load information of the query system at the current moment, where the query system refers to the system used to perform information query tasks; Based on the query difficulty coefficient and the system load information, the target query method corresponding to the query statement is determined; the target query method is used to characterize the query cost and query difficulty of the query statement that are directly proportional to the query difficulty coefficient and inversely proportional to the system load information. The query statement is processed based on the target query method.

[0222] The communication bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0223] The communication interface is used for communication between the aforementioned terminal and other devices.

[0224] The memory may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0225] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0226] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores instructions that, when executed on a computer, cause the computer to perform any of the information query methods described in the above embodiments.

[0227] In another embodiment provided in this application, a computer program product containing instructions is also provided, on which a computer program is stored, which, when run on a computer, causes the computer to execute any of the information query methods described above.

[0228] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0229] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0230] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0231] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. An information retrieval method, characterized in that, include: Get the query statement entered by the user; The query statement is analyzed to obtain the query difficulty coefficient. The query difficulty coefficient is used to characterize the difficulty of obtaining the query results corresponding to the query statement; Obtain the system load information of the query system at the current moment, where the query system refers to the system used to perform information query tasks; Based on the query difficulty coefficient and the system load information, determine the target query method corresponding to the query statement; The target query method is used to characterize that the query cost and query difficulty of the query statement are directly proportional to the query difficulty coefficient and inversely proportional to the system load information; The query statement is processed based on the target query method.

2. The method according to claim 1, characterized in that, The analysis of the query statement to obtain the query difficulty coefficient includes: Lexical feature analysis is performed on the segmented text of the query statement to obtain the lexical feature value corresponding to the query statement. The lexical feature value is used to reflect the degree of correlation between the query content and the target domain, where the target domain refers to the domain to which the query statement belongs. The query statement is syntactically analyzed to obtain the syntactic feature value corresponding to the query statement. The syntactic feature value is used to measure the sentence structure complexity of the query statement. Logical feature analysis is performed on the query statement to obtain the logical feature value corresponding to the query statement. The logical feature value is used to characterize the complexity of the logical relationship contained in the query statement. The query difficulty coefficient is obtained by performing a weighted summation of the lexical feature values, the syntactic feature values, and the logical feature values.

3. The method according to claim 2, characterized in that, The step of performing word segmentation and text analysis on the query statement to obtain the lexical feature values ​​corresponding to the query statement includes: Obtain the target domain to which the query statement belongs; The query statement is segmented into words to obtain the segmented text of the query statement; The segmented text is matched with the text in the domain thesaurus corresponding to the target domain to obtain the target segmented text that has been successfully matched in the segmented text; The ratio between the number of target segmented texts and the number of segmented texts is calculated, and this ratio is used as the lexical feature value.

4. The method according to claim 2, characterized in that, The step of performing syntactic analysis on the query statement to obtain the syntactic feature values ​​corresponding to the query statement includes: Dependency parsing is performed on the query statement to obtain the syntax tree corresponding to the query statement; The syntax tree is analyzed to obtain its depth, the number of interrogative words, and the types of interrogative words. The syntactic feature value is obtained by weighted summing of the syntactic tree depth, the number of interrogative words, and the type value corresponding to the interrogative word type.

5. The method according to claim 2, characterized in that, The step of performing logical feature analysis on the query statement to obtain the logical feature value corresponding to the query statement includes: The query statement is segmented into words to obtain the segmented text of the query statement. The query segmented text is matched with the text in the logical dynamic lexicon to obtain the analytical verbs and logical connectives in the query segmented text. The analytical verbs refer to the words in the query statement that embody the query action, and the logical connectives refer to the words in the query statement used to connect different information units. The sum of the number of analytical verbs and the number of logical connectives is calculated and used as the logical feature value.

6. The method according to claim 1, characterized in that, The step of determining the target query method corresponding to the query statement based on the query difficulty coefficient and the system load information includes: The query complexity of the query statement is determined based on the query difficulty coefficient and the pre-set coefficient threshold. Based on the query complexity and the system load information, the target query method corresponding to the query statement is determined.

7. The method according to claim 6, characterized in that, The query complexity includes any one of a first complexity, a second complexity, and a third complexity, wherein the first complexity is lower than the second complexity, and the second complexity is lower than the third complexity; The query methods include: fast table lookup, intelligent retrieval, and deep analysis. The query cost and query difficulty increase sequentially from fast table lookup to intelligent retrieval to deep analysis.

8. The method according to claim 7, characterized in that, The step of determining the target query method corresponding to the query statement based on the query complexity and the system load information includes: When the query complexity is the first complexity, the target query method is determined to be the fast table lookup method, which refers to the method of converting the query statement into a structured query statement through a query statement template and then querying information from the database. If the query complexity is the second complexity and the system load information indicates that the current load of the query system is greater than or equal to the first load threshold, then the target query method is determined to be the fast table lookup method.

9. The method according to claim 7, characterized in that, The step of determining the target query method corresponding to the query statement based on the query complexity and the system load information includes: When the query complexity is the second complexity and the system load information indicates that the current load of the query system is less than the first load threshold, the target query method is determined to be an intelligent retrieval method. The intelligent retrieval method refers to the method of using a large language model to process the similarity retrieval results corresponding to the query statement and the query statement to generate query results. The similarity retrieval results refer to the results obtained by searching the vector database through the query vector corresponding to the query statement. If the query complexity is the third complexity, and the system load information indicates that the current load of the query system is greater than or equal to the second load threshold and less than the third load threshold, then the target query method is determined to be the intelligent retrieval method.

10. The method according to claim 7, characterized in that, The step of determining the target query method corresponding to the query statement based on the query complexity and the system load information includes: When the query complexity is the third complexity and the system load information indicates that the current load of the query system is less than the second load threshold, the target query method is determined to be the deep analysis method. The deep analysis method refers to splitting the query statement into multiple sub-query statements, iteratively retrieving them, and then processing the structured query statement with a large language model to obtain the query result. The structured query statement is the query statement obtained by transforming the results obtained from the iterative retrieval. If the query complexity is the third complexity and the system load information indicates that the current load of the query system is greater than or equal to the third load threshold, then the target query method is determined to be a query rejection method.

11. The method according to claim 1, characterized in that, The information query processing of the query statement based on the target query method includes: When the target query method is a fast table lookup method, the target entity information is extracted from the query statement; The target entity information is populated into a pre-built query template to generate a structured query statement; Information is retrieved based on the structured query statement to obtain the query information corresponding to the query statement.

12. The method according to claim 1, characterized in that, The information query processing of the query statement based on the target query method includes: When the target query method is intelligent retrieval, the query statement is converted into a query vector; The query vector is used to search the vector database to obtain the retrieval information of the query vector; The search information and the query statement are packaged together to generate structured prompt information; The structured prompt information is processed based on a large language model to obtain the query information corresponding to the query statement.

13. The method according to claim 1, characterized in that, The information query processing of the query statement based on the target query method includes: When the target query method is a deep analysis method, the query statement is split according to the query intent obtained by recognizing the query statement to obtain at least one sub-query statement corresponding to the query statement, and the dependency relationship between the at least one sub-query statement; Based on the dependency relationship, the retrieval information obtained by using the at least one subquery statement is processed to generate structured information; The structured information is processed based on a large language model to obtain the query results corresponding to the query statement.

14. The method according to claim 13, characterized in that, The step of processing the retrieval information obtained using the at least one subquery statement according to the dependency relationship to generate structured information includes: The at least one subquery statement is used to retrieve information from the structured database to obtain the first retrieval information of the at least one subquery statement; The at least one subquery statement is used to retrieve information from the vector database to obtain the second retrieval information of the at least one subquery statement. Based on the dependency relationship, the first search information and the second search information are integrated to generate target search information; When the target retrieval information meets the query requirements of the query statement, the target retrieval information is filled into a pre-built structured prompt template to generate the structured information.

15. An information query device, characterized in that, include: The query statement retrieval module is used to retrieve the query statement input by the user. The difficulty coefficient acquisition module is used to analyze the query statement and obtain the query difficulty coefficient of the query statement; The query difficulty coefficient is used to characterize the difficulty of obtaining the query results corresponding to the query statement; The system load acquisition module is used to acquire the system load information of the query system at the current moment, wherein the query system refers to the system used to perform information query tasks. The target method determination module is used to determine the target query method corresponding to the query statement based on the query difficulty coefficient and the system load information; The target query method is used to characterize that the query cost and query difficulty of the query statement are directly proportional to the query difficulty coefficient and inversely proportional to the system load information; The information query module is used to perform information query processing on the query statement based on the target query method.

16. 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; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-14.

17. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-14.

18. A computer program product containing instructions, wherein a computer program is stored thereon, characterized in that, When the computer program is run on a computer, it causes the computer to perform the method as described in any one of claims 1-14.