Query statement generation method, device and equipment based on object query language

By generating a low-code syntax tree and using object query language to update and parse it, the problems of high professionalism and low efficiency of query statement generation methods are solved, and fast and simplified query statement generation is achieved.

CN120596500APending Publication Date: 2025-09-05INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510736418.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-04
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

Existing query statement generation methods require high professionalism, are difficult to generate, require a lot of human resources, and have low query statement generation operation speed and efficiency.

Method used

Generate a low-code syntax tree by acquiring target data, generate query conditions in response to user operations, and use object query language to update the syntax tree. Finally, use the preset language parser to parse and generate the target query statement.

Benefits of technology

It reduces the professionalism and difficulty of query statement generation, improves generation speed and efficiency, and saves human resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120596500A_ABST
    Figure CN120596500A_ABST
Patent Text Reader

Abstract

The invention discloses a query statement generation method and device based on an object query language, equipment and a medium. The method comprises the steps of obtaining target data and generating a low-code syntax tree matched with the target data; generating query conditions in response to at least one data query operation of a user, and updating the feature fragments of the low-code syntax tree based on the query conditions by using an object query language to obtain a query syntax tree; and analyzing the query syntax tree based on a preset language analyzer to obtain target query statements matched with the data query operations respectively. Through the technical scheme of the invention, the generation of the query statement in the object query language format can be realized, the professionality and the generation difficulty of the query statement generation operation are reduced, the speed and the efficiency of the query statement generation operation are improved, and human resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of big data, and in particular to a method, device, equipment, medium and product for generating query statements based on an object query language. Background Art

[0002] In the field of low-code platform development, organizing and orchestrating business logic through visual dragging and dropping components has become the mainstream development model. This development method has greatly lowered the technical threshold for software development, significantly improved development efficiency, and enabled non-professional developers to participate in the application development process. However, as business scenarios become increasingly complex, the complexity of query requirements continues to rise, and the scale of business logic orchestration has also expanded rapidly. In order to address the problem of high logic orchestration complexity in complex query scenarios, the industry often introduces data query components, which allow low-code developers to directly write SQL statements to implement data queries. With this method, when dealing with complex query requirements, developers only need to orchestrate the data query component logic and provide structured query statements (Structured Query Language, SQL), avoiding the combined use of a large number of logic components and effectively reducing the complexity of visual orchestration logic.

[0003] However, the above solution has obvious drawbacks. Directly exposing the SQL statement writing to developers means that the underlying technical details of the database are fully presented to the user's field of view. This solution is highly dependent on the developer's own SQL technical level. For low-code developers who are not familiar with SQL syntax and database operations, it undoubtedly greatly increases the usage threshold and hinders the convenience advantage of low-code development. At the same time, from the perspective of low-code platform design, due to the uneven SQL writing capabilities of developers, the application quality of the data query components using this solution is difficult to control, which may lead to problems such as inefficient data query and statement errors, affecting the quality and stability of the entire low-code platform development project.

[0004] In summary, existing query statement generation methods have the problems of high professional requirements and generation difficulty, large human resource requirements, and low speed and efficiency of query statement generation operations. Summary of the Invention

[0005] The present invention provides a query statement generation method, device, equipment, medium and product based on an object query language, which can solve the problems of existing query statement generation methods, such as high professional requirements and generation difficulty, large human resource requirements, and low speed and efficiency of query statement generation operations.

[0006] In a first aspect, an embodiment of the present invention provides a method for generating a query statement based on an object query language, the method comprising:

[0007] Obtain target data and generate a low-code syntax tree matching the target data;

[0008] Generate query conditions in response to at least one data query operation of a user, and use an object query language to update feature segments of the low-code syntax tree based on the query conditions to obtain a query syntax tree;

[0009] The query syntax tree is parsed based on a preset language parser to obtain target query statements that match each data query operation.

[0010] In a second aspect, an embodiment of the present invention provides a query statement generation device based on an object query language, the device comprising:

[0011] A data acquisition module, configured to acquire target data and generate a low-code syntax tree matching the target data;

[0012] A code update module, configured to generate query conditions in response to at least one data query operation of a user, and update a feature segment of the low-code syntax tree based on the query conditions using an object query language to obtain a query syntax tree;

[0013] The statement generation module is used to parse the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation.

