A method, system, electronic device and storage medium for automatically constructing a structured search query

By identifying domain labels through a large language model and decomposing natural language input into structured data objects, multi-angle query specifications are generated and combined with advanced operators. This solves the problems of insufficient retrieval accuracy and coverage in existing technologies, and realizes efficient and accurate automatic query construction.

CN123178443APending Publication Date: 2026-11-27北京盘拓数据科技有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611699675.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-30
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing automated query construction solutions lack systematic multi-angle coverage, lack domain-adaptive capabilities, and fail to effectively utilize advanced operators, resulting in insufficient retrieval accuracy and coverage.

Method used

The system utilizes a large language model to determine domain labels, decomposes natural language input into structured data objects, generates query specifications based on multiple search perspectives, and automatically assembles query strings using advanced operators.

Benefits of technology

It achieves zero search skill threshold, multi-dimensional information coverage, and domain adaptation, significantly improving the accuracy and relevance of search results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123178443A_ABST
    Figure CN123178443A_ABST
Patent Text Reader

Abstract

The application discloses a kind of methods for automatically constructing structured search query, system, electronic equipment and storage medium, belong to search engine technical field.The present application aims to solve the problem that the existing automatic query construction scheme lacks systematic multi-angle coverage, no field adaptive ability, and the problem of insufficient search precision and coverage.The method of the present application comprises: based on the natural language input of user, determine the domain label using the first large language model;Using the second large language model, the input is decomposed into a structured data object containing core entity components;Based on the object and for a plurality of search angles enabled by the domain label, generate query specifications;According to the predefined assembly rule, the components are combined with the advanced operators of the search engine to generate the final search query string.The present application converts simple natural language requirements into multiple sets of advanced search queries, improves the coverage, relevance and accuracy of information retrieval, and reduces the operation threshold of users.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of search engine technology, and specifically to a method, system, electronic device, and storage medium for automatically constructing structured search queries. Background Technology

[0002] In this age of information overload, search engines are a core tool for people to obtain information. However, the effectiveness of traditional search engines heavily relies on the user's personal skills, especially their familiarity with and ability to use advanced operators (such as the title matching operator for title searches, "site:" for website limitation, and "filetype:" for file type searches). Most ordinary users are accustomed to entering simple natural language or keyword combinations. While this method is convenient, it often results in broad search results with poor relevance, making it difficult to accurately and efficiently obtain the information needed.

[0003] To bridge the skills gap between ordinary users and professional searchers, several automated query construction or expansion solutions have emerged in the existing technology. These solutions typically utilize natural language processing techniques to perform synonym replacement or semantic association word expansion on the user's initial query, aiming to broaden the search scope.

[0004] However, these existing automation solutions generally have several shortcomings. First, they lack a systematic, multi-faceted coverage strategy. Most solutions only expand at the vocabulary level and fail to systematically and structurally mine users' information needs from multiple perspectives, such as logical dimensions, core definitions, methodologies, key metrics, and industry applications, thus easily overlooking crucial information.

[0005] Secondly, existing technologies generally lack domain awareness. Different information queries often belong to different professional fields, such as engineering technology, academic research, or business analysis, and the information organization and retrieval points of these fields are different. Existing solutions usually adopt a "one-size-fits-all" strategy, generating similar expanded terms for all types of queries, failing to adjust search strategies according to domain characteristics, resulting in untargeted queries and low retrieval efficiency.

[0006] Finally, existing automation solutions fail to fully utilize the advanced operators built into search engines. Most of the queries they generate are still simple keyword stuffing, while precisely binding semantically clear keywords with advanced operators is key to improving search accuracy. Because they fail to automatically build structured queries containing advanced syntax, these solutions lag significantly behind queries manually constructed by experienced professionals in terms of search accuracy. Summary of the Invention

[0007] To address the technical problems of insufficient retrieval accuracy and coverage caused by the lack of systematic multi-angle coverage, lack of domain adaptability, and failure to effectively utilize advanced operators in existing automatic query construction schemes, this invention provides a method, system, electronic device, and computer-readable storage medium for automatically constructing structured search queries.

