Rule engine file processing method and apparatus, service device, and storage medium
By generating main file code and dependency file code, the problem of low extensibility in rule engine file generation is solved, and efficient maintenance of rule engine files is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNITED NETWORK COMM GRP CO LTD
- Filing Date
- 2023-08-08
- Publication Date
- 2026-07-24
AI Technical Summary
In existing technologies, the extensibility of generated rule engine files is low, which increases the difficulty of maintaining rule engine files.
By receiving business logic data sent by user devices, and combining operator rules, main file templates, and dependency templates, the main file code and dependency file code are generated, avoiding errors during processing and improving the extensibility of the rule engine files.
It improves the extensibility of rule engine file generation and reduces the difficulty of maintaining rule engine files.
Smart Images

Figure CN117032650B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of rule engines, and more particularly to a method, apparatus, service device, and storage medium for processing rule engine files. Background Technology
[0002] Rule engine files can embed business rules into applications or systems to automate business processes. By defining and managing rule sets, related operations can be automatically triggered and executed at runtime based on specific conditions and logic.
[0003] In existing technologies, rule engine files corresponding to business rules are mainly generated by designing rule methods; the rule engine files are then tested, and the rule engine files that pass the tests are used as the final rule engine files.
[0004] However, this method in the existing technology reduces the scalability of the generated rule engine files and increases the difficulty of maintaining the rule engine files. Summary of the Invention
[0005] This application provides a method, apparatus, service device, and storage medium for processing rule engine files, in order to solve the technical problems of low scalability of rule engine file generation and high maintenance difficulty of rule engine files.
[0006] Firstly, this application provides a method for processing rule engine files, applied to a service device, including:
[0007] Receive business logic data sent by the user equipment, wherein the business logic data is generated by the user equipment in response to the user's visual orchestration operation on multiple operator elements and multiple relation elements based on business logic.
[0008] Based on the attributes of each operator element, placeholders for the passed parameters, operator name parameters, and multiple variable placeholders are set, and the output data structure of each operator element is unified to obtain multiple operator templates.
[0009] Set operator template placeholders and multiple first string placeholders to obtain the main file template; set multiple second string placeholders to obtain the dependency template.
[0010] Based on the rules set for each operator element, the operator rules are obtained.
[0011] Determine whether there are any dependencies between the business logic data.
[0012] If it is determined that the business logic data has no dependency relationship, then the business logic data is transformed into business logic data of a graph data structure.
[0013] The business logic data of the graph data structure is topologically sorted to determine the parsing order of each operator element.
[0014] The main file code is generated based on the business logic data, the parsing order of each operator element, the multiple operator templates, the main file template, and the operator rules.
[0015] Based on the business logic data and the dependency template, generate dependency file code.
[0016] The main file code and the dependent file code are processed to obtain the rule engine file.
[0017] Optionally, in the method described above, each operator element includes an input operator, a filtering operator, an aggregation operator, and an output operator; correspondingly, the step of setting rules according to each operator element to obtain operator rules includes: creating a bidirectional queue; if the operator element is the input operator, then saving the name of the input operator to the head of the bidirectional queue and determining it as the operator name parameter of the input operator; if the operator element is the filtering operator, then obtaining the operator element name at the head of the bidirectional queue and determining the operator element name as the transmission parameter of the filtering operator; and then... The name of the filter operator is saved to the head of the double-ended queue and determined as the operator name parameter of the filter operator; if the operator element is the aggregation operator, the name of the operator element at the head of the double-ended queue is obtained, and the name of the operator element is determined as the transmission parameter of the aggregation operator; the name of the aggregation operator is saved to the head of the double-ended queue and determined as the operator name parameter of the aggregation operator; if the operator element is the output operator, the name of the operator element at the head of the double-ended queue is obtained, and the name of the operator element is determined as the transmission parameter of the output operator.
[0018] Optionally, in the method described above, generating the main file code based on the business logic data, the parsing order of each operator element, the multiple operator templates, the main file template, and the operator rules includes: generating operator code based on the business logic data, the parsing order of each operator element, the multiple operator templates, and the operator rules; and generating the main file code based on the business logic data, the main file template, and the operator code.
[0019] Optionally, in the method described above, generating operator code based on the business logic data, the parsing order of each operator element, the multiple operator templates, and the operator rules includes: sequentially traversing each operator element according to the parsing order to determine the type and name of each operator element; filtering operator templates of each type from the multiple operator templates according to the type of each operator element; determining the transmission parameters of each operator element according to the type of each operator element and the operator rules; obtaining the operator template parameters corresponding to each variable placeholder in the business logic data; replacing the transmission parameter placeholders in the operator templates of each type with the transmission parameters of each operator element, replacing the operator name parameter placeholders in the operator templates of each type with the operator element names, and replacing the variable placeholder parameters in the operator templates of each type with the operator template parameters to obtain multiple initial operator codes; and concatenating the multiple initial operator codes according to the parsing order of each operator element to generate the operator code.
[0020] Optionally, in the method described above, generating the main file code based on the business logic data, the main file template, and the operator code includes: obtaining each main file template parameter corresponding to each first string placeholder in the business logic data; replacing the operator template placeholder in the main file template with the operator code; replacing each first string placeholder in the main file template with each main file template parameter; and generating the main file code.
[0021] Optionally, in the method described above, generating dependency file code based on the business logic data and the dependency template includes: obtaining each dependency template parameter corresponding to each second string placeholder in the business logic data; replacing each second string placeholder in the dependency template with each dependency template parameter to generate the dependency file code.
[0022] Secondly, this application provides a processing apparatus for rule engine files, applied to a service device, comprising:
[0023] The receiving module is used to receive business logic data sent by the user equipment, wherein the business logic data is generated by the user equipment in response to the user's visual orchestration operation on multiple operator elements and multiple relation elements according to the business logic.
[0024] The first setting module is used to set placeholders for transmission parameters, operator name parameters, and multiple variable placeholders according to the attributes of each operator element, and to unify the output data structure of each operator element to obtain multiple operator templates.
[0025] The second settings module is used to set operator template placeholders and multiple first string placeholders to obtain the main file template; and to set multiple second string placeholders to obtain the dependency template.
[0026] The third setting module is used to set rules according to each operator element to obtain operator rules.
[0027] The judgment module is used to determine whether there is a dependency relationship between the business logic data.
[0028] The conversion module is used to convert the business logic data into business logic data with a graph data structure if it is determined that there is no dependency relationship between the business logic data.
[0029] The determination module is used to perform topological sorting on the business logic data of the graph data structure and determine the parsing order of each operator element.
[0030] The first generation module is used to generate main file code based on the business logic data, the parsing order of each operator element, the multiple operator templates, the main file template, and the operator rules.
[0031] The second generation module is used to generate dependency file code based on the business logic data and the dependency template.
[0032] The processing module is used to process the main file code and the dependent file code to obtain the rule engine file.
[0033] Thirdly, this application provides a service device, comprising: at least one processor and a memory;
[0034] The memory stores computer-executed instructions;
[0035] The at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform the processing method of the rule engine file as described in the first aspect and various possible designs of the first aspect.
[0036] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the method for processing rule engine files as described in the first aspect and various possible designs of the first aspect.
[0037] The method, apparatus, service device, and storage medium for processing rule engine files provided in this application receive business logic data sent by user equipment, combine operator rules, main file templates, multiple operator templates, and dependency templates, and realize the conversion of business logic into main file code and dependency file code, and process the main file code and dependency file code to obtain rule engine files. This improves the extensibility of rule engine file generation and reduces the maintenance difficulty of rule engine files. Attached Figure Description
[0038] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0039] Figure 1 A schematic diagram of a scenario for a rule engine file processing system provided in an embodiment of this application;
[0040] Figure 2 A flowchart illustrating a method for processing rule engine files according to an embodiment of this application;
[0041] Figure 3 A flowchart illustrating a method for processing rule engine files according to another embodiment of this application;
[0042] Figure 4 A schematic diagram of the structure of the rule engine file processing device provided in the embodiments of this application;
[0043] Figure 5 A schematic diagram of the hardware structure of the service device provided in the embodiments of this application;
[0044] Figure 6 This is a schematic diagram of a directed acyclic graph in an embodiment of this application.
[0045] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concepts of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] Rule engine files embed business rules into applications or systems to automate business processes. By defining and managing rule sets, related operations can be automatically triggered and executed at runtime based on specific conditions and logic. Current technologies primarily generate rule engine files corresponding to business rules through rule design methods; these files are then tested, and those that pass the tests are used as the final rule engine files. However, when business rules change, the rule engine files need to be retested; therefore, this reduces the extensibility of the rule engine files and increases their maintenance complexity.
[0048] To address the aforementioned technical issues, this application proposes the following technical concept: Considering the need to retest the rule engine file when business rules change, the concepts of code templates and operator rules are introduced. The transmission parameters of each operator element are determined through operator rules. The code templates are used to convert the received business logic data sent by user devices into main file code and dependency file code, avoiding errors during the processing of main file code and dependency file code. This improves the extensibility of the generated rule engine file and reduces the maintenance difficulty of the rule engine file.
[0049] The method for processing rule engine files provided in this application aims to solve the above-mentioned technical problems in the prior art.
[0050] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0051] Figure 1 This is a schematic diagram of a scenario for a rule engine file processing system provided in an embodiment of this application. For example... Figure 1 As shown, the system provided in this embodiment includes: user equipment 101, service equipment 102 and platform equipment 103.
[0052] Among them, service equipment 102 can be a single server or a service cluster consisting of multiple servers.
[0053] Among them, platform device 103 can be a display device for displaying rule engine files, such as a monitor; or it can be a running device for running rule engine files, such as a server.
[0054] refer to Figure 1User device 101 sends the collected business logic data to service device 102. Service device 102 performs a series of processes based on the business logic data to obtain a rule engine file, and then sends the rule engine file to platform device 103. Platform device 103 displays or runs the rule engine file.
[0055] Example 1
[0056] Figure 2 This is a flowchart illustrating a method for processing rule engine files according to an embodiment of this application. The execution entity in this embodiment can be... Figure 1 The service device 102 in this embodiment can also be other service devices with similar functions; this embodiment does not impose any particular limitations here. Figure 2 As shown, the method includes:
[0057] S201: Receive business logic data sent by the user equipment, wherein the business logic data is generated by the user equipment in response to the user's visual orchestration operation on multiple operator elements and multiple relation elements based on business logic.
[0058] Optionally, the business logic data is business logic data in JSON format.
[0059] Among them, business logic refers to the code logic in the application that describes and implements specific business requirements; visual orchestration operations include drag-and-drop operations performed by users on multiple operator elements and multiple relation elements in the visual interface.
[0060] The system includes multiple operator elements, such as input operators, filtering operators, aggregation operators, and output operators. Each operator element provides an extensible type, and the node type `nodeType` includes a prefix and a suffix. The prefix indicates the parent type of the operator; for example, the prefix "INPUT" indicates the input parent operator, the prefix "FILTER" indicates the filtering parent operator, the prefix "AGG" indicates the aggregation parent operator, and the prefix "OUTPUT" indicates the output parent operator. The suffix is a four-digit number ranging from 0001 to 9999, identifying the sub-operator type; for example, "INPUT-0001" can indicate that the input source is a Kafka message queue, and "INPUT-0002" can indicate that the input source is a Pulsar message queue.
[0061] For example, the business logic data in JSON format input to the operator can be represented as follows:
[0062]
[0063] In this table, `code` represents the operator identifier, `name` represents the operator name, `message` represents the prompt message, `params` represents the input parameter list, `nodeType` represents the operator type, and `outputFields` represents the output field list. The input parameter list `params` includes three parameters: `productKey` (a string representing the product key), `deviceKey` (an array representing the device key), and `propertyKey` (an array representing the property key). The output field list `outputFields` includes three parameters: `name` represents the output field name, `field` represents the key or path of the output field in the data, and `dataType` represents the data type of the output field.
[0064] For example, the business logic data in JSON format for the filtering operator can be represented as follows:
[0065]
[0066]
[0067] Wherein, code represents the operator identifier, name represents the operator name, message represents the prompt message, params represents the input parameter list, nodeType represents the operator type, inputFields represents the input field list, and outputFields represents the output field list.
[0068] The input parameter list `params` includes two parameters: `operator`, which represents the operator for the filtering conditions, and `filter`, which represents the list of filtering conditions. `operator` includes "AND" and "OR". `filter` includes four parameters: `name`, which represents the name of the filtering condition; `field`, which represents the field to be filtered; `type`, which represents the type of the filtering condition; and `value`, which represents the value of the filtering condition. `type` includes `MORE_THAN`, `MORE_THAN_EQUAL`, `LESS_THAN`, `LESS_THAN_EQUAL`, `EQUAL`, `NOT_EQUAL`, `NOT_LIKE`, and `LIKE`.
[0069] The input field list `inputFields` includes three parameters: `name` represents the name of the input field, `field` represents the field name of the input field, and `dataType` represents the data type of the input field.
[0070] The output field list `outputFields` includes three parameters: `name` represents the name of the output field, `field` represents the field name of the output field, and `dataType` represents the data type of the output field.
[0071] For example, the business logic data in JSON format for the aggregation operator can be represented as follows:
[0072]
[0073]
[0074] Wherein, code represents the operator identifier, name represents the operator name, message represents the prompt message, params represents the input parameter list, nodeType represents the operator type, inputFields represents the input field list, and outputFields represents the output field list.
[0075] The input parameter list `params` includes seven parameters: `timeWindowNum` represents the number of time windows, `timeWindowUnit` represents the unit of the time window; `timeWindowSeconds` represents the number of seconds in the time window; `slideNum` represents the number of slide windows, `slideUnit` represents the unit of the slide window, and `slideWindowSeconds` represents the number of seconds in the slide window; `keyBy` represents the grouping field list, specifying the fields to be aggregated. The grouping field list `keyBy` includes five parameters: `name` represents the field name, `field` represents the key or path corresponding to the field in the input data, `outputName` represents the output field name, `outputField` represents the key or path corresponding to the output field in the output data, and `type` represents the aggregation type. Aggregation types `type` include SUM, AVG, MIN, and MAX.
[0076] The input field list `inputFields` includes three parameters: `name` represents the name of the input field, `field` represents the key or path corresponding to the field in the input data, and `dataType` represents the data type of the input field.
[0077] The output field list `outputFields` includes three parameters: `name` represents the name of the output field, `field` represents the key or path corresponding to the field in the output data, and `dataType` represents the data type of the output field.
[0078] For example, the business logic data in JSON format output operator can be represented as follows:
[0079]
[0080]
[0081] Wherein, code represents the operator identifier, name represents the operator name, message represents the prompt message, params represents the input parameter list, nodeType represents the operator type, inputFields represents the input field list, and outputFields represents the output field list.
[0082] The input parameter list `params` includes five parameters: `targetDatabase` represents the database name, `targetTable` represents the target database table name, `bootstrap.servers` represents the server address and port number configuration, `topic` represents the topic name, and `table` represents the list of output fields. The output field list `table` includes five parameters: `name` represents the output field name, `field` represents the output field name, `outputName` represents the output field's display name, `outputField:` represents the output field's field name, and `dataType` represents the output field's data type.
[0083] The input field list `inputFields` includes three parameters: `name` represents the name of the input field, `field` represents the field name of the input field, and `dataType` represents the data type of the input field.
[0084] The output field list `outputFields` includes three parameters: `name` represents the name of the output field, `field` represents the field name of the output field, and `dataType` represents the data type of the output field.
[0085] Among them, multiple relation elements represent the connection relationships between various operator elements. Each relation element includes an operator identifier preNodeCode of a predecessor operator element and an operator identifier postNodeCode of a successor operator element, indicating the connection relationship between the predecessor operator element and the successor operator element. The starting operator element has no preNodeCode, or the value of preNodeCode is 0.
[0086] For example, the business logic data in JSON format for multiple relational elements can be represented as follows:
[0087]
[0088]
[0089] The `relations` property represents the relationships between various operator elements and contains multiple relation objects. The first relation object is the starting operator element, and the operator identifier of the successor operator element is "9174717103401"; the second relation object has the operator identifier of the preceding operator element as "9174717103401" and the operator identifier of the successor operator element as "9174717103402"; the third relation object has the operator identifier of the preceding operator element as "9174717103402" and the operator identifier of the successor operator element as "9174717103403"; and the fourth relation object has the operator identifier of the preceding operator element as "9174717103403" and the operator identifier of the successor operator element as "9174717103404".
[0090] For example, the business logic data in JSON format also includes the identifier, name, and status description of the initial rule engine file, as follows:
[0091]
[0092] `jobCode` is the identifier of the initial rule engine file, `jobName` is the name of the initial rule engine file, and `jobStatus` is the status description of the initial rule engine file.
[0093] Specifically, business logic data sent by user equipment can be received via wireless communication or via wired communication.
[0094] S202: Based on the attributes of each operator element, set placeholders for the passed parameters, operator name parameters, and multiple variable placeholders, and unify the output data structure of each operator element to obtain multiple operator templates.
[0095] The operator elements include: input operator, filtering operator, aggregation operator, and output operator; the multiple operator templates include input operator template, filtering operator template, aggregation operator template, and output operator template.
[0096] Specifically, based on the attributes of each operator element, the variable code portion in each type of operator template is determined, and placeholders for the passed parameters, operator name parameters, and multiple variable placeholders are set according to the variable code portion; an OutputBean object is constructed based on the output results of each operator element to unify the output data structure of each operator element and obtain multiple operator templates.
[0097] For example, in the input operator template, placeholders for the operator name parameter ${inputOperatorStream}, and variable placeholders ${productKey}, ${deviceKey}, and ${propertyKey} are set; in the filter operator template, placeholders for the passed parameters ${lastOperatorStream}, the operator name parameter placeholder ${filterOperatorStream}, and variable placeholders ${fop} and ${filterCondition} are set; in the aggregation operator template, placeholders for the passed parameters ${lastOperatorStream}, the operator name parameter placeholder ${aggregateOperatorFinishStream}, and variable placeholders ${slide}, ${timeWindow}, and ${aggFunction} are set; and in the output operator template, placeholders for the passed parameters ${lastOperatorStream}, and variable placeholders ${outputKafkaTopic} and ${outputKafkaBootstrapServers} are set.
[0098] S203: Set operator template placeholders and multiple first string placeholders to obtain the main file template; set multiple second string placeholders to obtain the dependency template.
[0099] Specifically, step S203 includes S2031 to S2032:
[0100] S2031: Set operator template placeholders and multiple first string placeholders to obtain the main file template.
[0101] Specifically, the changing code portions in the main file template are identified. Based on these changing code portions, operator template placeholders and multiple first string placeholders are set to obtain the main file template. The changing code portions include: operator code of various types, the package name of the main file code, the method names of the main file code, and the execution method of the main file code. The package name is the path to the main file code within the code file, and the directory structure within the code file corresponds to the hierarchical structure of the package name.
[0102] For example, in the main file template, set the operator template placeholder ${dagOperatorBody}, the first string placeholders ${dagPackageName}, ${dagMainClass}, and ${dagJobName}. Here, ${dagPackageName} is the package name placeholder, ${dagMainClass} is the method name placeholder in the main file code, and ${dagJobName} is the placeholder for the executed method.
[0103] S2032: Set multiple second string placeholders to obtain the dependency template.
[0104] Among them, dependency templates include entity class templates and aggregate function templates.
[0105] Specifically, the variable code portion in the entity class template is identified, and a second string placeholder is set based on this variable code portion to obtain the entity class template. The variable code portion is the package name; this package name is consistent with the package name in the main file code. For example, the second string placeholder ${dagPackageName} is set in the entity class template. Here, ${dagPackageName} is a placeholder for the package name.
[0106] Specifically, the variable code portion in the aggregate function template is identified, and a second string placeholder is set based on this variable code portion to obtain the aggregate function template. The variable code portion includes: the package name, the field names to be aggregated, the field names for storing the aggregated results, and the method name; the package name is consistent with the package name in the main file code.
[0107] For example, the aggregation function template sets the second string placeholders ${dagPackageName}, ${kb.inputName}, ${kb.outputName}, ${aggFunction}, and ${kb_index}. Here, ${dagPackageName} is the package name placeholder, ${kb.inputName} is the field name to be aggregated, ${kb.outputName} is the field name to store the aggregation result, ${aggFunction} is the method name, and ${kb_index} is the loop index, which will be replaced with the corresponding value in each iteration.
[0108] S204: Obtain the operator rules by setting rules for each operator element.
[0109] Each operator element includes an input operator, a filtering operator, an aggregation operator, and an output operator.
[0110] Specifically, it receives rules sent by the user equipment as operator rules. These rules can be manually entered by the user on the user equipment.
[0111] S205: Determine whether there are dependencies between business logic data.
[0112] Specifically, based on the operator identifier code of each operator and the operator identifier preNodeCode of the predecessor operator element and the operator identifier of the successor operator element in multiple relation objects, it is determined whether there is a circular dependency.
[0113] For example, considering the example of "business logic data in JSON format of multiple relational elements" in S201 above, the relationships between the operator elements are as follows:
[0114] 9174717103401→9174717103402→9174717103403→9174717103404
[0115] There are no circular dependencies between the operators.
[0116] For example, the business logic data in JSON format for multiple relational elements with circular dependencies is as follows:
[0117]
[0118] The relationships between the operator elements are as follows:
[0119]
[0120] There is a circular dependency: 9174717103405→9174717103406→9174717103408→9174717103405.
[0121] S206: If it is determined that there is no dependency relationship between the business logic data, then the business logic data will be transformed into business logic data in a graph data structure.
[0122] Optionally, the business logic data of the graph data structure is a directed acyclic graph.
[0123] A directed acyclic graph (DAG) is a graph structure consisting of multiple nodes and multiple directed edges. The direction of the edges represents the dependency relationship between the nodes and does not form closed loops.
[0124] Specifically, the nodes in the directed acyclic graph are determined based on the operator identifiers of each operator element, the directed edges between each node are determined based on the connection relationships between each operator element, and the directed acyclic graph is determined based on each node and the directed edges between each node.
[0125] For example, such as Figure 6 As shown, Figure 6 This is a directed acyclic graph (DAG) to convert JSON-formatted business logic data. Node A represents operator ID 9174717103401, node B represents operator ID 9174717103402, node C represents operator ID 9174717103403, and node D represents operator ID 9174717103404.
[0126] S207: Perform topological sorting on the business logic data of the graph data structure to determine the parsing order of each operator element.
[0127] Topological sorting is an algorithm for sorting directed acyclic graphs (DAGs) by arranging the nodes in the DAG according to their dependencies.
[0128] Specifically, an empty result list is initialized to store the results of the topological sort; nodes without predecessor nodes are retrieved and added to a queue or stack; when the queue or stack is not empty, the following steps are performed:
[0129] a. Pop the node from the top of the queue or stack as a sample node and add the sample node to an empty result list.
[0130] b. Traverse all successor nodes of the sample node and decrement the in-degree of all successor nodes by one.
[0131] c. If the in-degree of a successor node is 0, then add the successor node to the queue or stack.
[0132] If the number of nodes in the final result list equals the number of nodes in the directed acyclic graph, then the topological sorting is complete. The order of the nodes in the final result list is the parsing order of the operator elements.
[0133] For example, for Figure 6 A topological sort is performed on the directed acyclic graph (DAG). After the topological sort, the order of the nodes in the DAG is A, B, C, D, and the parsing order of the corresponding operator elements is input operator, filtering operator, aggregation operator, and output operator.
[0134] S208: Generate main file code based on business logic data, the parsing order of each operator element, multiple operator templates, main file template, and operator rules.
[0135] Specifically, step S208 includes S2081 to S2082:
[0136] S2081: Generate operator code based on business logic data, the parsing order of each operator element, multiple operator templates, and operator rules.
[0137] The multiple operator templates include: input operator template, filtering operator template, aggregation operator template, and output operator template.
[0138] Specifically, step S2081 includes Sc~Sg:
[0139] Sc: Iterate through each operator element in the order of its parsing to determine its type and name.
[0140] Sd: Based on the type of each operator element, select the operator template of each type from multiple operator templates.
[0141] Specifically, if the operator type is an input operator, the matched operator template is the input operator template; if the operator type is a filter operator, the matched operator template is the filter operator template; if the operator type is an aggregation operator, the matched operator template is the aggregation operator template; and if the operator type is an output operator, the matched operator template is the output operator template.
[0142] Se: Determine the transmission parameters of each operator element based on the type and operator rules of each operator element.
[0143] Sf: Retrieves the operator template parameters corresponding to each variable placeholder in the business logic data.
[0144] Si: Replace the pass parameter placeholders in the operator templates of each type with the pass parameters of each operator element, replace the operator name parameter placeholders in the operator templates of each type with the operator element names, and replace the variable placeholder parameters in the operator templates of each type with the operator template parameters, to obtain multiple initial operator codes.
[0145] For example, the operator template is an input operator template. The placeholders for the passed parameters, ${inputOperatorStream}, and the variable placeholders ${productKey}, ${deviceKey}, and ${propertyKey}, are obtained from the input operator template. The data parameters of the input operator are obtained from the business logic data in JSON format. The value of name, "input operator", is replaced with ${inputOperatorStream}. The value of productKey, "product1", is replaced with ${productKey}. The value of deviceKey, "["device1","device2"]", is replaced with ${deviceKey}. The value of propertyKey, "["property1","property2"]", is replaced with ${propertyKey}. The input operator code is then generated.
[0146] The operator template is a filter operator template. Retrieve the placeholders for the passed parameters (${lastOperatorStream}), operator name parameter (${filterOperatorStream}), variables (${fop}), and variable placeholders (${filterCondition}) from the filter operator template. Obtain the passed parameters for the filter operator according to the operator rules and replace ${lastOperatorStream}. Retrieve the data parameters for the filter operator from the JSON format operator data, replacing the value of "filter operator" in ${filterOperatorStream} with "name". Based on the list of filter conditions, replace the value of "temperature" in ${fop} with "field" and replace the filter condition "temperature>35" in ${filterCondition}, generating the filter operator code. When multiple filter operators exist, replace ${filterOperatorStream} with "'filterOperatorStream'+code". For example, replace ${filterOperatorStream} with "filterOperatorStream9174717103402".
[0147] The operator template is an aggregation operator template. It retrieves the placeholders for the passed parameters (${lastOperatorStream}), the operator name parameter (${aggregateOperatorFinishStream}), and the variable placeholders (${slide}, ${timeWindow}, and ${aggFunction}) from the aggregation operator template. Based on the operator rules, it retrieves the passed parameters for the aggregation operator and replaces ${lastOperatorStream}. It then retrieves the data parameters for the aggregation operator from the JSON-formatted business logic data, replacing the value of "aggregateOperatorFinishStream" in `name` with "aggregateOperator", the value of "3600" in `timeWindowSeconds` with "3600" in `timeWindowSeconds`, and the value of "10" in `slideWindowSeconds` with "10" in `slide}`. ${aggFunction} is the method name of the aggregation function manually entered by the user on their device. Finally, it generates the aggregation operator code. When multiple aggregation operators exist, "'aggregateOperatorFinishStream'+code" replaces ${aggregateOperatorFinishStream}. For example, "aggregateOperatorFinishStream9174717103403" replaces ${aggregateOperatorFinishStream}.
[0148] The operator template is the output operator template. Retrieve the placeholders for the passed parameters `${lastOperatorStream}`, `${outputKafkaTopic}`, and `${outputKafkaBootstrapServers}` from the output operator template. Based on the operator rules, obtain the passed parameters for the output operator and replace `${lastOperatorStream}`. Retrieve the data parameters for the output operator from the JSON-formatted business logic data, replacing the value of `topic` ("my_topic") in `${outputKafkaTopic}` and the value of `bootstrap.servers` ("server1:xxxx, server2:xxxx") in `${outputKafkaBootstrapServers}`, and generate the output operator code.
[0149] Sg: Concatenate multiple initial operator codes according to the parsing order of each operator element to generate operator code.
[0150] Specifically, following the parsing order of each operator element: input operator, filtering operator, aggregation operator, and output operator, the input operator code, filtering operator code, aggregation operator code, and output operator code are concatenated in sequence to obtain the operator code.
[0151] Optionally, if sub-template placeholders exist in each type of operator template, the parameters required by the sub-template placeholders are parsed sequentially, and the parameters are replaced, and the templates are concatenated level by level to generate operator code. Optionally, the sub-template can be a specific function or code block.
[0152] S2082: Generate main file code based on business logic data, main file template, and operator code.
[0153] Specifically, retrieve the main file template parameters corresponding to each first string placeholder from the business logic data; replace the operator template placeholders in the main file template with the operator code; replace each first string placeholder in the main file template with each main file template parameter; and generate the main file code.
[0154] Specifically, the first string placeholders ${dagPackageName}, ${dagMainClass}, and ${dagJobName} in the main file template, and the operator template placeholder ${dagOperatorBody} are retrieved. The package name manually entered by the user on the user's device is replaced with ${dagPackageName}, and the method name in the main file code manually entered by the user on the user's device is replaced with ${dagMainClass}. The data parameters of the initial rule engine file in the JSON-formatted business logic data are retrieved, and the value "name" of jobName is replaced with ${dagJobName}, and the operator code is replaced with ${dagOperatorBody}, generating the main file code.
[0155] S209: Generate dependency file code based on business logic data and dependency templates.
[0156] The dependency templates include entity class templates and aggregate function templates; the dependency file code includes entity class file code and aggregate function file code.
[0157] Specifically, retrieve the corresponding dependency template parameters for each second string placeholder from the business logic data; replace each second string placeholder in the dependency template with each dependency template parameter to generate the dependency file code.
[0158] Specifically, retrieve the second string placeholder ${dagPackageName} from the entity class template. Replace ${dagPackageName} with the package name manually entered by the user on their device, and generate the entity class file code.
[0159] Retrieve the second string placeholders ${dagPackageName}, ${kb.inputName}, ${kb.outputName}, and ${aggFunction} from the aggregate function template. Replace ${dagPackageName} with the package name manually entered by the user on their device, replace ${aggFunction} with the method name manually entered by the user on their device, retrieve the data parameters of the aggregate operators from the JSON-formatted business logic data, replace ${kb.inputName} with the value "gmtCreate" in the input field list inputFields, replace ${kb.outputName} with the value "gmtCreate" in the output field list outputFields, and generate the aggregate function file code.
[0160] S210: Process the main file code and the dependency file code to obtain the rule engine file.
[0161] Specifically, the main file code and the dependent file code are concatenated to obtain the file to be compiled. The file to be compiled is then compiled and packaged to obtain the rule engine JAR file.
[0162] Alternatively, the rules engine JAR file can be uploaded to an open-source streaming framework platform so that the platform can run the rules engine JAR file.
[0163] Alternatively, the open-source streaming framework platform can be Apache Flink.
[0164] As can be seen from the above embodiments, by receiving business logic data sent by user equipment, and combining operator rules, main file templates, multiple operator templates and dependency templates, the business logic is converted into main file code and dependency file code, and the main file code and dependency file code are processed to obtain the rule engine file, which improves the extensibility of the rule engine file generation and reduces the maintenance difficulty of the rule engine file.
[0165] Example 2
[0166] Figure 3 This is a flowchart illustrating a method for processing rule engine files according to an embodiment of this application. Figure 2 Based on the previous embodiment, this embodiment focuses on describing the specific process in S204: obtaining the operator rules according to the rules set for each operator element. For example... Figure 3 As shown, the details are as follows:
[0167] S301: Create a double-ended queue.
[0168] A double-ended queue is a linear data structure that combines the characteristics of a queue and a stack, allowing insertion and deletion of elements from both ends of the queue. Elements can be inserted and deleted from both the front and back of a double-ended queue.
[0169] S302: If the operator element is an input operator, then the name of the input operator is saved to the head of the double-ended queue and determined as the operator name parameter of the input operator.
[0170] Specifically, if the operator element is an input operator, the push() method is called to save the name of the input operator to the head of the double-ended queue, and the name of the input operator is determined as the operator name parameter of the input operator.
[0171] S303: If the operator element is a filtering operator, obtain the name of the operator element at the head of the double-ended queue, and use the operator element name as the pass parameter of the filtering operator; save the name of the filtering operator to the head of the double-ended queue, and use it as the operator name parameter of the filtering operator.
[0172] Specifically, if the operator element is a filter operator, the peek() method is called to obtain the operator name at the head of the double-ended queue, and the operator name at the head of the double-ended queue is used as the parameter to pass the filter operator; the push() method is called to save the name of the filter operator to the head of the double-ended queue, and the name of the filter operator is used as the operator name parameter of the filter operator.
[0173] S304: If the operator element is an aggregate operator, obtain the name of the operator element at the head of the double-ended queue, and use the operator element name as the pass parameter of the aggregate operator; save the name of the aggregate operator to the head of the double-ended queue, and use it as the operator name parameter of the aggregate operator.
[0174] Specifically, if the operator element is an aggregate operator, the peek() method is called to obtain the operator name at the head of the double-ended queue, and the operator name at the head of the double-ended queue is used as the parameter passed to the aggregate operator; the push() method is called to save the name of the aggregate operator to the head of the double-ended queue, and the name of the aggregate operator is used as the operator name parameter of the aggregate operator.
[0175] S305: If the operator element is an output operator, then obtain the name of the operator element at the head of the double-ended queue and use the operator element name as the pass parameter of the output operator.
[0176] Specifically, if the operator element is an output operator, the peek() method is called to obtain the operator name at the head of the double-ended queue, and the operator name at the head of the double-ended queue is used as the pass parameter for the output operator.
[0177] As can be seen from the above embodiments, by creating a bidirectional queue, setting operator rules according to the attributes of each operator element, and determining the transmission parameters of each operator element through the operator rules, arbitrary permutations and combinations of each operator element are realized, thereby further improving the extensibility of the generated rule engine file and reducing the maintenance difficulty of the rule engine file.
[0178] Figure 4 This is a schematic diagram of the structure of a rule engine file processing device provided in an embodiment of this application. Figure 4 As shown, the rule engine file generation device includes: a receiving module 401, a first setting module 402, a second setting module 403, a third setting module 404, a judgment module 405, a conversion module 406, a determination module 407, a first generation module 408, a second generation module 409, and a processing module 410.
[0179] The receiving module 401 is used to receive business logic data sent by the user equipment, wherein the business logic data is generated by the user equipment in response to the user's visual orchestration operation on multiple operator elements and multiple relation elements according to the business logic.
[0180] The first setting module 402 is used to set the pass parameter placeholder, operator name parameter placeholder and multiple variable placeholders according to the attributes of each operator element, and to unify the output data structure of each operator element to obtain multiple operator templates.
[0181] The second setting module 403 is used to set operator template placeholders and multiple first string placeholders to obtain the main file template; and to set multiple second string placeholders to obtain the dependency template.
[0182] The third setting module 404 is used to obtain operator rules based on the setting rules of each operator element.
[0183] The judgment module 405 is used to determine whether there is a dependency relationship between the business logic data.
[0184] The conversion module 406 is used to convert the business logic data into business logic data with a graph data structure if it is determined that there is no dependency relationship between the business logic data.
[0185] The determination module 407 is used to perform topological sorting on the business logic data of the graph data structure and determine the parsing order of each operator element.
[0186] The first generation module 408 is used to generate main file code based on the business logic data, the parsing order of each operator element, the multiple operator templates, the main file template, and the operator rules.
[0187] The second generation module 409 is used to generate dependency file code based on the business logic data and the dependency template.
[0188] The processing module 410 is used to process the main file code and the dependent file code to obtain the rule engine file.
[0189] The apparatus provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects are similar, and will not be described again here.
[0190] In one possible design, each operator element includes an input operator, a filtering operator, an aggregation operator, and an output operator; the third setting module 404 is specifically used to: generate operator code based on the business logic data, the parsing order of each operator element, the multiple operator templates, and the operator rules; and generate the main file code based on the business logic data, the main file template, and the operator code.
[0191] In one possible design, the first generation module 408 is specifically used to: generate operator code based on the business logic data, the parsing order of each operator element, the multiple operator templates, and the operator rules; and generate the main file code based on the business logic data, the main file template, and the operator code.
[0192] In one possible design, the first generation module 408 is further configured to: sequentially traverse the operator elements according to their parsing order; determine the type and name of each operator element; filter operator templates of various types from the plurality of operator templates according to their types; determine the transmission parameters of each operator element according to their types and the operator rules; obtain the operator template parameters corresponding to each variable placeholder in the business logic data; replace the transmission parameter placeholders in the operator templates of various types with the transmission parameters of each operator element; replace the operator name parameter placeholders in the operator templates of various types with the operator element names; replace the variable placeholder parameters in the operator templates of various types with the operator template parameters, thereby obtaining a plurality of initial operator codes; and concatenate the plurality of initial operator codes according to their parsing order to generate the operator code.
[0193] In one possible design, the first generation module 408 is further configured to obtain each main file template parameter corresponding to each first string placeholder in the business logic data; replace the operator template placeholder in the main file template with the operator code; replace each first string placeholder in the main file template with each main file template parameter; and generate the main file code.
[0194] In one possible design, the second generation module 409 is specifically used to: obtain each dependency template parameter corresponding to each second string placeholder in the business logic data; replace each second string placeholder in the dependency template with each dependency template parameter to generate the dependency file code.
[0195] The apparatus provided in this embodiment can be used to execute the technical solutions of the above method embodiments. Its implementation principle and technical effects are similar, and will not be described again here.
[0196] Figure 5 A schematic diagram of the hardware structure of the service device provided in the embodiments of this application. For example... Figure 5 As shown, the service device of this embodiment includes: at least one processor 501 and a memory 502; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to execute the processing method of the rule engine file as described above.
[0197] Alternatively, the memory 502 can be either standalone or integrated with the processor 501.
[0198] When the memory 502 is set up independently, the service device also includes a bus 503 for connecting the memory 502 and the processor 501.
[0199] This application also provides a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the rule engine file processing method described above.
[0200] This application also provides a computer program product, including a computer program stored in a computer storage medium. At least one processor can read the computer program from the computer storage medium, and when the at least one processor executes the computer program, it can implement the above-mentioned method for processing rule engine files.
[0201] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application.
[0202] It should be further noted that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0203] It should be understood that the above-described device embodiments are merely illustrative, and the device of this application can also be implemented in other ways. For example, the division of units / modules in the above embodiments is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units, modules, or components may be combined, or integrated into another system, or some features may be ignored or not executed.
[0204] Furthermore, unless otherwise specified, the functional units / modules in the various embodiments of this application can be integrated into one unit / module, or each unit / module can exist physically separately, or two or more units / modules can be integrated together. The integrated units / modules described above can be implemented in hardware or as software program modules.
[0205] When integrated units / modules are implemented in hardware, the hardware can be digital circuits, analog circuits, etc. The physical implementation of the hardware structure includes, but is not limited to, transistors, memristors, etc. Unless otherwise specified, the processor can be any suitable hardware processor, such as a CPU, GPU, FPGA, DSP, and ASIC, etc. Unless otherwise specified, the storage unit can be any suitable magnetic or magneto-optical storage medium, such as Resistive Random Access Memory (RRAM), Dynamic Random Access Memory (DRAM), Static Random Access Memory (SRAM), Enhanced Dynamic Random Access Memory (EDRAM), High-Bandwidth Memory (HBM), Hybrid Memory Cube (HMC), etc.
[0206] If the integrated unit / module is implemented as a software program module and sold or used as an independent product, it can be stored in a computer-readable storage device (CMD). Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a memory and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned memory includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0207] In the above embodiments, the descriptions of each embodiment have their own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0208] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0209] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for processing rule engine files, characterized in that, Applied to service equipment, including: Receive business logic data sent by the user equipment, wherein the business logic data is generated by the user equipment in response to the user's visual orchestration operation on multiple operator elements and multiple relation elements based on business logic; Based on the attributes of each operator element, placeholders for the passed parameters, operator name parameters, and multiple variable placeholders are set, and the output data structure of each operator element is unified to obtain multiple operator templates. Set operator template placeholders and multiple first string placeholders to obtain the main file template; set multiple second string placeholders to obtain the dependency template; Based on the rules set for each operator element, the operator rules are obtained; Determine whether there are any dependencies between the business logic data; If it is determined that the business logic data has no dependency relationship, then the business logic data is transformed into business logic data with a graph data structure. Perform topological sorting on the business logic data of the graph data structure to determine the parsing order of each operator element; Based on the business logic data, the parsing order of each operator element, the multiple operator templates, the main file template, and the operator rules, the main file code is generated; Based on the business logic data and the dependency template, generate dependency file code; The main file code and the dependent file code are processed to obtain the rule engine file.
2. The method according to claim 1, characterized in that, Each operator element includes an input operator, a filtering operator, an aggregation operator, and an output operator; Accordingly, the step of setting rules based on each operator element to obtain operator rules includes: Create a double-ended queue; If the operator element is the input operator, then the name of the input operator is saved to the head of the double-ended queue and determined as the operator name parameter of the input operator; If the operator element is the filtering operator, then obtain the name of the operator element at the head of the double-ended queue, and determine the operator element name as the transmission parameter of the filtering operator; save the name of the filtering operator to the head of the double-ended queue, and determine it as the operator name parameter of the filtering operator. If the operator element is the aggregation operator, then obtain the name of the operator element at the head of the bidirectional queue, and determine the operator element name as the transmission parameter of the aggregation operator; save the name of the aggregation operator to the head of the bidirectional queue, and determine it as the operator name parameter of the aggregation operator; If the operator element is the output operator, then obtain the name of the operator element at the head of the bidirectional queue, and determine the operator element name as the transmission parameter of the output operator.
3. The method according to claim 1, characterized in that, The step of generating main file code based on the business logic data, the parsing order of each operator element, the multiple operator templates, the main file template, and the operator rules includes: Based on the business logic data, the parsing order of each operator element, the multiple operator templates, and the operator rules, operator code is generated; The main file code is generated based on the business logic data, the main file template, and the operator code.
4. The method according to claim 3, characterized in that, The step of generating operator code based on the business logic data, the parsing order of each operator element, the multiple operator templates, and the operator rules includes: The operator elements are traversed sequentially according to the parsing order to determine the type and name of each operator element. Based on the type of each operator element, operator templates of each type are selected from the plurality of operator templates; Based on the type of each operator element and the operator rules, determine the transmission parameters of each operator element; Obtain the operator template parameters corresponding to each variable placeholder from the business logic data; Replace the pass parameter placeholders in the operator templates of each type with the pass parameters of each operator element, replace the operator name parameter placeholders in the operator templates of each type with the operator element names, and replace the variable placeholder parameters in the operator templates of each type with the operator template parameters to obtain multiple initial operator codes; The multiple initial operator codes are concatenated according to the parsing order of the operator elements to generate the operator code.
5. The method according to claim 3, characterized in that, The step of generating the main file code based on the business logic data, the main file template, and the operator code includes: Obtain the main file template parameters corresponding to each first string placeholder from the business logic data; The operator code replaces the operator template placeholder in the main file template, and the main file template parameters replace the first string placeholders in the main file template to generate the main file code.
6. The method according to any one of claims 1 to 5, characterized in that, The step of generating dependency file code based on the business logic data and the dependency template includes: Obtain the dependent template parameters corresponding to each second string placeholder from the business logic data; Replace each second string placeholder in the dependency template with each dependency template parameter to generate the dependency file code.
7. A processing apparatus for rule engine files, characterized in that, Applied to service equipment, including: The receiving module is used to receive business logic data sent by the user equipment, wherein the business logic data is generated by the user equipment in response to the user's visual orchestration operation on multiple operator elements and multiple relation elements according to the business logic; The first setting module is used to set the placeholder for the transmission parameter, the placeholder for the operator name parameter, and multiple variable placeholders according to the attributes of each operator element, and to unify the output data structure of each operator element to obtain multiple operator templates. The second settings module is used to set operator template placeholders and multiple first string placeholders to obtain the main file template; and to set multiple second string placeholders to obtain the dependency template. The third setting module is used to set rules according to each operator element to obtain operator rules; The judgment module is used to determine whether there is a dependency relationship between the business logic data; The conversion module is used to convert the business logic data into business logic data with a graph data structure if it is determined that there is no dependency relationship between the business logic data. The determination module is used to perform topological sorting on the business logic data of the graph data structure and determine the parsing order of each operator element; The first generation module is used to generate main file code based on the business logic data, the parsing order of each operator element, the multiple operator templates, the main file template, and the operator rules; The second generation module is used to generate dependency file code based on the business logic data and the dependency template; The processing module is used to process the main file code and the dependent file code to obtain the rule engine file.
8. The apparatus according to claim 7, characterized in that, Each operator element includes an input operator, a filtering operator, an aggregation operator, and an output operator. Correspondingly, the third setting module is specifically used for: creating a bidirectional queue; if the operator element is the input operator, then the name of the input operator is saved to the head of the bidirectional queue and determined as the operator name parameter of the input operator; if the operator element is the filtering operator, then the name of the operator element at the head of the bidirectional queue is obtained, and the operator element name is determined as the transmission parameter of the filtering operator; the name of the filtering operator is saved to the head of the bidirectional queue and determined as the operator name parameter of the filtering operator; if the operator element is the aggregation operator, then the name of the operator element at the head of the bidirectional queue is obtained, and the operator element name is determined as the transmission parameter of the aggregation operator; the name of the aggregation operator is saved to the head of the bidirectional queue and determined as the operator name parameter of the aggregation operator; if the operator element is the output operator, then the name of the operator element at the head of the bidirectional queue is obtained, and the operator element name is determined as the transmission parameter of the output operator.
9. A service device, characterized in that, It includes at least one processor and a memory; the memory stores computer-executable instructions; the at least one processor executes the computer-executable instructions stored in the memory, causing the at least one processor to perform the processing method of the rule engine file as described in any one of claims 1 to 6.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for processing rule engine files as described in any one of claims 1 to 6.