[0014] In a third aspect, an embodiment of the present invention provides an electronic device, comprising:

[0015] at least one processor; and

[0016] a memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for generating a query statement based on an object query language according to any embodiment of the present invention.

[0018] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer instructions, which are used to enable a processor to implement a query statement generation method based on an object query language as described in any embodiment of the present invention when executed.

[0019] In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements a query statement generation method based on an object query language as described in any embodiment of the present invention.

[0020] The technical solution of an embodiment of the present invention first obtains target data and generates a low-code syntax tree matching the target data, then generates each query condition in response to at least one data query operation of the user, and uses the object query language to update the feature fragments of the low-code syntax tree based on each query condition to obtain a query syntax tree, and finally parses the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation respectively. It solves the problems of existing query statement generation methods such as high professional requirements and generation difficulty, large human resource requirements, and low speed and efficiency of query statement generation operations, realizes the generation of query statements in object query language format, reduces the professionalism and generation difficulty of query statement generation operations, and at the same time improves the speed and efficiency of query statement generation operations, saving human resources.

[0021] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 This is a flowchart of a method for generating a query statement based on an object query language according to a first embodiment of the present invention;

[0024] Figure 2 is a flowchart of a method for generating a query statement based on an object query language according to a second embodiment of the present invention;

[0025] Figure 3 1 is a schematic diagram of the structure of a query statement generating device based on an object query language according to a third embodiment of the present invention;

[0026] Figure 4 The present invention is a schematic structural diagram of an electronic device for implementing a method for generating query statements based on an object query language according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first," "second," and the like in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the numbers used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, any variations of the terms "including" and "having" are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.

[0029] Example 1

[0030] Figure 1 A flowchart of a method for generating a query statement based on an object query language is provided in a first embodiment of the present invention. This embodiment is applicable to the case of generating a query statement in an object query language format. The method can be performed by an object query language-based query statement generation device. The object query language-based query statement generation device can be implemented in the form of hardware and / or software. The object query language-based query statement generation device can be configured in a terminal or server having a query statement generation function based on the object query language.

[0031] like Figure 1 As shown, the method includes:

[0032] S110. Obtain target data and generate a low-code syntax tree that matches the target data.

[0033] Among them, the low-code syntax tree includes: feature fragments connected in sequence according to the logical order of the target data and business data codes for each loading business.

[0034] Specifically, the target data is obtained and a low-code syntax tree matching the target data is generated, including: using the object-relational mapping method to map the target data into entity data; mapping the entity data through preset entity structure extraction rules to obtain an entity model; converting the entity model into an object query language to obtain a low-code syntax tree matching the target data.

[0035] For example, in a low-code development scenario, obtaining the target data and generating a matching low-code syntax tree requires a combination of object-relational mapping ideas and domain-specific language (DSL) technology. The specific process is as follows: First, through the object-relational mapping method, the data table structure where the target data is located is mapped to entity data. For example, the fields of the "user table" in the target data (such as user ID, name, email) are mapped to entity objects containing attributes (field names) and types (integer, string, etc.) to achieve data conversion from a relational model to an object model. Then, the entity data is secondary mapped using the preset entity structure extraction rules. The rules usually define the extraction logic of entity names, attribute fields, and data types to form a structured entity model that describes the data structure in the form of a DSL. Finally, the entity model is converted into Object Query Language (OQL). By dragging the entity to the query component, checking fields, and other operations in the low-code visual environment, the structural information of the entity model is converted into the query target object, conditions, and result set descriptions in the OQL statement. For example, a DSL fragment containing the "OqlQuery" concept, data source UID, and specific query logic "code" field is generated, and finally a low-code syntax tree is formed by connecting feature fragments and business data codes in a logical order.

[0036] Furthermore, building on the above steps, the business data code is code that matches the business loaded into the system. For example, in a low-code visual development environment, query conditions and query result set codes are formed by selecting fields of dragged entity objects. These codes directly correspond to the operational logic of data screening and extraction for specific businesses. Feature fragments are OQL fragments added to the target data in response to the user's query statement generation operation. These are the parts of the DSL that represent the developer's use of data query components to participate in logical orchestration. They are used to identify the introduction of query actions and provide an abstract description of the basic query logic.