[0008] This invention provides a method for automatically constructing structured search queries, comprising: Based on the user's natural language input, the domain label to which the natural language input belongs is determined using the first major language model; The natural language input is decomposed into a structured data object using a second language model, wherein the structured data object contains core entity components for identifying the focus of the query; Based on the structured data object, and for each of the multiple search angles enabled according to the domain tags, a set of corresponding query specifications is generated, wherein the multiple search angles are preset to cover different logical dimensions; and, Based on each generated query specification, the components in the structured data object are automatically combined with the search engine's advanced operators according to a set of predefined assembly rules to generate the final search query string; wherein, the assembly rules include binding the core entity components with the title forced matching operator.

[0009] This method achieves automatic conversion from user natural language to high-precision, multi-dimensional structured queries through the collaborative work of domain classification, component decomposition, multi-angle specification generation, and automatic assembly of advanced operators. This effectively lowers the user's learning threshold while significantly improving the breadth of search coverage and the accuracy of results.

[0010] In one implementation, the domain tags are selected from a preset set including "Engineering / Safety," "Fast-Paced Technology," "Academic / Research," "Business / Product," and "General Knowledge." The enabling of multiple search angles based on the domain tags includes dynamically enabling or disabling at least one preset auxiliary perspective based on the domain tags. For example, when the domain tag is "Engineering / Safety," a search angle related to problem analysis can be enabled; when it is "Fast-Paced Technology," a search angle related to the latest developments can be enabled. This design allows the generated search strategy to adapt to the information characteristics of a specific domain, thereby improving the effectiveness of the query and the relevance of the results.

[0011] Furthermore, the components in the structured data object also include at least one of the following: a conceptual component for describing core object attributes or metrics; an action component for describing related processes or operations; an exclusion component for excluding from search results; and a modifier component for precisely controlling the search scope. This refined semantic component division provides a solid foundation for the subsequent precise and rule-based mapping of user intent to the complex syntax of the search engine.

[0012] In one implementation, the plurality of preset search angles include: at least one precise hit angle and at least one auxiliary perspective angle; wherein, the precise hit angle is selected from at least one of: core definitions, methodologies, key indicators, industry applications, authoritative sources, multilingual variations, and document searches. By presetting these logical dimensions, the present invention can systematically and comprehensively explore user needs, avoiding the omission of important information.

[0013] As a further optimization of the above implementation, the assembly rules also include at least one of the following: connecting synonym variants in the core entity components using the "OR" operator; enclosing multi-word phrases in double quotes for exact matching; adding a "-" sign before words in the exclusion components; and directly appending the modifier components to the query string. These specific assembly rules ensure that syntactically correct and efficient high-level search query strings can be generated automatically and deterministically.

[0014] Optionally, in order to simplify system implementation and save computing resources, the first large language model and the second large language model can be the same large language model instance.

[0015] Preferably, the title forced matching operator is "intitle:". Using this operator ensures that the title of the search results must contain the core entity queried by the user, thereby effectively filtering out a large amount of weakly relevant or noisy information that only mentions the entity in the body text, significantly improving search accuracy.

[0016] The present invention also provides a system for automatically constructing structured search queries, comprising: The domain classification module is used to determine the domain label to which the natural language input belongs based on the user's natural language input using the first major language model; The component decomposition module is used to decompose the natural language input into a structured data object using the second major language model; wherein the structured data object contains core entity components for identifying the query focus; The specification generation module is used to generate a set of corresponding query specifications based on the structured data object and for each of the multiple search angles enabled according to the domain tags; wherein the multiple search angles are preset to cover different logical dimensions; The query assembly module is used to automatically combine the components in the structured data object with the advanced operators of the search engine based on each set of query specifications and according to a set of predefined assembly rules to generate the final search query string; wherein, the assembly rules include binding the core entity components with the title forced matching operator.

[0017] The present invention also provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, which, when executed by the processor, implements any of the methods described above.

[0018] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the methods described above.

