Query condition analysis method and device and medium

By receiving natural language queries from the human resource management system and generating key vector graphs and pseudocode using a pre-defined knowledge base and Elasticsearch database, the problem of insufficient semantic parsing capabilities in the existing system is solved, achieving efficient and accurate query parsing.

CN120950529APending Publication Date: 2025-11-14SHENZHEN INSPUR HAIYUE HUMAN RESOURCES TECHNOLOGY CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202511043388.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-28
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing human resource management systems suffer from weak semantic parsing capabilities in their query functions, failing to accurately understand users' natural language queries, resulting in low query efficiency and insufficient accuracy.

Method used

By receiving users' natural language queries, core semantic units are extracted and mapped to the semantic structure of the Elasticsearch database based on a pre-defined knowledge base, generating a key vector graph, further generating pseudocode, and finally converting it into a DSL query statement for accurate parsing.

Benefits of technology

It achieves high-precision conversion of natural language query statements to structured query language, improves query accuracy and efficiency, and solves the bottleneck problem of semantic understanding in traditional systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120950529A_ABST
    Figure CN120950529A_ABST
Patent Text Reader

Abstract

The invention discloses a query condition analysis method and device and a medium, and the method comprises the steps: receiving a natural language query statement input by a user for a human resource management system, and extracting a core semantic unit in the natural language query statement; based on a preset knowledge base, mapping the core semantic unit into a semantic structure corresponding to an Elasticsearch database to generate a corresponding key vector diagram; based on a preset pseudo code normal form, generating a pseudo code according to the key vector diagram; wherein the pseudo code comprises a query node set and a logical relationship between query nodes; and performing code verification on the pseudo-code, and converting the pseudo-code into a DSL query statement in an Elasticsearch database under the condition that the pseudo-code passes the code verification, so as to realize semantic analysis on the natural language query statement through the DSL query statement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, specifically to a query condition parsing method, device, and medium. Background Technology

[0002] As human resource management systems continue to evolve towards data-driven approaches, enterprises need to quickly retrieve and analyze information from massive amounts of human resource data. Current mainstream human resource management systems (such as Workday, BambooHR, and SAP SuccessFactors) all have significant limitations in their query functions. Workday uses fixed template queries, which can filter basic fields but struggles to adapt to dynamic fields or complex multi-condition logic. BambooHR relies on simple keyword searches and lacks complex semantic understanding capabilities. SAP SuccessFactors relies entirely on manually configured query logic, lacks generalized natural language understanding capabilities, and results in a poor user experience.

[0003] Traditional human resource management systems often suffer from weak semantic parsing capabilities. After users input their query statements, the rule engine needs to master specific syntax to perform semantic parsing of the query statements. However, general NLP models lack knowledge of the human resource domain and cannot accurately understand business terms from users' natural language, resulting in low query efficiency and insufficient accuracy. Summary of the Invention

[0004] To address the aforementioned problems, this application proposes a query condition parsing method, including:

[0005] Receive natural language query statements input by users for the human resource management system, and extract the core semantic units from the natural language query statements;

[0006] Based on a pre-defined knowledge base, the core semantic units are mapped to the corresponding semantic structures in the Elasticsearch database to generate corresponding key vector graphs.

[0007] Based on a preset pseudocode paradigm, pseudocode is generated according to the key vector graph; wherein, the pseudocode includes a set of query nodes and the logical relationships between query nodes;

[0008] The pseudocode is validated. If the pseudocode passes the validation, it is converted into a DSL query statement in the Elasticsearch database, so as to achieve semantic parsing of the natural language query statement through the DSL query statement.

[0009] In one implementation of this application, based on a preset knowledge base, the core semantic units are mapped to the corresponding semantic structures in the Elasticsearch database to generate corresponding key vector graphs, specifically including:

[0010] Based on the entity relationships and business rules in the preset knowledge base, the entity to be queried and the query scope are determined according to the core semantic unit;