[0037] It should be noted that since the method of generating new OQL fragment data in response to user operations based on DSL technology and converting target data into a matching low-code syntax tree in a DSL scenario is a mature existing technology, this embodiment only introduces its implementation steps above, and its generation and operation principles are not elaborated here.

[0038] S120. Generate each query condition in response to at least one data query operation of the user, and use the object query language to update the feature fragments of the low-code syntax tree based on each query condition to obtain a query syntax tree.

[0039] Among them, each query condition is generated in response to at least one data query operation of the user, including: in response to the user's target business selection operation, obtaining a pre-set business information table that matches the target business; in response to the user's selection operation of at least one business information in the business information table, generating a query object set; generating a query address based on the target business, and generating query content based on the query object set; aggregating the query content and query address to obtain a query condition that matches the data query operation.

[0040] For example, when a user performs a data query operation, the system first responds to the target business selection operation. For example, the user selects the "Customer Order Query" business in the visual interface. At this time, the system retrieves the matching business information table from the preset business model. The table contains business fields such as order number, customer name, order time, and their associated relationships. Then, the user selects specific fields in the business information table by checking or dragging (such as checking "Customer Name" and "Order Time"), and the system generates a query object set containing the selected fields, such as ["Customer Name", "Order Time"], which is used to identify the data dimensions that need to be queried. Subsequently, the system generates a query address (such as a data source unique identifier) ​​based on the data source configuration of the target business. <uid>), and convert the query object set into structured query content. Finally, the system aggregates the query content and query address into a complete query condition, such as forming a query condition containing "dataSource":" <uid>The DSL fragment of "(query address) and "code":"..."(query content) implements a structured description of the user's query intention.

[0041] Furthermore, the object query language is used to update the feature fragments of the low-code syntax tree based on each query condition, including: obtaining query conditions that match each data query operation respectively, the query conditions including query content and query address; generating query fragments in the object query language format that match each query condition respectively; inserting each query fragment into the feature fragment according to the node positioning rule to update the feature fragment of the low-code syntax tree.

[0042] Specifically, when using the object query language, that is, OQL, to update the feature fragment, the system first parses the query conditions corresponding to each data query operation, and extracts the query content (such as field filtering, conditional expressions) and query address (data source identifier). For example, for the operation of "querying the name of customers who placed orders after January 2025", the query content in the query condition is "SELECT customer name FROM order table WHERE order time > '2025-01-01'", and the query address is the data source UID corresponding to the order table. Subsequently, the system converts the query conditions into query fragments in the object query language format according to the preset OQL grammar rules. Finally, the query fragment is inserted into the feature fragment of the low-code syntax tree through the node positioning rule, and the original entity structure or query logic description is updated to form a query syntax tree containing the complete query logic. This process avoids the technical threshold of users directly writing query statements through the dynamic mapping of visual operations and OQL, while ensuring that the query logic is integrated into the business process of the low-code application in a structured manner.

[0043] It should be noted that the specific content of the above node positioning rules can be set by developers according to actual implementation scenarios, and this embodiment does not impose any restrictions on this.

[0044] S130: Parse the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation.

[0045] Optionally, after parsing the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation, the method further includes: performing syntax verification on the target query statement based on preset syntax verification rules; after the syntax verification of the target query statement passes, generating a query instruction that matches the target query statement based on a data source pre-configured by the user.

[0046] On the basis of the above steps, illustratively, after the low-code platform completes the construction of the query syntax tree, it is necessary to convert the abstract query logic into executable database instructions through the language parsing and verification mechanism. The specific implementation is as follows: First, the system calls the preset language parser to parse the query syntax tree. In this embodiment, the language parser can be specifically an OQL parser. The parser converts the query syntax tree containing the OQL fragment into a target query statement based on predefined grammar rules. The grammar rules can be lexical analysis rules, syntax analysis rules, etc., which can be set by the developer according to actual needs. This embodiment does not limit this. For example, if the OQL fragment in the query syntax tree is {"concept":"OqlQuery","dataSource":"order_db","code":"SELECT customer name FROM order table WHERE order time>'2025-01-01'"}, the parser identifies keywords and identifiers through the lexical analyzer, builds a syntax tree through the syntax analyzer, and finally generates the corresponding target query statement SELECTcustomer_nameFROMordersWHEREorder_time>'2025-01-01'. After the parsing is completed, the system verifies the target query statement based on the preset syntax verification rules. The syntax verification rules cover database dialect compatibility, field existence, keyword legitimacy, etc. For example, if SELECT*FROMorder appears in the target query statement, the verification rules will identify the error and prompt the user to correct it. If the verification passes, the system further generates a query instruction based on the data source information pre-configured by the user (such as database type, connection address, authentication credentials, etc.). In this embodiment, the data source configuration is usually stored in JSON format, including