[0019] Compared with existing technologies, this invention has significant advantages. First, it achieves zero search skill threshold; users only need to input a single natural language description, and the system automatically generates multiple search queries, eliminating the need for users to learn or memorize any advanced search syntax, greatly lowering the barrier to advanced search. Second, through a pre-set multi-angle coverage strategy, this invention can systematically and structurally mine user information needs from multiple logical dimensions, significantly improving the breadth and depth of information coverage and effectively avoiding the omission of important information due to user oversight. Third, this invention introduces a domain classification mechanism, which can dynamically adjust search strategies to adapt to the information characteristics of different domains, making the generated queries more targeted, thereby improving query efficiency and result relevance. Finally, through a rule-based assembly module, this invention achieves automated and precise combination of decomposed semantic components with advanced search engine operators. In particular, by utilizing strong constraint operators such as forced title matching, it can effectively filter noise, significantly improve the accuracy of search results, and provide users with a more professional search experience. Attached Figure Description

[0020] Figure 1 This is an overall flowchart of a method for automatically constructing structured search queries according to the present invention.

[0021] Figure 2 This is a flowchart of the structured component decomposition and operator automatic assembly in an embodiment of the present invention.

[0022] Figure 3 This is a flowchart of JSON parsing fault tolerance processing in one embodiment of the present invention.

[0023] Figure 4 This is a structural block diagram of a system for automatically constructing structured search queries according to the present invention. Detailed Implementation

[0024] To better understand this invention, specific embodiments will be described in detail below with reference to the accompanying drawings. It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This invention aims to address the problems of existing search engines, such as reliance on user skills, limited information coverage dimensions, and lack of domain awareness. By introducing a Large Language Model (LLM), this invention proposes a method that can automatically convert user natural language input into multi-faceted, high-precision structured search queries, thereby significantly lowering the threshold for information retrieval and improving the comprehensiveness and relevance of search results.

[0025] In the context of this invention, some core terms have specific meanings. "Structured search query" refers to a query string that follows specific search engine syntax rules, utilizing advanced operators to precisely control the search scope and results, rather than simply stuffing keywords. "Advanced operators" refer to special instructions provided by search engines for implementing complex search logic, such as the "heading forced match operator" to limit title content, or "filetype:" to limit file types. "Search perspective" refers to a pre-defined logical dimension for achieving systematic coverage of information needs, such as exploring from different levels like "core definitions," "methods and processes," or "industry applications."

[0026] The core of the technical solution proposed in this invention lies in establishing an automated conversion process from unstructured natural language to structured, multi-dimensional queries. This process first perceives the domain context of the user's needs, then decomposes the ambiguous intent into explicit semantic components, next generates query specifications with multiple exploration dimensions based on a complete strategy framework, and finally assembles these specifications with advanced operators into a directly executable query string using precise rules.

[0027] Reference Figure 1This invention provides a method for automatically constructing structured search queries, the overall process of which mainly includes the following core stages. First, the system receives natural language input from the user and enters the domain classification stage, i.e., step S1: based on the user's natural language input, the domain label to which the natural language input belongs is determined using a first language model. In this stage, this embodiment uses the first language model to analyze the semantic content of the input to determine its domain label. Next, it enters the structured component decomposition stage, i.e., step S2: using a second language model to decompose the natural language input into a structured data object. This embodiment uses the second language model to parse and convert the original natural language input into a structured data object, which contains core entity components for identifying the query focus. Subsequently, in the query specification generation stage, i.e., step S3: based on the structured data object, and for each of the multiple search angles enabled according to the domain label, a corresponding set of query specifications is generated. This embodiment generates a corresponding set of query specifications for each enabled search angle based on the multiple search angles enabled by the domain label determined in the first stage, combined with the structured data object generated in the second stage. Finally, in the query string assembly stage, i.e., step S4: based on each generated query specification, according to a set of predefined assembly rules, the components in the structured data object are automatically combined with the search engine's advanced operators to generate the final search query string. This embodiment combines the components in the structured data object with the search engine's advanced operators according to a set of predefined assembly rules to generate the final executable search query string.

