Method, apparatus, computer device, and readable storage medium for generating business engine instances
By obtaining and processing the expression information of the target business and determining the structured query language and rule templates, the problem of difficulty in building complex business engine instances in the existing technology is solved, and efficient multi-table joint query and logical judgment functions are realized.
Patent Information
- Application Number
- CN202411170891.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-23
- Publication Date
- 2025-06-10
- Estimated Expiration
- 2044-08-23
AI Technical Summary
It is difficult for existing low-code service engines to build complex business engine instances, especially services involving multi-table joint query and accompanying logical judgment.
By obtaining the expression information of the target service in the set format, determining the target structured query language and rule template, and combining the pre-set rule base, a business engine instance is generated.
It improves the ability of multi-table joint query, and can effectively build complex business engine instances, including business functions with logical judgment.
Smart Images

Figure CN119046304B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer processing technologies, and particularly to a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating business engine instances. Background Art
[0002] The low-code server side is a technology platform that simplifies the backend development process. It aims to enable developers and non-developers to build and integrate business functions more quickly through graphical interfaces and pre-built modules. The emergence of the low-code server side meets the needs of modern enterprises for rapid, efficient, and flexible development.
[0003] Currently, business engines on the low-code server side mainly build relatively basic business engine instances through templates and the Object Relational Mapping (ORM) framework. However, for complex businesses involving joint queries of multiple tables and accompanying logical judgments, the existing processing methods of business engines are difficult to build corresponding engine instances for complex businesses. Summary of the Invention
[0004] Based on this, in view of the above technical problems, it is necessary to provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for generating business engine instances.
[0005] In a first aspect, this application provides a method for generating a business engine instance, including:
[0006] Obtain the expression information of the target business in a set format;
[0007] Determine the target Structured Query Language (SQL) according to the first type of data in the expression information; the source of the first type of data is the data set of the joint query of multiple tables;
[0008] Obtain a rule template according to the information other than the first type of data in the expression information and a preset rule library;
[0009] Obtain the engine instance of the target business according to the rule template and the target Structured Query Language (SQL).
[0010] In one of the embodiments, the step of determining the target Structured Query Language (SQL) according to the first type of data in the expression information includes:
[0011] Obtain a Structured Query Language (SQL) generator;
[0012] Input the first type of data into the Structured Query Language (SQL) generator, so that the Structured Query Language (SQL) generator parses the first type of data to obtain the target Structured Query Language (SQL).
[0013] In one embodiment, obtaining a rule template according to the information other than the first type of data in the expression information and a preset rule base includes:
[0014] Determining a plurality of node identifiers, a second type of data, and a plurality of rule expressions in the information other than the first type of data in the expression information; the source of the second type of data is a data set that is not a multi-table joint query;
[0015] Comparing the plurality of rule expressions with the rules in the preset rule base respectively to obtain the rules respectively matched by the plurality of rule expressions;
[0016] Integrating the rules respectively matched by the plurality of rule expressions, the plurality of node identifiers, and the second type of data to obtain a rule template.
[0017] In one embodiment, integrating the rules respectively matched by the plurality of rule expressions, the plurality of node identifiers, and the second type of data to obtain a rule template includes:
[0018] Sequentially taking the plurality of rule expressions as to-be-processed rule expressions;
[0019] Obtaining a partial rule template corresponding to the to-be-processed rule expression according to the node identifier and the second type of data associated with the to-be-processed rule expression;
[0020] Obtaining a rule template according to the partial rule templates respectively corresponding to the plurality of rule expressions.
[0021] In one embodiment, comparing the plurality of rule expressions with the rules in the preset rule base respectively to obtain the rules respectively matched by the plurality of rule expressions includes:
[0022] Sequentially taking the plurality of rule expressions as to-be-processed rule expressions;
[0023] Obtaining a rule comparison sequence according to the comparison priorities of the rules in the preset rule base; the higher the comparison priority of a rule, the more forward the order of the rule in the rule comparison sequence;
[0024] Comparing each rule in the rule base with the to-be-processed rule expression sequentially according to the rule comparison sequence to obtain a comparison result;
[0025] Determining the rule matched by the to-be-processed rule expression according to the comparison result.
[0026] In one embodiment, before obtaining the rule comparison sequence according to the comparison priorities of the rules in the preset rule base, the method further includes:
[0027] Obtain the number of successful matches for each rule;
[0028] Determine the comparison priority of each rule according to the number of successful matches of each rule; the more successful matches a rule has, the higher its comparison priority.
[0029] In one embodiment, the obtaining the engine instance of the target service according to the rule template and the target structured query language includes:
[0030] Determine the filling position of the target structured query language in the rule template according to the node identifier associated with the first type of data and the position of the node identifier in the rule template;
[0031] Add the target structured query language to the rule template according to the filling position to obtain the engine instance of the target service.
[0032] In a second aspect, the present application further provides a device for generating a service engine instance, including:
[0033] An expression information acquisition module, configured to acquire the expression information of the target service in a set format;
[0034] A query language acquisition module, configured to determine a target structured query language according to the first type of data in the expression information; the source of the first type of data is a data set of a multi-table joint query;
[0035] A rule template acquisition module, configured to obtain a rule template according to the information other than the first type of data in the expression information and a preset rule library;
[0036] An engine instance acquisition module, configured to obtain the engine instance of the target service according to the rule template and the target structured query language.
[0037] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor executes the above method.
[0038] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and the computer program is executed by a processor to perform the above method.
[0039] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and the computer program is executed by a processor to perform the above method.
[0040] The method, apparatus, computer device, computer-readable storage medium, and computer program product for generating the above-mentioned business engine instance obtain the expression information of the target business in a set format; determine the target structured query language according to the first type of data in the expression information; the source of the first type of data is the data set of a multi-table joint query; obtain a rule template according to the information other than the first type of data in the expression information and a preset rule library; obtain the engine instance of the target business according to the rule template and the target structured query language. In this engine instance, the first type of data whose source is the data set of a multi-table joint query is expressed and described by the target structured query language. Compared with directly constructing the engine instance of the target business with the first type of data itself, this method improves the multi-table joint query ability; moreover, the information other than the first type of data in the expression information of the target business obtains the corresponding rule template by means of the preset rule library. When the information other than the first type of data in the expression information contains attached logical judgments, the corresponding rule template can also be obtained in this way, and then the engine instance of the target business can be constructed in combination with the foregoing target structured query language. Brief Description of the Drawings
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can also be obtained based on these drawings.
[0042] Figure 1 It is a schematic flowchart of the method for generating a business engine instance in an embodiment;
[0043] Figure 2 It is a schematic flowchart of the target business in an embodiment;
[0044] Figure 3 It is a structural block diagram of the device for generating a business engine instance in an embodiment;
[0045] Figure 4 It is an internal structure diagram of a computer device in an embodiment. Detailed Description of the Embodiments
[0046] In order to make the purpose, technical solutions, and advantages of the present application clearer, the following further details the present application in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] An embodiment of the present application provides a method for generating a business engine instance. This embodiment can be executed by the business engine of a computer device. The business engine of the computer device can obtain the expression information of a target business in a set format, and then obtain the engine instance of the target business. It can be understood that the computer device can be implemented by a server, or by a terminal, or by an interaction system of a terminal and a server. In this embodiment, the method includes Figure 1 the steps shown:
[0048] Step S101, obtain the expression information of the target business in a set format.
[0049] If a certain type of business involves at least one of joint query of multiple tables and incidental logical judgment, this type of business belongs to a complex business, and this type of business can be used as the target business.
[0050] The set format can be the JavaScript Object Notation (JSON) format. Among them, JSON is a lightweight data exchange format. It uses text to represent objects, arrays, strings, numbers, boolean values (true, false), and null values (null). JSON is easy for humans to read and write, and is also easy for machines to parse and generate.
[0051] The target business can be converted into the expression information in the set format. Specifically, the target business is converted into the expression information in the JSON format. The expression information in the JSON format includes several node identifiers (the current node identifier and the next node identifier), several regular expressions, and context data.
[0052] The current node identifier (which can also be called the current node id) is a unique identifier that can be read by routing from the previous node. In addition, the business engine can read the node information and execute it.
[0053] The next node identifier (which can also be called the next node id) is a unique identifier that can be read by routing from the previous node. In addition, the business engine can read the node information and execute it. When an "if...else..." rule appears, there will be two next node identifiers.
[0054] The regular expression corresponds to the process direction of the business, usually including conditional judgment, loop, multi-branch, jump and other modes, and also includes expressions corresponding to data.
[0055] There are corresponding specific data for specific variables in the business process context. This data can become context data. The source of the context data is a constant or the output parameter of a certain node.
[0056] Step S102: Determine the target Structured Query Language based on the first type of data in the expression information; the source of the first type of data is the dataset of a multi-table joint query.
[0057] According to the data source, the context data in the expression information can be divided into two types of data. The source of the first type of data is the dataset of a multi-table joint query, and the source of the second type of data is the dataset of a non-multi-table joint query.
[0058] The first type of data can be obtained from the expression information. Based on the first type of data, the corresponding Structured Query Language can be obtained, and this Structured Query Language is called the target Structured Query Language. Among them, Structured Query Language (SQL) is a programming language used to manage relational databases. The Structured Query Language allows users to operate on complex database structures through simple statements without having to deeply understand the specific details of data in physical storage.
[0059] Step S103: Obtain a rule template based on the information other than the first type of data in the expression information and a preset rule library.
[0060] The rule library can be preset according to the actual situation. The rule library includes several business rules. Specifically, a set of business rules can be defined. The expression forms of the business rules are, for example, if...else..., for, break, continue, and switch...case.... These business rules can be used to guide business decisions. After the business rules are defined, they can be loaded into the rule library of the business engine and wait to be executed.
[0061] The information other than the first type of data in the expression information (which can be called non-first-type data information) can be input into the business engine. After receiving the above non-first-type data information, the business engine stores the above non-first-type data information in the working memory so that the business engine can interact with the above data. Based on the preset rule library in the business engine and the above non-first-type data information, a rule template can be obtained.
[0062] Step S104: Obtain an engine instance based on the rule template and the target Structured Query Language.
[0063] The target Structured Query Language can be added to the rule template, and an engine instance can be obtained based on the added rule template.
[0064] After obtaining the engine instance, a unique identifier can be assigned to the engine instance, and the engine instance can be referenced by the service through the unique identifier. The engine instance can be encapsulated as a service according to a predefined template. The encapsulated service can be wrapped as a Remote Procedure Call (RPC) service through existing technologies such as the declarative Hypertext Transfer Protocol client (Feign) and the Dynamic Naming and Configuration Service (Nacos), so as to facilitate the remote call of the encapsulated service by the user.
[0065] In the above method for generating the business engine instance, according to the first type of data in the dataset whose source is a multi-table joint query, the target Structured Query Language (SQL) is obtained, improving the multi-table joint query ability; according to the information other than the first type of data in the expression information and a preset rule library, a rule template is obtained; according to the rule template and the target SQL, an engine instance can be obtained, and the construction of a complex engine instance with logical judgment can be completed, thus completing the construction of a complex business function with logical judgment.
[0066] In one embodiment, according to the first type of data in the expression information, the target SQL is determined, and the specific steps are as follows: obtain an SQL generator; input the first type of data into the SQL generator so that the SQL generator parses the first type of data to obtain the target SQL.
[0067] An SQL generator, which can also be called an SQL generator, is a tool or program designed to help users automatically generate structured query statements and is usually used to simplify database operations.
[0068] The first type of data can be input into the SQL generator so that the SQL generator parses the first type of data to obtain the target SQL corresponding to the first type of data.
[0069] In this embodiment, inputting the first type of data into the SQL generator so that the SQL generator parses the first type of data to obtain the target SQL simplifies the operation of multi-table joint query, thus improving the multi-table joint query ability.
[0070] In one embodiment, a rule template is obtained according to the information other than the first type of data in the expression information and a preset rule library. The specific steps are as follows: In the information other than the first type of data in the expression information, several node identifiers, a second type of data, and several rule expressions are determined; the source of the second type of data is a data set that is not a multi-table joint query; the several rule expressions are respectively compared with the rules in the preset rule library to obtain the rules respectively matched by the several rule expressions; the rules respectively matched by the several rule expressions, the several node identifiers, and the second type of data are integrated to obtain a rule template.
[0071] The expression information includes several node identifiers, several rule expressions, and context data. Among them, according to the data source, the context data in the expression information can be divided into two types of data. The source of the first type of data is a data set of multi-table joint query, and the source of the second type of data is a data set that is not a multi-table joint query.
[0072] A pattern matcher can be used to compare the several rule expressions with the rules in the preset rule library to obtain the rules respectively matched by the several rule expressions. Through the definition of nodes, it can be ensured that the nodes for subsequent execution of the rules can uniquely match the results of the current rule expressions.
[0073] The rules respectively matched by the several rule expressions, the several node identifiers, and the second type of data can be integrated to obtain a rule template.
[0074] In this embodiment, the rules respectively matched by the several rule expressions, the several node identifiers, and the second type of data are integrated to obtain a rule template, and the business logic with logical judgment is transformed into a rule template that is easy to generate an engine instance, which is convenient for the construction of subsequent complex engine instances with logical judgment.
[0075] In one embodiment, the rules respectively matched by the several rule expressions, the several node identifiers, and the second type of data are integrated to obtain a rule template. The specific steps are as follows: The several rule expressions are sequentially used as the to-be-processed rule expressions; according to the node identifiers and the second type of data associated with the to-be-processed rule expressions, a partial rule template corresponding to the to-be-processed rule expression is obtained; according to the partial rule templates respectively corresponding to the several rule expressions, a rule template is obtained.
[0076] The expression information includes several node identifiers, several rule expressions, and context data. Among them, according to the data source, the context data in the expression information can be divided into two types of data. The source of the first type of data is a data set of multi-table joint query, and the source of the second type of data is a data set that is not a multi-table joint query.
[0077] Such as Figure 2As shown, the current node identifier of service node 1 is 1, the next node identifiers are 2 and 3, the rule expression is M, the input data of service node 1 is parameter A, corresponding service processing 1 is performed on parameter A to obtain output data, and the output data is parameter B. The next service node is judged according to the rule expression M of service node 1 and parameter B; when it is judged that the next service node is 2, the output data of service node 1 is used as the input data of the service node, corresponding service processing 2 is performed on parameter B to obtain output data, and the output data is parameter C, where the current node identifier of service node 2 is 2, the next node identifier is 4 (not marked in Figure 2 the figure), and the rule expression is N; when it is judged that the next service node is 3, the output data of service node 1 is used as the input data of the service node. The input data of service node 3 includes parameter B and the result of a combined query on Tables 1, 2, and 3. Corresponding service processing 3 is performed on parameter B and the result of the combined query on Tables 1, 2, and 3 to obtain output data, and the output data is parameter D; where the current node identifier of service node 3 is 3, the next node identifier is 4, and the rule expression is L.
[0078] The data source of the result of the combined query on Tables 1, 2, and 3 is the data set of the multi-table combined query. Therefore, the result of the combined query on Tables 1, 2, and 3 is divided into the first type of data; the data sources of parameter A, parameter B, parameter C, and parameter D are non-multi-table combined query data sets. Therefore, parameter A, parameter B, parameter C, and parameter D are divided into the second type of data.
[0079] For each node identifier, there are corresponding input data, output data, and rule expression, and according to the rule expression and the output data, it can be directed to the next node identifier. Therefore, there is an association relationship among these five elements: the node identifier, input data, output data, rule expression, and the next node identifier; in the above example, there is an association relationship among node identifiers 1 to 3, parameter A, parameter B, and rule expression M.
[0080] Exemplarily, the rule expression M is used as the rule expression to be processed; according to the node identifiers 1 to 3, parameter A, and parameter B associated with the rule expression M, the partial rule template corresponding to the rule expression M is obtained, where parameter A and parameter B belong to the second type of data; in the same way, the partial rule templates corresponding to the rule expressions N and L can be obtained, and according to the order relationship among the node identifiers associated with the rule expressions M, N, and L, the partial rule templates corresponding to several rule expressions are integrated to obtain the rule template.
[0081] In this embodiment, according to the node identifier and the second type of data associated with the rule expression to be processed, a partial rule template is obtained; the partial rule templates corresponding to several rule expressions are integrated to obtain a complete rule template, and the business logic with logical judgment is transformed into a rule template that is easy to generate an engine instance, which is convenient for the construction of complex engine instances with subsequent logical judgment.
[0082] In one of the embodiments, several rule expressions are respectively compared with the rules in a preset rule library to obtain the rules matched by each of the several rule expressions. The specific steps are as follows: sequentially use several rule expressions as the rule expressions to be processed; according to the comparison priorities of the rules in the preset rule library, obtain a rule comparison sequence; the higher the comparison priority of a rule, the earlier the rule is in the rule comparison sequence; according to the rule comparison sequence, sequentially compare each rule in the rule library with the rule expression to be processed to obtain a comparison result; according to the comparison result, determine the rule that matches the rule expression to be processed.
[0083] According to the matching situation of the rules, the comparison priorities of the rules in the preset rule library can be obtained to form a rule comparison sequence. The higher the comparison priority of a rule, the earlier the rule is in the rule comparison sequence.
[0084] Sequentially use several rule expressions as the rule expressions to be processed; according to the rule comparison sequence, sequentially compare each rule in the rule library with the rule expression to be processed through a pattern matcher to obtain a comparison result; where the comparison result can represent the matching degree between the rule in the rule library and the rule expression to be processed.
[0085] According to the comparison result, determine the rule that matches the rule expression to be processed. Specifically, when the comparison result represents that the matching degree of one of the rules in the rule library with the rule expression to be processed is higher than a threshold, determine this rule as the rule that matches the rule expression to be processed. When the comparison result represents that the matching degrees of multiple rules in the rule library with the rule expression to be processed are all higher than the threshold, determine the rule with the highest matching degree as the rule that matches the rule expression to be processed.
[0086] The preset rule library can be the rule library in the business engine. During the stage when the engine instance is called, the business engine executes the rules that match successfully in a certain priority order and performs corresponding operations according to the rules; after the business engine finishes execution, it will feedback the execution result to the caller so that the subsequent business process can make a response accordingly.
[0087] In this embodiment, a number of regular expressions are sequentially used as the to-be-processed regular expressions; according to the rule comparison sequence, each rule in the rule library is sequentially compared with the to-be-processed regular expression to obtain a comparison result; according to the comparison result, the rule that matches the to-be-processed regular expression is determined. The higher the comparison priority of the rule, the earlier the order of the rule in the rule comparison sequence, which improves the efficiency of determining the rule that matches the to-be-processed regular expression.
[0088] In one embodiment, before obtaining the rule comparison sequence according to the comparison priorities of the rules in the preset rule library, the method provided by the present application further includes: obtaining the number of successful matches of each rule; determining the comparison priority of each rule according to the number of successful matches of each rule; the more the number of successful matches of the rule, the higher the comparison priority of the rule.
[0089] The comparison priority of each rule can be determined according to the number of successful matches of each rule; the more the number of successful matches of the rule, the higher the matching probability of the rule is represented. The higher the matching probability of the rule, the higher the comparison priority of the rule. Thus, the rule with a high matching probability is preferentially compared with the to-be-processed regular expression, which improves the efficiency of determining the rule that matches the to-be-processed regular expression.
[0090] In one embodiment, an engine instance is obtained according to a rule template and a target structured query language. The specific steps are as follows: determining the filling position of the target structured query language in the rule template according to the node identifier associated with the first type of data and the position of the node identifier in the rule template; adding the target structured query language to the rule template according to the filling position to obtain an engine instance.
[0091] For each node in the target service, there is a corresponding node identifier. The position of the node identifier in the rule template can be determined through the node identifier.
[0092] For any first type of data, there is a corresponding target structured query language. The node identifier associated with the first type of data can be obtained according to the first type of data. Through the node identifier, the position of the node identifier in the rule template is determined, and the position of the node identifier in the rule template is determined as the filling position of the target structured query language in the rule template; adding the target structured query language to the rule template according to the filling position to obtain an engine instance.
[0093] Exemplarily, the target structured query language {Q} is obtained based on the first type of data (the input parameter is the result of a combined query on Tables 1, 2, and 3). The node identifiers associated with the first type of data (the input data is the result of a combined query on Tables 1, 2, and 3) are the current node identifier 3 and the next node identifier 4. According to the positions of the current node identifier 3 and the next node identifier 4 in the rule template, that is, the position of business node 3, the position of the input data of business node 3 is determined as the filling position of the target structured query language {Q} in the rule template; according to the filling position, the target structured query language {Q} is added to the rule template to obtain an engine instance.
[0094] In this embodiment, according to the node identifiers associated with the first type of data and the positions of the node identifiers in the rule template, the filling position of the target structured query language in the rule template is determined, and the target structured query language is added to the rule template. The added rule template can more accurately represent the business with logical judgments, facilitating the construction of complex engine instances with logical judgments.
[0095] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are shown in sequence according to the arrows, these steps do not necessarily need to be executed in the order indicated by the arrows. Unless there is a clear indication in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages do not necessarily need to be executed at the same time, but can be executed at different times. The execution order of these steps or stages does not necessarily need to be sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.
[0096] Based on the same inventive concept, an embodiment of the present application also provides a generation device for a business engine instance for implementing the above-described method for generating a business engine instance. The implementation solution provided by this device for solving problems is similar to the implementation solution described in the above method. Therefore, the specific limitations in one or more embodiments of the generation device for a business engine instance provided below can refer to the limitations on the method for generating a business engine instance in the above text, and will not be repeated here.
[0097] In an exemplary embodiment, as Figure 3 shown, a generation device for a business engine instance is provided, where:
[0098] An expression information acquisition module 301, configured to acquire expression information of a target business in a set format;
[0099] A query language acquisition module 302, configured to determine a target structured query language according to the first type of data in the expression information; the source of the first type of data is a data set of a multi-table joint query.
[0100] A rule template acquisition module 303, configured to obtain a rule template according to the information other than the first type of data in the expression information and a preset rule library.
[0101] An engine instance acquisition module 304, configured to obtain an engine instance according to the rule template and the target structured query language.
[0102] In one embodiment, the query language acquisition module 302 is further configured to: obtain a structured query language generator; input the first type of data into the structured query language generator, so that the structured query language generator parses the first type of data to obtain the target structured query language.
[0103] In one embodiment, the rule template acquisition module 303 is further configured to: determine a plurality of node identifiers, a second type of data, and a plurality of rule expressions in the information other than the first type of data in the expression information; the source of the second type of data is a data set of a non-multi-table joint query; respectively compare the plurality of rule expressions with the rules in the preset rule library to obtain the rules respectively matched by the plurality of rule expressions; integrate the rules respectively matched by the plurality of rule expressions, the plurality of node identifiers, and the second type of data to obtain a rule template.
[0104] In one embodiment, the rule template acquisition module 303 is further configured to: sequentially use the plurality of rule expressions as to-be-processed rule expressions; obtain a partial rule template corresponding to the to-be-processed rule expression according to the node identifier and the second type of data associated with the to-be-processed rule expression; obtain a rule template according to the partial rule templates respectively corresponding to the plurality of rule expressions.
[0105] In one embodiment, the rule template acquisition module 303 is further configured to: sequentially use the plurality of rule expressions as to-be-processed rule expressions; obtain a rule comparison sequence according to the comparison priorities of the rules in the preset rule library; the higher the comparison priority of a rule, the earlier the order of the rule in the rule comparison sequence; sequentially compare each rule in the rule library with the to-be-processed rule expression according to the rule comparison sequence to obtain a comparison result; determine the rule matched by the to-be-processed rule expression according to the comparison result.
[0106] In one embodiment, the apparatus further includes a comparison priority acquisition module, configured to: obtain the number of successful matches of each rule; determine the comparison priority of each rule according to the number of successful matches of each rule; the more the number of successful matches of a rule, the higher the comparison priority of the rule.
[0107] In one embodiment, the engine instance acquisition module 304 is further configured to: determine the filling position of the target structured query language in the rule template according to the node identifier associated with the first type of data and the position of the node identifier in the rule template; add the target structured query language to the rule template according to the filling position to obtain an engine instance.
[0108] Each module in the above apparatus for generating a service engine instance can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in the form of hardware or be independent of the processor, or be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0109] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as Figure 4 shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data of the method for generating a service engine instance. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements a method for generating a service engine instance.
[0110] Those skilled in the art can understand that Figure 4 the structure shown in
[0111] In one embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0112] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0113] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0114] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.
[0115] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., without limitation.
[0116] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope recorded in the present application.
[0117] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation to the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all fall within the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.
Claims
1. A method for generating a business engine instance, characterized in that: The method comprises: Obtain the expression information of the target business in a set format; Determine a target structured query language according to the first type of data in the expression information; the source of the first type of data is a data set of a multi-table joint query; In the information other than the first type of data in the expression information, a number of node identifiers, second type of data and a number of regular expressions are determined; the source of the second type of data is a data set that is not a multi-table joint query; Compare several regular expressions with the rules in a preset rule base respectively to obtain the rules that match the several regular expressions; Integrate the rules matched by the respective regular expressions, the node identifiers and the second type of data to obtain a rule template; Determine a filling position of the target structured query language in the rule template according to the node identifier associated with the first type of data and the position of the node identifier in the rule template; According to the filled position, the target structured query language is added to the rule template to obtain the engine instance of the target business.
2. The method according to claim 1, characterized in that The step of determining a target structured query language according to the first type of data in the expression information includes: Get the Structured Query Language Builder; The first type of data is input into the structured query language generator, so that the structured query language generator parses the first type of data to obtain the target structured query language.
3. The method according to claim 1, characterized in that The rule template is obtained by integrating the rules matched by the plurality of regular expressions, the plurality of node identifiers and the second type of data, including: Taking several regular expressions as regular expressions to be processed in turn; Obtaining a partial rule template corresponding to the rule expression to be processed according to the node identifier associated with the rule expression to be processed and the second type of data; A rule template is obtained according to partial rule templates corresponding to respective ones of a plurality of rule expressions.
4. The method according to claim 1, characterized in that: The method of comparing the plurality of regular expressions with the rules in the preset rule base to obtain the rules that the plurality of regular expressions match respectively includes: Taking several regular expressions as regular expressions to be processed in turn; According to the comparison priority of each rule in the pre-set rule base, a rule comparison sequence is obtained; the higher the comparison priority of a rule, the higher the order of the rule in the rule comparison sequence; According to the rule comparison sequence, each rule in the rule base is compared with the rule expression to be processed in turn to obtain a comparison result; According to the comparison result, a rule matching the regular expression to be processed is determined.
5. The method according to claim 4, characterized in that Before obtaining the rule comparison sequence according to the comparison priority of each rule in the preset rule base, the method further includes: Get the number of successful matches for each rule; The comparison priority of each rule is determined according to the number of successful matches of each rule; the more successful matches a rule has, the higher the comparison priority of the rule.
6. The method according to claim 4, characterized in that The step of determining a rule that matches the regular expression to be processed according to the comparison result includes: When the comparison result indicates that the matching degree between one of the rules in the rule base and the regular expression to be processed is higher than a threshold, the one of the rules is determined as a rule matching the regular expression to be processed; When the comparison result indicates that the matching degree between multiple rules in the rule base and the rule expression to be processed is higher than a threshold, the rule with the highest matching degree is determined as the rule matching the rule expression to be processed.
7. A device for generating a business engine instance, characterized in that: The device comprises: An expression information acquisition module is used to acquire the expression information of the target business in a set format; A query language acquisition module, used to determine a target structured query language according to the first type of data in the expression information; the source of the first type of data is a data set of a multi-table joint query; A rule template acquisition module is used to determine a number of node identifiers, a second type of data, and a number of rule expressions in the information other than the first type of data in the expression information; the source of the second type of data is a data set that is not a multi-table joint query; compare the several rule expressions with the rules in the pre-set rule library respectively to obtain the rules that the several rule expressions match; integrate the rules that the several rule expressions match, the several node identifiers, and the second type of data to obtain a rule template; An engine instance acquisition module is used to determine the filling position of the target structured query language in the rule template according to the node identifier associated with the first type of data and the position of the node identifier in the rule template; according to the filling position, the target structured query language is added to the rule template to obtain the engine instance of the target business.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Information system complex data query method and system
CN112035510A
Request processing method and device
CN115168389A