[0047] "type":"mysql","host":"localhost","port":3306,"database":"order_db" and other information. The system combines the target query statement with the data source connection parameters to generate a directly executable target query statement, that is, an SQL statement, and finally submits it to the database to execute the query operation.

[0048] The above process ensures that the query logic generated by the low-code platform complies with grammatical specifications and can accurately connect to the underlying database through chain processing of parsing, verification and binding with data sources, while avoiding users from being exposed to complex SQL syntax and ensuring the accuracy and reliability of data queries.

[0049] The technical solution of an embodiment of the present invention first obtains target data and generates a low-code syntax tree matching the target data, then generates various query conditions in response to at least one data query operation of the user, and uses an object query language to update the feature fragments of the low-code syntax tree based on each query condition to obtain a query syntax tree, and finally parses the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation, thereby realizing the generation of query statements in the object query language format, reducing the professionalism and generation difficulty of the query statement generation operation, and at the same time improving the speed and efficiency of the query statement generation operation, saving human resources.

[0050] Example 2

[0051] Figure 2 A flowchart of a query statement generation method based on an object query language is provided in the second embodiment of the present invention. This embodiment is refined based on the above embodiment. In this embodiment, the method of parsing the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation is specifically refined.

[0052] like Figure 2 As shown, the method includes:

[0053] S210. Obtain target data and generate a low-code syntax tree that matches the target data.

[0054] Among them, the low-code syntax tree includes: feature fragments connected in sequence according to the logical order of the target data and business data codes for each loading business.

[0055] Specifically, the feature fragment is the OQL fragment data added to the target data in response to the user's query statement generation operation. It is the part of the DSL used to indicate that the developer uses the data query component to participate in the logic arrangement. It is used to identify the introduction of the query action and the abstract description of the basic query logic. Furthermore, relevant personnel in this field should know that according to the generation rules of OQL fragment data, the feature fragment contains the "code" field.

[0056] S220. Generate each query condition in response to at least one data query operation of the user, and use the object query language to update the feature fragments of the low-code syntax tree based on each query condition to obtain a query syntax tree.

[0057] S230: Parse the characteristic segments in the query syntax tree using a preset language parser to obtain query conditions that match each data query operation.

[0058] Based on the above steps, the language parser first uses a lexical analyzer to break down the "code" field in the feature segment into keywords, identifiers, and operands. The parser then verifies the validity of the statement structure according to OQL syntax rules, ultimately extracting the query condition. For example, if the "code" feature segment is "SELECT employee.name FROM employee WHERE department.name = 'Technology Department'," the parser will identify the query target as the "name" field of the "employee" entity and the query condition as "department name equals technology department." It then encapsulates this information into structured data containing the query content and query address, and outputs it as the query condition.

[0059] S240: Based on the query address in the query condition, locate the loading service matching the data query operation in the query syntax tree.

[0060] For example, the query address in a query condition typically corresponds to a unique identifier for the data source, identifying the underlying data source (e.g., a database instance or table) targeted by the data query. The system uses this identifier to retrieve the associated loading business within the query syntax tree. For example, an "employee information query" business might be associated with the "employee table" data source. This location is based on the hierarchical relationships within the DSL. For example, in the DSL, the entity model for the loading business is bound to the query address via the "dataSource" field. The system then matches the identifier to the corresponding entity definition, thereby determining the loading business corresponding to the query operation.

[0061] S250: Obtain query information based on the query condition of the data query operation and the business data code of the loading business.

[0062] The query conditions include the filtering logic defined by the user through visual operations, and the business data code for loading the business is a predefined code snippet that matches the business scenario. The system combines the two and converts the business fields in the query conditions into physical fields of the underlying database through field mapping rules. For example, if the query condition is "department.name = 'Technology Department'", and "department.name" in the business data code corresponds to the database field "dept_name", then after conversion, {"db_table":"employees","db_fields":["employee_name"],"where_clause":

[0063] Query information for "dept_name = 'Technology Department'"}.