[0028] In the domain classification stage, this invention utilizes a first-class language model to perform deep semantic understanding of the user's natural language input to determine its predefined domain. The domain label can be selected from a predefined set, which may include, for example, "engineering / safety," "fast-paced technology," "academic / research," "business / product," and "general knowledge." The first-class language model analyzes the professional terms (such as "stainless steel," "welding process"), industry keywords, and contextual information in the input to output the most matching domain label. The value of this step lies in providing a basis for dynamically adjusting subsequent search strategies.

[0029] The domain classification results directly influence the selection of subsequent search angles. This invention presets multiple search angles and dynamically enables or disables some of them based on the characteristics of different domains, particularly at least one preset auxiliary perspective angle. For example, when the domain tag is determined to be "Engineering / Safety," the system will specifically enable the "Problem Analysis" (B3) angle, which focuses on defects, faults, and failure modes; when the domain is "Fast-Paced Technology," the "Latest Developments" (B4) angle, which aims to obtain the latest technological dynamics, will be enabled. More specifically, when the domain tag is "Academic / Research," the system will enable the "Authoritative Sources" (A5) and "Document Search" (A7) angles, because in academic research scenarios, users highly value authoritative information from academic institutions or government organizations, as well as directly downloadable documents; when the domain tag is "Business / Product," the system will enable the "Comparative Analysis" (B1) angle, because in business scenarios, users often need to compare competitors and find alternatives. For the "General Knowledge" domain, no specific auxiliary perspective angles are enabled, only the general perspective is retained. In this way, the present invention avoids the "one-size-fits-all" search strategy, making the generated query combinations highly matched with the information features of a specific field, thereby significantly improving the effectiveness of the query and the relevance of the results.

[0030] After completing the domain classification, this method enters the structured component decomposition stage. (Refer to...) Figure 2 This stage utilizes a second major language model to decompose the user's natural language input into a structured data object. This decomposition is not simply keyword extraction, but rather mapping user intent to a set of components with clearly defined semantic roles. At the core of this structured data object is a key entity component that identifies the focus of the query, representing the object, product, or technology the user is most interested in. This design transforms vague user needs into machine-readable, standardized semantic input, laying a solid foundation for subsequent systematic expansion and rule-based grammar assembly.

[0031] To more precisely express user intent, the components in the structured data object can further include various other types. As a preferred implementation, these components also include: conceptual components for describing core object attributes or metrics; action components for describing related processes or operations; exclusion components for explicitly excluding specific terms from search results; and modifier components for precisely controlling the search scope, such as limiting the search to specific website domains or file types. By deconstructing natural language input into these five types of components (core entities, concepts, actions, exclusions, and modifiers), the system can capture various aspects of user intent with fine granularity and perform subsequent precise operations.

[0032] After generating structured data objects, the system enters the query specification generation stage. The core of this stage is to generate a set of corresponding query specifications for each enabled angle, based on a pre-set set of multiple search angles designed to cover different logical dimensions. The design of these search angles is key to achieving systematic information coverage in this invention. For example, these angles can be divided into two main categories: at least one exact-hit angle and at least one auxiliary perspective angle.

[0033] The precise targeting angle directly addresses the user's core information needs, aiming to deeply mine key information from different levels. As a specific implementation method, the precise targeting angle can be selected from at least one of the following: the "core definition" (A1) angle, which aims to retrieve the basic definition and essential description of things; the "method and process" (A2) angle, which aims to retrieve related methods, processes, and operational procedures; the "key indicators" (A3) angle, which aims to retrieve performance parameters, technical indicators, and test data; the "industry application" (A4) angle, which aims to retrieve application cases and scenarios in various industry fields; the "authoritative source" (A5) angle, which aims to retrieve information from authoritative sources such as academic institutions and government organizations; the "multilingual variant" (A6) angle, which aims to retrieve multilingual variants, international trademarks, or chemical formula representations; and the "file search" (A7) angle, which aims to retrieve downloadable PDF, PPT, and other format documents.