[0011] The field mapping table in the preset knowledge base is used to map the entity to be queried and the query range to the corresponding semantic structure in the Elasticsearch database to generate a key vector graph.

[0012] In one implementation of this application, the core semantic unit includes fields, operators, and field values, mapping the entity to be queried and the query range to the corresponding semantic structure of the Elasticsearch database to generate a key vector graph, specifically including:

[0013] Using the field mapping table in the preset knowledge base, calculate the semantic similarity between the field in the field mapping table and its corresponding Elasticsearch data field, and map the field to the target data field with the greatest semantic similarity based on the semantic similarity.

[0014] Convert the operator into a target operator with the same semantics as the operation in the Elasticsearch database;

[0015] According to the specified syntax rules of the Elasticsearch database, the field values ​​in the core semantic unit are standardized to obtain standardized field values;

[0016] A key vector graph is generated based on the target data field corresponding to the entity to be queried, and the query range consisting of the target data field, the target operator, and the field value.

[0017] In one implementation of this application, pseudocode is generated based on a preset pseudocode paradigm and the key vector graph, specifically including:

[0018] Based on the query range in the key vector graph, a query node corresponding to each query range is generated; wherein, the query node includes the target data field, operator, field value and metadata;

[0019] For different query nodes, determine the logical relationship between the query nodes; wherein, the logical relationship represents the Boolean combination method between query nodes;

[0020] Based on a preset pseudocode paradigm, pseudocode is generated according to the query node and the logical relationship. In one implementation of this application, code verification of the pseudocode specifically includes:

[0021] The pseudocode paradigm is used to perform structural validation on the pseudocode to determine whether the query node contains required fields and whether the logical relationship is valid.

[0022] The pseudocode is type-validated to determine whether the field type corresponding to the target data field matches the operator.

[0023] In one implementation of this application, the metadata includes a verification status and a generation timestamp. After performing code verification on the pseudocode, the method further includes:

[0024] The verification status in the metadata is adjusted based on the verification results obtained after verifying the pseudocode.

[0025] In one implementation of this application, before standardizing the field values ​​in the core semantic unit according to the specified syntax rules of the Elasticsearch database to obtain the standardized field values, the method further includes:

[0026] When the core semantic unit matches multiple grammatical rules, the priority of the grammatical rules is determined based on the entity to be queried.

[0027] Select the highest priority specified syntax rule from the syntax rules to standardize the field values ​​in the core semantic unit through the specified syntax rule.

[0028] In one implementation of this application, the specified syntax rules include at least one or more of the following: date format conversion rules and numerical range standardization rules.

[0029] This application embodiment provides a query condition parsing device, the device comprising:

[0030] At least one processor;

[0031] And, a memory communicatively connected to the at least one processor;

[0032] The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform a query condition parsing method as described in any of the preceding claims.

[0033] This application provides a non-volatile computer storage medium storing computer-executable instructions, wherein the computer-executable instructions are configured as follows:

[0034] One of the query condition parsing methods described above.

[0035] The query condition parsing method proposed in this application can bring the following beneficial effects:

[0036] By establishing a precise mapping between natural language query statements and underlying Elasticsearch data fields, the terminology confusion caused by the lack of domain knowledge in general NLP models is eliminated. This enables widespread application in complex business scenarios and effectively solves the semantic understanding bottleneck in natural language processing for traditional human resource management systems. Secondly, by integrating core semantic units into machine-parseable pseudocode using a pseudocode paradigm, the conversion from natural language to structured query language is achieved. Through a step-by-step parsing strategy—from natural language to pseudocode, and then from pseudocode to precise DSL query statements—precise matching of query semantics is achieved, effectively improving query accuracy. Attached Figure Description

[0037] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:

[0038] Figure 1 A flowchart illustrating a query condition parsing method provided in an embodiment of this application;