[0064] S260: Use a preset language translator to convert the query information into a target query statement in a preset format.

[0065] Based on the above steps, the preset language translator converts the query information into the corresponding target query statement according to the structure of the query information and the target database dialect, which can be specifically an SQL statement in this embodiment. The translator splices the statements through pre-defined template rules (such as OQL to SQL mapping rules), fills in the fields, table names, and conditions in the query information, and generates an SQL statement. This process shields the grammatical differences between different databases through an abstract semantic conversion layer, so that low-code developers do not need to pay attention to the underlying technical details, and can directly complete the query logic definition across data sources through visual operations.

[0066] The technical solution of an embodiment of the present invention first obtains target data and generates a low-code syntax tree matching the target data, then generates each query condition in response to at least one data query operation of the user, and uses the object query language to update the feature fragments of the low-code syntax tree based on each query condition to obtain a query syntax tree, then uses a preset language parser to parse the feature fragments in the query syntax tree to obtain query conditions that match each data query operation respectively, and based on the query address in the query condition, locates the loading business that matches the data query operation in the query syntax tree, then obtains query information based on the query condition of the data query operation and the business data code of the loading business, and finally uses a preset language translator to convert the query information into a target query statement in a preset format, thereby realizing the generation of query statements in the object query language format, reducing the professionalism and generation difficulty of the query statement generation operation, and at the same time improving the speed and efficiency of the query statement generation operation, saving human resources.

[0067] Example 3

[0068] Figure 3 This is a schematic diagram of the structure of a query statement generation device based on an object query language provided in the third embodiment of the present invention. Figure 3 As shown, the device includes:

[0069] A data acquisition module 310 is used to acquire target data and generate a low-code syntax tree matching the target data;

[0070] A code update module 320 is configured to generate query conditions in response to at least one data query operation of a user, and to update feature segments of the low-code syntax tree based on the query conditions using an object query language to obtain a query syntax tree;

[0071] The statement generation module 330 is used to parse the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation.

[0072] The technical solution of an embodiment of the present invention first obtains target data and generates a low-code syntax tree matching the target data, then generates various query conditions in response to at least one data query operation of the user, and uses an object query language to update the feature fragments of the low-code syntax tree based on each query condition to obtain a query syntax tree, and finally parses the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation, thereby realizing the generation of query statements in the object query language format, reducing the professionalism and generation difficulty of the query statement generation operation, and at the same time improving the speed and efficiency of the query statement generation operation, saving human resources.

[0073] Based on the above embodiment, the code update module 320 includes:

[0074] A query condition acquisition unit, configured to acquire query conditions that match each data query operation, wherein the query conditions include query content and query address;

[0075] A query fragment generating unit, configured to generate query fragments in an object query language format that match each query condition;

[0076] A fragment insertion unit is used to insert each query fragment into the feature fragment according to the node positioning rule to update the feature fragment of the low-code syntax tree.

[0077] Based on the above embodiment, the data acquisition module 310 includes:

[0078] A data mapping unit, configured to map target data into entity data using an object-relational mapping method;

[0079] A structure extraction unit, configured to map the entity data using a preset entity structure extraction rule to obtain an entity model;

[0080] A model conversion unit is used to convert the entity model into an object query language to obtain a low-code syntax tree that matches the target data.

[0081] Based on the above embodiment, the statement generation module 330 includes:

[0082] A condition generation unit is used to parse the feature fragments in the query syntax tree through a preset language parser to obtain query conditions that match each data query operation;

[0083] a service locating unit, configured to locate, in the query syntax tree, a loading service matching the data query operation based on a query address in the query condition;

[0084] a query information acquisition unit, configured to obtain query information based on a query condition of the data query operation and a service data code of the loading service;

[0085] The sentence translation unit is used to convert the query information into a target query sentence in a preset format using a preset language translator.

[0086] Based on the above embodiment, the code update module 320 includes:

[0087] An information table acquisition unit, configured to acquire a preset service information table matching the target service in response to a user's target service selection operation;

[0088] An object set generating unit, configured to generate a query object set in response to a user's selection operation on at least one piece of business information in the business information table;