[0034] Auxiliary perspectives are used to expand the coverage of information, and their activation is usually dynamically controlled by the domain classification results. For example, there is a "Comparative Analysis" (B1) perspective for competitor comparison and alternative analysis, which is enabled by default in the "Business / Product" domain; a "Case Study" (B2) perspective for finding application scenarios and practical cases; a "Problem Analysis" (B3) perspective for exploring defects, faults, and issues, which is only enabled in the "Engineering / Safety" domain; and a "Latest Developments" (B4) perspective for obtaining recent dynamics and progress, which is only enabled in the "Fast-Paced Technology" domain. Through this multi-perspective strategy, this invention achieves a systematic and comprehensive understanding of user needs, significantly improving the breadth and depth of information coverage and effectively avoiding the omission of important information.

[0035] After generating query specifications for each enabled search angle, the system finally enters the query string assembly stage. (See reference...) Figure 2 This stage automatically combines components from structured data objects with advanced search engine operators based on a set of predefined assembly rules to generate the final search query string. This automated assembly process is the core element for achieving zero search skill threshold and high accuracy.

[0036] A key assembly rule involves binding the core entity component to a title-forced matching operator. As a specific implementation, this operator is "intitle:". This means that the core object queried by the user must appear in the title of the search results. This rule significantly improves the relevance of search results, effectively filtering out a large amount of weakly relevant or noisy information that only mentions the core entity briefly in the text, thereby greatly improving search accuracy.

[0037] To further enhance the accuracy and flexibility of queries, the assembly rules can include more refined logic. For example, rules may include: connecting synonyms separated by " / " symbols in the core entity or concept components using the "OR" operator to search for multiple equivalent expressions simultaneously; enclosing phrases containing multiple words (such as "corrosion resistance") in double quotes for precise phrase matching, avoiding keyword splitting; automatically adding a "-" sign before each word in the exclusion components to remove pages containing these noisy words from the results; and directly appending the modifier components (such as "site:.edu" or "filetype:pdf") to the end of the query string to apply specific search restrictions. Furthermore, the assembly rules also support combinations of multiple modifiers for specific perspectives. For example, for the "authoritative source" (A5) perspective, the system automatically appends the combined modifier "(site:.edu OR site:.org OR site:.gov)"; for the "file search" (A7) perspective, it automatically appends the combined modifier "(filetype:pdf OR filetype:ppt OR filetype:docx)". The combined application of these rules results in a more sophisticated and accurate query string.

[0038] In one embodiment of the invention, the first large language model used for performing domain classification and the second large language model used for performing component decomposition can be the same large language model instance. This means that the system can accomplish these two steps by calling the same large language model twice for different tasks (once for classification and once for decomposition), or by designing a complex prompt that can simultaneously output domain labels and decomposition results. This design can effectively save computational resources and simplify the system architecture.

[0039] To illustrate the above method more specifically, the following example demonstrates its application in the engineering field. Suppose a user enters a natural language request: "Please help me find information on the welding process, corrosion resistance, and industry applications of 304L stainless steel."

[0040] First, during the domain classification phase, the first major language model analyzes terms such as "stainless steel," "welding process," and "corrosion resistance" in the input and determines its domain label as "engineering / safety." Based on this label, the system decides to enable the "problem analysis" (B3) auxiliary perspective, which is highly relevant to the engineering domain. At the same time, since this domain is not fast-paced technology, the "latest developments" (B4) perspective is disabled.

[0041] Next, in the structured component decomposition stage, the second language model decomposes user requirements into the following structured data objects: the core entity component is "304L / 1.4307 / SS304L", which includes three common synonymous variations of this stainless steel grade; the concept components include "welding" and "corrosion resistance"; the action component is "welding process"; the exclusion components may include common commercial noise words supplemented by the model, such as "sale", "price", and "buy"; the modifier component is empty in this example.