[0039] Figure 2 This is a schematic diagram of a query condition parsing device provided in an embodiment of this application. Detailed Implementation

[0040] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of them. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0041] The technical solutions provided by the various embodiments of this application are described in detail below with reference to the accompanying drawings.

[0042] like Figure 1 As shown in the embodiment of this application, a query condition parsing method is provided, including:

[0043] S101: Receives natural language query statements input by users for the human resource management system and extracts the core semantic units from the natural language query statements.

[0044] Elasticsearch natively supports the parsing of complex query logic, supports multi-condition combinations and numerical range queries, and can directly generate DSL definitions for query conditions, thus replacing manual configuration and overcoming the limitations of Workday's fixed templates and SAP's inefficient operations. Furthermore, Elasticsearch can process massive amounts of data in real time with high retrieval efficiency. Therefore, in this embodiment, after receiving a natural language query statement input by a user into the human resources management system, the core semantic units in the natural language query statement are extracted using a Natural Language Processing (NLP) model. Based on the extracted core semantic units, the natural language query statement is converted into an Elasticsearch DSL to achieve accurate semantic parsing and efficient querying of query conditions. For example, if the natural language query statement input by the user through the human resources management system is "Please query all engineers in the technical department whose performance rating is higher than 4.5 in the past three months," the extracted core semantic units include two parts: entities and values. The entities include technical department, performance rating, and engineer; the values ​​include 4.5 and "past three months."

[0045] S102: Based on a pre-defined knowledge base, the core semantic units are mapped to the corresponding semantic structures in the Elasticsearch database to generate the corresponding key vector graph.

[0046] The knowledge base stores a knowledge graph in the human resources domain. This knowledge graph defines core entities in the human resources domain (such as employees, departments, and salaries) and standardized relationships between these entities (such as affiliation and performance evaluation). Simultaneously, the knowledge base also stores a field mapping table, which enables bidirectional mapping between natural language and Elasticsearch index fields. Therefore, this embodiment, based on a pre-defined knowledge base, maps core semantic units to the corresponding semantic structures in the Elasticsearch database, achieving accurate mapping from human resources business terms to Elasticsearch fields. A key vector graph is generated based on the mapped Elasticsearch fields. This key vector graph serves as an in-memory data structure representation of the field mapping table, acting as an intermediate representation oriented towards query semantics and providing standardized input for subsequent generation of type-safe pseudocode.

[0047] In one embodiment, the knowledge base includes an entity layer and a mapping layer. The entity layer defines entity relationships and business rules. Based on these relationships and rules, it can identify the entity to be queried and the query scope within the core semantic units. The entity to be queried refers to the query object, and the query scope refers to the logical combination of conditions consisting of data fields, operation operators, and field values. The mapping layer stores the bidirectional mapping relationship between business terms and Elasticsearch data fields. Based on this layer, after identifying the entity to be queried and the query scope, a field mapping table in the pre-defined knowledge base can be used to map these entities to the corresponding semantic structure in the Elasticsearch database, thereby generating a key vector graph.

[0048] Specifically, the field mapping table includes each field and at least one Elasticsearch data field that has a mapping relationship with that field. After obtaining the field mapping table, the semantic similarity between each field in the field mapping table and its corresponding Elasticsearch data field needs to be calculated. Based on the semantic similarity, the field is mapped to the target data field with the highest semantic similarity. For example, the field "performance" is mapped to the "performance_score" field in Elasticsearch. Similarly, operators in natural language also need to be converted to target operators with the same semantic meaning in the Elasticsearch database; for example, text comparison is converted to "match", and "greater than" is converted to "gt".

[0049] In addition to the field mappings mentioned above, the knowledge base also standardizes the field values ​​in the core semantic units based on specified syntax rules in the Elasticsearch database, thus obtaining standardized field values. These specified syntax rules include at least one or more of the following: date format conversion rules and numeric range standardization rules. For example, if "last three months" is a numeric range, the current date and time difference tools in the database need to be retrieved to standardize "last three months" to the "NOW-3M" format.