[0089] A query content generating unit, configured to generate a query address based on the target service and generate query content based on the query object set;

[0090] The data aggregation unit is used to aggregate the query content and the query address to obtain a query condition that matches the data query operation.

[0091] Based on the above embodiment, the statement generation module 330 is further used to: parse the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation, and then perform syntax verification on the target query statements based on preset syntax verification rules; after the syntax verification of the target query statements passes, generate query instructions that match the target query statements based on a data source pre-configured by the user.

[0092] The object query language-based query statement generation device provided in the embodiment of the present invention can execute the object query language-based query statement generation method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0093] Example 4

[0094] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.

[0095] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12 and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0096] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0097] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for generating query statements based on an object query language.

[0098] Accordingly, the method includes:

[0099] Obtain target data and generate a low-code syntax tree matching the target data;

[0100] Generate query conditions in response to at least one data query operation of a user, and use an object query language to update feature segments of the low-code syntax tree based on the query conditions to obtain a query syntax tree;

[0101] The query syntax tree is parsed based on a preset language parser to obtain target query statements that match each data query operation.

[0102] In some embodiments, a method for generating a query statement based on an object query language can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for generating a query statement based on an object query language described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute a method for generating a query statement based on an object query language by any other appropriate means (for example, by means of firmware).

[0103] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0104] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0105] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0106] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0107] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0108] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.

[0109] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.< / uid> < / uid>

Claims

1. A method for generating a query statement based on an object query language, characterized in that: include: Obtain target data and generate a low-code syntax tree matching the target data; Generate query conditions in response to at least one data query operation of a user, and use an object query language to update feature segments of the low-code syntax tree based on the query conditions to obtain a query syntax tree; The query syntax tree is parsed based on a preset language parser to obtain target query statements that match each data query operation.

2. The method according to claim 1, characterized in that The low-code syntax tree includes: feature fragments connected in sequence according to the logical order of target data and business data codes for each loaded business.

3. The method according to claim 1, characterized in that Using an object query language to update a feature fragment of the low-code syntax tree based on each query condition, including: Obtain query conditions that match each data query operation, wherein the query conditions include query content and query address; Generate query fragments in an object query language format that match each query condition; Each query fragment is inserted into the feature fragment according to the node positioning rule to update the feature fragment of the low-code syntax tree.

4. The method according to claim 1, wherein Obtain target data and generate a low-code syntax tree matching the target data, including: Use object-relational mapping to map target data into entity data; Mapping the entity data using a preset entity structure extraction rule to obtain an entity model; The entity model is converted into an object query language to obtain a low-code syntax tree that matches the target data.

5. The method according to any one of claims 1-2, characterized in that Parse the query syntax tree based on the preset language parser to obtain target query statements that match each data query operation, including: The feature fragments in the query syntax tree are parsed by a preset language parser to obtain query conditions that match each data query operation; Based on the query address in the query condition, locating a loading service matching the data query operation in the query syntax tree; Obtaining query information based on a query condition of the data query operation and a business data code of the loading business; A preset language translator is used to convert the query information into a target query statement in a preset format.

6. The method according to claim 1, characterized in that Generating query conditions in response to at least one data query operation of a user includes: In response to a user's target service selection operation, obtaining a preset service information table matching the target service; In response to a user's selection operation on at least one piece of business information in the business information table, generating a query object set; Generate a query address based on the target business, and generate query content based on the query object set; The query content and the query address are aggregated to obtain a query condition that matches the data query operation.

7. The method according to claim 1, characterized in that After parsing the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation, the following steps are also included: Performing syntax checking on the target query statement based on preset syntax checking rules; After the syntax check of the target query statement passes, a query instruction matching the target query statement is generated based on a data source pre-configured by the user.

8. A query statement generating device based on object query language, characterized in that: include: A data acquisition module, configured to acquire target data and generate a low-code syntax tree matching the target data; A code update module, configured to generate query conditions in response to at least one data query operation of a user, and update a feature segment of the low-code syntax tree based on the query conditions using an object query language to obtain a query syntax tree; The statement generation module is used to parse the query syntax tree based on a preset language parser to obtain target query statements that match each data query operation.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for generating query statements based on an object query language according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a query statement generation method based on an object query language according to any one of claims 1 to 7 when executed.