[0042] Then, during the query specification generation phase, the system generates 10 different query specifications based on the aforementioned components and the 10 enabled search angles (A1-A7, B1-B3). For example, the specification for the "Core Definition" (A1) angle combines core entities, concepts, and action components; the specification for the "Industry Application" (A4) angle combines core entity components with keywords such as "application" and "industry"; the specification for the "Comparative Analysis" (B1) angle combines core entity components with keywords such as "vs," "316L," and "alternative"; the specification for the "Case Study" (B2) angle combines core entity components with keywords such as "case study" and "application"; and the specification for the "Problem Analysis" (B3) angle combines core entity components with problem-related keywords such as "defect," "failure," "corrosion," and "problem."

[0043] Finally, in the query string assembly stage, the system automatically assembles each set of specifications. Taking the "core definition" (A1) as an example, the assembly process is as follows: First, the core entity component "304L / 1.4307 / SS304L" is expanded and connected with "OR". Then, the title forced matching operator "intitle:" is applied to each item and enclosed in parentheses, forming "(intitle:"304L" OR intitle:"1.4307" OR intitle:"SS304L")". Next, the concept component "welding" is expanded to "(welding OR welding)", and "corrosion resistance" is expanded to "("corrosion resistance" OR "corrosion resistance")". Finally, all parts are connected with spaces (representing "AND" logic) to generate the final query string: "(intitle:"304L" OR intitle:"1.4307" ORintitle:"SS304L")(welding OR welding)("corrosion resistance" OR "corrosion resistance")". The same logic applies to the other nine angles, generating their respective specialized queries.

[0044] The method of the present invention can adaptively adjust the search strategy according to different domains. The following two additional embodiments are used to illustrate its domain-adaptive feature.

[0045] In one embodiment, the user input is: "Find the latest research and methods for fine-tuning large language models." The system first determines the domain tag as "fast-paced technology." Based on this tag, the system specifically enables the "Latest Developments" (B4) angle and automatically generates a time-limited modifier, such as "after:2024-01-01". The decomposed structured data object may contain the core entity component "large language model / LLM" and the conceptual component "fine-tuning". Finally, the query string generated for the B4 angle will be: "(intitle:"large languagemodel" OR intitle:"LLM" OR intitle:"large language model")("fine-tuning" OR "fine-tuning")after:2024-01-01". This query precisely limits the results to after a specified date, making it ideal for tracking rapidly evolving technology fields.

[0046] In another embodiment, the user input is: "Compare the features and pricing of Salesforce and HubSpot CRM". The system determines its domain tag as "Business / Product". Therefore, the system will activate the "Comparative Analysis" (B1) perspective, which focuses on competitor comparison. During the structured component decomposition phase, the large language model decomposes the results as follows: core entity components "Salesforce", "HubSpot CRM"; concept components "feature / function", "pricing / pricing"; action components "compare / comparison"; and exclusion components "affiliate", "promo". The query string generated for the B1 perspective might be: "intitle:"Salesforce" intitle:"HubSpot CRM"(feature OR function)(pricing OR pricing)(compare OR comparison)vs". By simultaneously forcing a match between the two core entities in the title and adding comparative terms such as "vs", this query can efficiently find direct comparative analysis content about these two products. These two examples clearly demonstrate how the present invention achieves intelligent and personalized query strategies through domain classification.

[0047] Considering the potential for unstable formatting in the output of large language models—for example, sometimes returning text enclosed in Markdown code blocks or missing certain fields—this invention also provides a robust parsing mechanism to ensure reliable system operation. (See reference...) Figure 3 This mechanism employs a two-stage processing flow. After obtaining text output intended to represent structured data objects from the large language model, the system first attempts to perform a full parse using a standard parser (e.g., the "json.loads()" function for JSON format), which constitutes the main path. If parsing is successful, the system directly obtains the structured component data, and the process continues.