[0050] It's important to note that when standardizing the field value of a core semantic unit, there may be multiple matching syntax rules. For example, if the core semantic unit's field value is "first three quarters," it will be standardized into various patterns under different syntax rules, such as [January 1st of the current year, September 30th of the current year] or [April 1st of the previous year, September 30th of the current year]. Different syntax rules are applicable to different query scenarios. Therefore, if a core semantic unit matches multiple syntax rules, it's necessary to clarify the current query scenario based on the entity being queried and then determine the priority of different syntax rules within this query scenario. Priority is determined based on the degree of adaptability to the query scenario. The specified syntax rule with the highest priority should be selected to standardize the field value of the core semantic unit. If the specified syntax rule has the highest priority in the financial scenario, then the rule [January 1st of the current year, September 30th of the current year] is selected to standardize the field value, ultimately outputting gte = "2023-01-01" and lte = "2023-09-30". Conversely, if it is a sales scenario and the fiscal year starts in April, then the field value needs to be standardized using the syntax rule [April 1st of the previous year, September 30th of the current year], and the final output will be gte="2022-04-01",lte="2023-09-30".

[0051] After mapping fields, operators, and field values ​​through the above process, a corresponding query range can be constructed based on the target data fields, target operators, and field values. Then, a key vector graph is generated based on the target data fields corresponding to the entity to be queried and the query range.

[0052] For example, for the natural language query "Please query all engineers in the technical department whose performance rating is higher than 4.5 in the last three months", based on the knowledge base, the fields are mapped to Elasticsearch terms, namely "technical department" → department, "performance rating" → performance_score, "engineer" → job_title, "last three months" → NOW-3M, "higher than" → gt, etc. The final generated key vector graph is represented as follows:

[0053] {'entities':[{'name':'Technical Department','type':'department'},

[0054] {'name':'Performance Rating','type':'score_metric'}],

[0055] 'constraints':[{'field':'job_title','op':'contains','value':'Engineer'},

[0056] {'field':'performance_score','op':'gt','value':4.5},

[0057] {'field':'update_time','op':'within','range':'NOW-3M'}]}

[0058] In the key vector diagram above, entities represent the entities to be queried, i.e. the query objects, indicating that the performance ratings of the technical department need to be queried, and constraints represent the query scope, i.e. the combination logic of query conditions, indicating that the engineers with performance ratings higher than 4.5 in the past three months need to be found.

[0059] S103: Based on a preset pseudocode paradigm, generate pseudocode according to the key vector graph; wherein, the pseudocode includes a set of query nodes and the logical relationships between query nodes.

[0060] Key vector graphs are a primary structured representation of natural language parsing, but they lack a unified logical organization and standardized syntax. This application provides an intermediate pseudocode layer, which transforms key vector graphs into structured and type-safe intermediate pseudocode through predefined JSON Schema pseudocode paradigm rules. The pseudocode adopts a standardized tree structure, which includes a set of query nodes and the logical relationships between query nodes.

[0061] In one embodiment, based on the query range in the key vector graph, a query node is generated for each query range. Each query node includes the target data field, operator, field value, and metadata. For different query nodes, the logical relationships between them are determined. These logical relationships represent the Boolean combination methods between the query nodes, i.e., AND, OR, and NOT. After clarifying the set of query nodes and their logical relationships, corresponding pseudocode can be generated based on a preset pseudocode paradigm.

[0062] The pseudocode paradigm employs a dynamically expandable structure, and its JSON Schema definition includes:

[0063]

[0064] In the pseudocode paradigm above, the query node refers to the object in the `filters` array, which is an object composed of "field, op, value...update_timestamp". The `filters` array can contain some or all of the elements in the above object. The logical relationship defines the Boolean combination relationship between the query node. If the logical relationship is defined as AND, it means that the query conditions required by each query node must be satisfied simultaneously.