[0048] However, if the standard parser fails to parse the text, the system activates a fallback path to try to extract valid data from the poorly formatted text output. This fallback path can include at least one error-handling step. For example, the system can first perform preprocessing to remove Markdown code block markers such as "`json" and "`" from the text output. Then, even if the text is not a complete JSON, the system can use regular expressions to match and extract fragments that appear to be JSON objects from the text output, such as matching content between "{...}". After extracting the JSON object fragments, if the fragment still cannot be completely parsed by the standard parser (e.g., due to missing parentheses or internal syntax errors), the fallback path can further perform field-by-field extraction. This means that for each expected component (such as "entities", "concepts", etc.), the system uses specific regular expressions or string search methods to extract the corresponding values ​​from the JSON object fragment one by one. Even if some fields are missing, the system can obtain other existing fields and assign default null values ​​to the missing fields. By combining the main path and the fallback path in this two-level fault-tolerant design, the present invention significantly improves the system availability and reliability when facing the uncertainty of large language model output, and ensures the smooth execution of the end-to-end process.

[0049] Corresponding to the above method, the present invention also provides a system for automatically constructing structured search queries. (See also...) Figure 4 The system may include: a domain classification module 410, a component decomposition module 420, a specification generation module 430, and a query assembly module 440. The domain classification module 410 is responsible for performing the aforementioned domain classification step, that is, determining the domain label to which the natural language input belongs using a first major language model based on the user's natural language input. The component decomposition module 420 is responsible for performing the structured component decomposition step, that is, decomposing the natural language input into a structured data object using a second major language model. The specification generation module 430 receives the domain label and the structured data object, and is responsible for performing the query specification generation step, generating a set of corresponding query specifications for each of the multiple search angles enabled by the domain label. The query assembly module 440 receives the query specifications and the structured data object, and is responsible for performing the query string assembly step, automatically combining the components in the structured data object with the search engine's advanced operators according to predefined assembly rules based on each set of query specifications, ultimately generating one or more search query strings as the system output. These modules work together to achieve the automated construction of professional search queries from natural language.

[0050] The above-described methods and systems can be implemented by an electronic device. This electronic device may include a processor and a memory, wherein a computer program is stored in the memory. When the computer program is executed by the processor, it can implement any of the methods described above. The electronic device can be a server, a personal computer, a smartphone, or any device with computing capabilities. The processor is responsible for executing instructions, and the memory is used to store program code and data during processing. It may also include an input interface for receiving user input and an output interface for displaying or outputting query results.

[0051] The present invention also provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, it can implement any of the methods described above. The storage medium can be non-volatile, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), or it can be volatile, such as random access memory (RAM). It carries a set of instructions for implementing the technical solutions of the present invention. The present invention can also be embodied as a computer program product containing instructions that, when run on a computer, cause the computer to perform any of the methods described above.

[0052] It should be noted that the above embodiments are merely preferred examples of the present invention. Those skilled in the art can make various modifications and improvements without departing from the principles of the present invention, and these modifications and improvements also fall within the protection scope of the present invention.

[0053] For example, in an alternative implementation, the domain classification step may not rely entirely on a large language model, but instead employ a keyword-based rule matching method, or a smaller classification model fine-tuned for a specific domain classification task to replace the general, expensive large language model inference, thereby improving efficiency and reducing costs. Similarly, the structured component decomposition step can also be implemented using a traditional Natural Language Processing (NLP) pipeline, for example, first using Named Entity Recognition (NER) to extract core entity components, and then using dependency parsing to identify other components. Furthermore, the configuration of the search perspective can be flexible and variable; the system can provide an interface allowing advanced users to customize or override the default perspective strategy to meet their personalized information exploration needs. For example, a "Regulations and Standards" perspective can be added with the strategy of automatically appending the "site:.gov" qualifier, or a "Video Tutorials" perspective can be added with the strategy of automatically appending the "site:youtube.com" qualifier.