[0065] Based on the pseudocode paradigm, corresponding pseudocode can be generated. Assuming the natural language query is "Please query all engineers in the technical department whose performance rating is higher than 4.5 in the past three months", the pseudocode generated using the above pseudocode paradigm is:

[0066]

[0067]

[0068] The pseudocode includes two query nodes, “department” and “performance_score”, and the logical relationship between the query nodes is “AND”.

[0069] S104: Perform code verification on the pseudocode. If the pseudocode passes the code verification, convert the pseudocode into a DSL query statement under the Elasticsearch database, so as to achieve semantic parsing of the natural language query statement through the DSL query statement.

[0070] Generating queries directly from unvalidated pseudocode may result in syntax errors. Therefore, pseudocode must undergo multiple layers of validation before it can be converted into a DSL query statement in the Elasticsearch database. As a structured query language, DSL can be directly applied to Elasticsearch search, thus achieving accurate semantic parsing of natural language query statements and high-precision conversion from natural language to structured query language.

[0071] In one embodiment, pseudocode validation consists of two parts: structure validation and type validation. Structure validation primarily verifies the completeness of the pseudocode query nodes, specifically whether each query node contains required fields and whether the logical relationships between query nodes are valid. Structure validation can be performed using pseudocode paradigms. By verifying whether the pseudocode includes the required fields as specified in the paradigm and whether the logical relationships between query nodes conform to syntax rules, structure validation of the pseudocode can be achieved. Type validation refers to whether the field type of the target data field matches the operator. For example, if the target data field is a numeric field, but its corresponding operator is a text matching operator, then the target data field is considered to have failed type validation.

[0072] After validating the pseudocode, the corresponding validation result is obtained. This result needs to be fed back to the query node. The metadata in the query node includes the validation status and generation timestamp. Therefore, the validation status in the metadata is adjusted based on the validation result. If validation passes, `validation_status` is "pass"; otherwise, it is "verified".

[0073] The pseudocode encapsulates the query semantic logic, but it cannot be directly executed by the database. DSL, or Elasticsearch Query Language, is a query language specific to Elasticsearch and can be parsed and executed by search engines. Therefore, after the pseudocode passes validation, it needs to be converted into Elasticsearch DSL. DSL will then directly execute the corresponding query conditions to obtain the query results and ultimately provide them to the user.

[0074] The above are embodiments of the methods proposed in this application. Based on the same idea, some embodiments of this application also provide devices and non-volatile computer storage media corresponding to the above methods.

[0075] Figure 2 This is a schematic diagram of a query condition parsing device provided in an embodiment of this application. Figure 2 As shown, it includes:

[0076] At least one processor; and,

[0077] At least one processor-communication-connected memory; wherein,

[0078] The memory stores instructions that can be executed by at least one processor, such that the at least one processor is able to perform a query condition parsing method as described in any of the preceding items.

[0079] This application provides a non-volatile computer storage medium storing computer-executable instructions, which are configured as follows:

[0080] One of the query condition parsing methods described above.

[0081] The various embodiments in this application are described in a progressive 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 device and medium embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the description of the method embodiments.

[0082] The devices and media provided in this application are one-to-one with the methods. Therefore, the devices and media also have similar beneficial technical effects as their corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the devices and media will not be repeated here.

[0083] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0084] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0085] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0086] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0087] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0088] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0089] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0090] It should also be noted that 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 limitation, 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.

[0091] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A query condition parsing method, characterized in that, The method includes: Receive natural language query statements input by users for the human resource management system, and extract the core semantic units from the natural language query statements; Based on a pre-defined knowledge base, the core semantic units are mapped to the corresponding semantic structures in the Elasticsearch database to generate corresponding key vector graphs. Based on a preset pseudocode paradigm, pseudocode is generated according to the key vector graph; wherein, the pseudocode includes a set of query nodes and the logical relationships between query nodes; The pseudocode is validated. If the pseudocode passes the validation, it is converted into a DSL query statement in the Elasticsearch database, so as to achieve semantic parsing of the natural language query statement through the DSL query statement.