[0054] For example, the query string assembly rules can also be adapted to different target search engines. Although the above embodiments are based on Google search syntax, the core idea of ​​this invention is to bind semantic components with operators in a rule-based manner, an idea that can be extended to other search engines. The system can also be adapted to other search engines such as DuckDuckGo, even if they do not support the "after:" operator, by adding year keywords to the query. The parsing fault tolerance mechanism can also be adapted to other output formats of large language models, such as YAML or XML, and its primary / backup path fault tolerance concept still applies. The automatic assembly process of the operators itself can also be implemented in multiple ways. In addition to being implemented through fixed functions in the code, template engine technology can be used to predefine a query template for each search perspective, and then fill the component values ​​into the template at runtime to generate the final query string. In another alternative implementation, the connection logic between components can also be dynamic, rather than a fixed "AND" connection. For example, in the "industry application" perspective, different core entities can be connected using "OR" to expand the search scope; or when user requirements contain multiple independent sub-questions, the system can generate queries for each sub-question separately and then merge them. Furthermore, the method of this invention can also be implemented collaboratively by multiple large language models. For example, steps such as domain classification, component decomposition, and perspective generation can be handled by different dedicated large language models. Alternatively, when computing resources are sufficient, large language models can be invoked in parallel to generate query specifications for each perspective, thereby accelerating the processing. These different implementation methods can all achieve the same technical effect.

[0055] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for automatically constructing a structured search query, characterized by, include: Based on the user's natural language input, the domain label to which the natural language input belongs is determined using the first major language model; The natural language input is decomposed into a structured data object using a second language model, wherein the structured data object contains core entity components for identifying the focus of the query; Based on the structured data object, and for each of the multiple search angles enabled according to the domain label, a set of corresponding query specifications is generated, wherein the multiple search angles are preset to cover different logical dimensions; Based on each generated query specification, the components in the structured data object are automatically combined with the search engine's advanced operators according to a set of predefined assembly rules to generate the final search query string; wherein, the assembly rules include binding the core entity components with the title forced matching operator.

2. The method for automatically building a structured search query according to claim 1, characterized in that, The domain tags are selected from a preset set including "Engineering / Safety", "Fast-paced Technology", "Academic / Research", "Business / Products" and "General Knowledge"; as well as, Enabling multiple search angles based on the domain label includes: dynamically enabling or disabling at least one preset auxiliary viewpoint based on the domain label.

3. The method for automatically constructing structured search queries according to claim 1, characterized in that, The components in the structured data object also include at least one of the following: a conceptual component for describing core object attributes or metrics; an action component for describing related processes or operations; an exclusion component for excluding from search results; and a modifier component for precisely controlling the search scope.

4. The method for automatically constructing structured search queries according to claim 1, characterized in that, The multiple preset search angles include: at least one precise hit angle and at least one auxiliary view angle; The precise hit angle is selected from at least one of the following: core definition, methodology, key indicators, industry application, authoritative source, multilingual variants, and document search.

5. The method for automatically constructing structured search queries according to claim 3, characterized in that, The assembly rules also include at least one of the following: connecting synonym variants in the core entity component with the "OR" operator; enclosing multi-word phrases in double quotes for exact matching; adding a "-" sign before words in the exclusion component; and directly appending the modifier component to the query string.

6. The method for automatically constructing structured search queries according to claim 1, characterized in that, The first and second largest language models are instances of the same large language model.

7. The method for automatically constructing structured search queries according to claim 1, characterized in that, The title forced matching operator is intitle:.

8. A system for automatically constructing structured search queries, characterized in that, include: The domain classification module is used to determine the domain label to which the natural language input belongs based on the user's natural language input using the first major language model; The component decomposition module is used to decompose the natural language input into a structured data object using the second major language model; wherein the structured data object contains core entity components for identifying the query focus; The specification generation module is used to generate a set of corresponding query specifications based on the structured data object and for each of the multiple search angles enabled according to the domain tags; wherein the multiple search angles are preset to cover different logical dimensions; The query assembly module is used to automatically combine the components in the structured data object with the advanced operators of the search engine based on each set of query specifications and according to a set of predefined assembly rules to generate the final search query string; wherein, the assembly rules include binding the core entity components with the title forced matching operator.

9. An electronic device, characterized in that, It includes a processor and a memory, wherein the memory stores a computer program, which, when executed by the processor, implements the method as described in any one of claims 1-7.

10. 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-7.