2. The query condition parsing method according to claim 1, characterized in that, Based on a pre-defined knowledge base, the core semantic units are mapped to the corresponding semantic structures in the Elasticsearch database to generate corresponding key vector graphs, specifically including: Based on the entity relationships and business rules in the preset knowledge base, the entity to be queried and the query scope are determined according to the core semantic unit; The field mapping table in the preset knowledge base is used to map the entity to be queried and the query range to the corresponding semantic structure in the Elasticsearch database to generate a key vector graph.

3. The query condition parsing method according to claim 2, characterized in that, The core semantic unit includes fields, operators, and field values, mapping the entity to be queried and the query range to the corresponding semantic structure of the Elasticsearch database to generate a key vector graph, specifically including: Using the field mapping table in the preset knowledge base, calculate the semantic similarity between the field in the field mapping table and its corresponding Elasticsearch data field, and map the field to the target data field with the greatest semantic similarity based on the semantic similarity. Convert the operator into a target operator with the same semantics as the operation in the Elasticsearch database; According to the specified syntax rules of the Elasticsearch database, the field values ​​in the core semantic unit are standardized to obtain standardized field values; A key vector graph is generated based on the target data field corresponding to the entity to be queried, and the query range consisting of the target data field, the target operator, and the field value.

4. The query condition parsing method according to claim 1, characterized in that, Based on a preset pseudocode paradigm, pseudocode is generated according to the key vector graph, specifically including: Based on the query range in the key vector graph, a query node corresponding to each query range is generated; wherein, the query node includes the target data field, operator, field value and metadata; For different query nodes, determine the logical relationship between the query nodes; wherein, the logical relationship represents the Boolean combination method between query nodes; Based on a preset pseudocode paradigm, pseudocode is generated according to the query node and the logical relationship.

5. The query condition parsing method according to claim 4, characterized in that, Code verification of the pseudocode specifically includes: The pseudocode paradigm is used to perform structural validation on the pseudocode to determine whether the query node contains required fields and whether the logical relationship is valid. The pseudocode is type-validated to determine whether the field type corresponding to the target data field matches the operator.

6. The query condition parsing method according to claim 4, characterized in that, The metadata includes verification status and generation timestamp. After performing code verification on the pseudocode, the method further includes: The verification status in the metadata is adjusted based on the verification results obtained after verifying the pseudocode.

7. The query condition parsing method according to claim 3, characterized in that, Before standardizing the field values ​​in the core semantic unit according to the specified syntax rules of the Elasticsearch database to obtain the standardized field values, the method further includes: When the core semantic unit matches multiple grammatical rules, the priority of the grammatical rules is determined based on the entity to be queried. Select the highest priority specified syntax rule from the syntax rules to standardize the field values ​​in the core semantic unit through the specified syntax rule.

8. The query condition parsing method according to claim 7, characterized in that, The specified syntax rules include at least one or more of the following: date format conversion rules and numerical range standardization rules.

9. A query condition parsing device, characterized in that, The device includes: At least one processor; And, a memory communicatively connected to the at least one processor; The memory stores instructions that can be executed by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform a query condition parsing method as described in any one of claims 1-8.

10. A non-volatile computer storage medium storing computer-executable instructions, characterized in that, The computer-executable instructions are set as follows: A query condition parsing method as described in any one of claims 1-8.

Citation Information

Cited By

  • Semi-structured natural language programming method and device and electronic equipment

    CN121957568A

  • A semi-structured natural language programming method, device and electronic equipment

    CN121957568B

  • Method, system, and media for natural language query transformation es dsl based on large models

    CN122470709A