An engine strategy data merging method and device, electronic equipment and medium
By constructing target engine strategies and utilizing a stack structure to process node data, the problem of front-end and back-end data dependencies in the strategy engine is solved, achieving efficient data merging and decoupling, and ensuring the accuracy and efficiency of strategy calculation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- PING AN BANK CO LTD
- Filing Date
- 2023-06-05
- Publication Date
- 2026-07-03
Smart Images

Figure CN116738008B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and more specifically, to a data merging method, apparatus, electronic device, and medium for an engine strategy. Background Technology
[0002] With the development of society and technology, e-commerce has become increasingly advanced, and various new retail platforms have sprung up like mushrooms after rain. The functions of browsing products, shopping, and payment on new retail platforms are realized based on big data platforms.
[0003] Currently, there are many open-source rule computation engines in the decision engine field, such as DROOLS and BLAZE. These rule engines generally adopt a programmatic approach, where all policy merging is implemented by strategists writing specific code, without needing to solve the branch merging problem at the framework level.
[0004] The R+ system of the big data platform implements strategy calculation in a non-programming manner. Strategy personnel only need to generate strategies by dragging and dropping. Therefore, the engine framework needs to solve the problem of merging data between branch and summary nodes. The data required for data merging includes the data of the predecessor node of the current summary node and the data of the corresponding branch node of the current summary node. The data of the predecessor node is relatively easy to obtain. The core problem to be solved is how to obtain the data of the corresponding branch node of the summary node.
[0005] Currently, the strategy engine relies on the front-end page to assign a unique ID to each node. When a branch node is encountered, the IDs of subsequent branches will include the branch node's ID. This way, when the back-end strategy calculation finds the corresponding branch node in the summary node, it only needs to query the node by name. The drawbacks of this existing technology are as follows: back-end logic development is heavily dependent on the front-end; if the ID generation logic on the front-end changes, it will lead to inaccurate strategy calculations; the ID should only serve as a unique identifier for a node and should not be given further computational meaning; and back-end strategy structure validation becomes extremely complex. Summary of the Invention
[0006] In view of this, the purpose of this application is to provide a data merging method, apparatus, electronic device and medium for engine strategies. The data merging method enables better decoupling of backend data from frontend data, making the backend algorithm more efficient and eliminating the need to search for related nodes through some agreed logic.
[0007] This application provides a data merging method for an engine strategy, including:
[0008] Execute a pre-built target engine strategy; wherein the target engine strategy includes at least one branch node and at least one summary node;
[0009] Determine the execution order of each branch node in the target engine strategy, and push the data of each branch node onto the stack in the order of execution.
[0010] Determine the execution order of each aggregation node in the target engine strategy, and pop the data of the branch nodes from the stack in the order of execution of the aggregation nodes; wherein, the data of the branch node corresponding to the currently executing aggregation node is located at the top of the stack;
[0011] Each aggregation node merges the data of that aggregation node; wherein the data of the aggregation node includes the data of the popped branch nodes and / or the data of the previous aggregation node.
[0012] In some embodiments, in the data merging method for the engine strategy, the target engine strategy is constructed using the following method:
[0013] Identify at least one branch node and at least one summary node in the target engine strategy;
[0014] Based on the push order of data in the branch nodes and the pop order of data in the summary nodes, the target connection relationship between the at least one branch node and the at least one summary node is determined, so that when the summary nodes are executed sequentially according to the execution order of the target engine strategy, the data of the branch node corresponding to the currently executed summary node is located at the top of the stack.
[0015] Based on the target connection relationship, connect at least one branch node and at least one summary node to obtain the constructed target engine strategy.
[0016] In some embodiments, the data merging method for the engine strategy, which involves determining the execution order of each branch node in the target engine strategy and sequentially pushing the data of each branch node onto the stack according to the execution order, includes:
[0017] Execute each node of the target engine strategy in sequence, and determine whether the currently executed node is a branch node;
[0018] If so, push the data of that branch node onto the stack.
[0019] In some embodiments, the data merging method for the engine strategy, which involves determining the execution order of each aggregation node in the target engine strategy and popping the data from the branch nodes sequentially according to the execution order of the aggregation nodes, includes:
[0020] Execute each node of the target engine strategy sequentially, and determine whether the currently executing node is a summary node;
[0021] If so, pop the data from the branch node at the top of the stack.
[0022] In some embodiments, the data merging method of the engine strategy, wherein each aggregation node merges the data of that aggregation node, includes:
[0023] The summary node merges the data from the popped branch nodes;
[0024] or,
[0025] The summary node merges the data of the popped branch nodes and the data of the previous summary node.
[0026] In some embodiments, in the data merging method of the engine strategy, the data of the branch nodes popped from the stack by the summary node includes:
[0027] After the data of the branch node is popped from the stack, the data of the branch node is processed according to the data processing rules corresponding to the multiple branches of the branch node, resulting in multiple processed branch node data.
[0028] The summary node merges data from various processed branch nodes.
[0029] In some embodiments, the data merging method of the engine strategy, wherein the aggregation node merges the data of the popped branch node and the data of the previous aggregation node, includes:
[0030] After the data of the branch node is popped from the stack, the data of the branch node is processed according to the data processing rules of the branch node to obtain the processed data of the branch node;
[0031] The summary node merges the data from the processed branch nodes with the data from the previous summary node.
[0032] In some embodiments, a data merging apparatus for engine strategies is also provided, the data merging apparatus comprising:
[0033] An execution module is used to execute a pre-built target engine strategy; wherein the target engine strategy includes at least one branch node and at least one summary node;
[0034] The first determining module is used to determine the execution order of each branch node in the target engine strategy, and to push the data of each branch node onto the stack in the order of execution.
[0035] The second determining module is used to determine the execution order of each summary node in the target engine strategy, and pop the data of the branch nodes from the stack in the order of execution of the summary nodes; wherein, the data of the branch node corresponding to the currently executing summary node is located at the top of the stack.
[0036] The merge module is used to merge the data of each summary node; wherein the data of the summary node includes the data of the popped branch nodes and / or the data of the previous summary node.
[0037] In some embodiments, an electronic device is also provided, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and when the machine-readable instructions are executed by the processor, the steps of the data merging method of the engine strategy are performed.
[0038] In some embodiments, a computer-readable storage medium is also provided, on which a computer program is stored, which, when executed by a processor, performs the steps of the data merging method of the engine strategy.
[0039] This application provides a data merging method, apparatus, electronic device, and medium for an engine strategy. The data merging method executes a pre-constructed target engine strategy. The target engine strategy includes at least one branch node and at least one aggregation node. The method determines the execution order of each branch node in the target engine strategy and pushes the data of each branch node onto a stack according to the execution order. It also determines the execution order of each aggregation node in the target engine strategy and pops the data of each branch node from the stack according to the execution order. The data of the branch node corresponding to the currently executing aggregation node is located at the top of the stack. Each aggregation node merges its data. The data of the aggregation node includes the data of the popped branch nodes and / or the data of the previous aggregation node. This approach better decouples backend data from frontend data, ensuring that modifications to the frontend's ID generation strategy do not affect the backend's strategy calculation logic. The backend algorithm is more efficient and does not require searching for related nodes through a pre-defined logic. Attached Figure Description
[0040] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0041] Figure 1 A flowchart of the data merging method of the engine strategy described in an embodiment of this application is shown;
[0042] Figure 2 A schematic diagram of the target engine strategy described in an embodiment of this application is shown;
[0043] Figure 3 A flowchart illustrating the method for constructing a target engine strategy according to an embodiment of this application is shown;
[0044] Figure 4 This paper illustrates a flowchart of a method for merging data from popped branch nodes in a summary node, as described in an embodiment of this application.
[0045] Figure 5 This document illustrates a flowchart of a method for merging data from popped branch nodes and data from the previous summary node in an embodiment of this application.
[0046] Figure 6 A schematic diagram of the data merging device for the engine strategy described in an embodiment of this application is shown;
[0047] Figure 7 A schematic diagram of the structure of the electronic device described in an embodiment of this application is shown. Detailed Implementation
[0048] 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. It should be understood that the accompanying drawings in this application are for illustrative and descriptive purposes only and are not intended to limit the scope of protection of this application. Furthermore, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of this application. It should be understood that the operations in the flowcharts may not be implemented in sequence, and steps without logical contextual relationships may be reversed or implemented simultaneously. In addition, those skilled in the art, guided by the content of this application, may add one or more other operations to the flowcharts, or remove one or more operations from the flowcharts.
[0049] Furthermore, the described embodiments are merely some, not all, of the embodiments of this application. The components of the embodiments of this application described and illustrated herein can typically be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0050] It should be noted that the term "comprising" will be used in the embodiments of this application to indicate the presence of the features declared thereafter, but does not exclude the addition of other features.
[0051] With the development of society and technology, e-commerce has become increasingly advanced, and various new retail platforms have sprung up like mushrooms after rain. The functions of browsing products, shopping, and payment on new retail platforms are realized based on big data platforms.
[0052] Currently, there are many open-source rule computation engines in the decision engine field, such as DROOLS and BLAZE. These rule engines generally adopt a programmatic approach, where all policy merging is implemented by strategists writing specific code, without needing to solve the branch merging problem at the framework level.
[0053] The R+ system of the big data platform implements strategy calculation in a non-programming manner. Strategy personnel only need to generate strategies by dragging and dropping. Therefore, the engine framework needs to solve the problem of merging data between branch and summary nodes. The data required for data merging includes the data of the predecessor node of the current summary node and the data of the corresponding branch node of the current summary node. The data of the predecessor node is relatively easy to obtain. The core problem to be solved is how to obtain the data of the corresponding branch node of the summary node.
[0054] Currently, the strategy engine relies on the front-end page to assign a unique ID to each node. When a branch node is encountered, the IDs of subsequent branches will include the branch node's ID. This way, when the back-end strategy calculation finds the corresponding branch node in the summary node, it only needs to query the node by name. The drawbacks of this existing technology are as follows: back-end logic development is heavily dependent on the front-end; if the ID generation logic on the front-end changes, it will lead to inaccurate strategy calculations; the ID should only serve as a unique identifier for a node and should not be given further computational meaning; and back-end strategy structure validation becomes extremely complex.
[0055] Based on this, embodiments of this application provide a data merging method, apparatus, electronic device, and medium for an engine strategy. The data merging method executes a pre-constructed target engine strategy. The target engine strategy includes at least one branch node and at least one aggregation node. The execution order of each branch node in the target engine strategy is determined, and the data of each branch node is pushed onto a stack according to the execution order. The execution order of each aggregation node in the target engine strategy is determined, and the data of each branch node is popped from the stack according to the execution order. The data of the branch node corresponding to the currently executing aggregation node is located at the top of the stack. Each aggregation node merges its data. The data of the aggregation node includes the data of the popped branch nodes and / or the data of the previous aggregation node. In this way, the backend data is better decoupled from the frontend data, and modifications to the frontend ID generation strategy do not affect the backend strategy calculation logic. The backend algorithm is more efficient and does not require searching for related nodes through some agreed-upon logic.
[0056] Please refer to Figure 1 , Figure 1 A flowchart of the data merging method of the engine strategy described in an embodiment of this application is shown; the method includes the following steps S101-S104;
[0057] S101. Execute the pre-built target engine strategy; wherein the target engine strategy includes at least one branch node and at least one summary node;
[0058] S102. Determine the execution order of each branch node in the target engine strategy, and push the data of each branch node onto the stack in the order of execution.
[0059] S103. Determine the execution order of each summary node in the target engine strategy, and pop the data of the branch nodes from the stack in the order of execution of the summary nodes; wherein, the data of the branch node corresponding to the currently executing summary node is located at the top of the stack.
[0060] S104. Each summary node merges the data of that summary node; wherein, the data of the summary node includes the data of the popped branch nodes and / or the data of the previous summary node.
[0061] The data merging method described in this application executes a pre-built target engine strategy, determines the execution order of each branch node in the target engine strategy, and pushes the data of each branch node onto the stack in the order of branch node execution; determines the execution order of each summary node in the target engine strategy, and pops the data of each branch node from the stack in the order of summary node execution; wherein, the data of the branch node corresponding to the currently executing summary node is located at the top of the stack; each summary node merges the data of that summary node; in this way, it no longer relies on ID for structure judgment, and cleverly solves the problem of node data identification by using a stack as a data structure. When a branch node is encountered, the branch node is pushed onto the stack, and when a summary node is encountered, the previous node is popped from the stack, and that node is the branch node corresponding to the summary node; thereby, the backend data is better decoupled from the frontend data, and the modification of the frontend ID generation strategy will not affect the backend strategy calculation logic; the backend algorithm is more efficient and does not need to search for related nodes through some agreed logic.
[0062] In step S101, a pre-built target engine strategy is executed; wherein the target engine strategy includes at least one branch node and at least one summary node.
[0063] Please refer to Figure 2 , Figure 2 A schematic diagram of the target engine strategy described in an embodiment of this application is shown; in Figure 2There are two branch nodes and two summary nodes. The two branch nodes are branch 1 and branch 2, and the two summary nodes are the first summary node connected to branch 2 and the next node after the first summary node.
[0064] In the embodiments of this application, please refer to Figure 3 The target engine strategy is constructed through the following methods.
[0065] Built by:
[0066] S301. Determine at least one branch node and at least one summary node in the target engine strategy;
[0067] S302. Determine the target connection relationship between the at least one branch node and the at least one summary node according to the push order of the data of the branch node and the pop order of the data of the summary node, so that when the summary nodes are executed sequentially according to the execution order of the target engine strategy, the data of the branch node corresponding to the currently executed summary node is located at the top of the stack.
[0068] S303. Connect the least one branch node and at least one summary node according to the target connection relationship to obtain the constructed target engine strategy.
[0069] In other words, the target engine strategy is constructed based on the correspondence between branch nodes and summary nodes, and the rules of data push and pop. This ensures that the data of the branch node corresponding to the currently executing summary node is located at the top of the stack. Therefore, when a summary node is encountered, the previous node will be popped from the stack, and that node is the branch node corresponding to the summary node.
[0070] In step S102, the execution order of each branch node in the target engine strategy is determined, and the data of each branch node is pushed onto the stack in the order of execution.
[0071] Specifically, the execution order of each branch node in the target engine strategy is determined, and the data of each branch node is pushed onto the stack in the order of execution, including:
[0072] Execute each node of the target engine strategy in sequence, and determine whether the currently executed node is a branch node;
[0073] If so, push the data of that branch node onto the stack.
[0074] In other words, the execution order of each branch node in the target engine strategy is determined based on the structure of the target engine strategy itself. Specifically, when a branch node is encountered during the execution of the target engine strategy, the data of the branch node is pushed onto the stack.
[0075] For example, Figure 2The process starts from the beginning node. When it reaches branch 1, the data of branch 1 is pushed onto the stack. At this time, the data in the stack is the data of branch 1.
[0076] When execution reaches branch 2, the data of branch 2 is pushed onto the stack. At this time, the data in the stack consists of the data of branch 1 and the data of branch 2, and the top element of the stack is the data of branch 2.
[0077] In step S103, the execution order of each summary node in the target engine strategy is determined, and the data of the branch nodes are popped from the stack in sequence according to the execution order of the summary nodes.
[0078] Specifically, determine the execution order of each aggregation node in the target engine strategy, and pop the data from the branch nodes sequentially according to the execution order of the aggregation nodes, including:
[0079] Execute each node of the target engine strategy sequentially, and determine whether the currently executing node is a summary node;
[0080] If so, pop the data from the branch node at the top of the stack.
[0081] In other words, the execution order of each aggregation node in the target engine strategy is also determined based on the structure of the target engine strategy itself. Specifically, during the execution of the target engine strategy, when an aggregation node is encountered, the data of the branch node at the top of the stack is popped off the stack. Since the target engine strategy determines the target connection relationship between nodes based on the order in which the data of the branch nodes are pushed onto the stack and the order in which the data of the aggregation node is popped off the stack, the data of the branch node that is popped off the stack is the data of the corresponding branch node of the aggregation node, and it is also the data that needs to be merged in the aggregation node.
[0082] For example, please refer to Figure 2 When the first summary is executed, a pop operation is performed. At this time, the top element of the stack is the data of branch 2, and the branch node corresponding to the first summary node is branch 2. After the pop operation is completed, the data in the stack is the data of branch 1.
[0083] When the second summary is executed, a pop operation is performed. At this time, the top element of the stack is branch 1, and the branch node corresponding to the second summary node is branch 1. After the pop operation is completed, the data in the stack is cleared.
[0084] In step S104, each aggregation node merges the data of that aggregation node; wherein, the data of the aggregation node includes the data of the popped branch nodes and / or the data of the previous aggregation node.
[0085] Specifically, each aggregation node merges the data of that aggregation node, including:
[0086] The summary node merges the data from the popped branch nodes;
[0087] or,
[0088] The summary node merges the data of the popped branch nodes and the data of the previous summary node.
[0089] Here, the previous summary node is the summary node that is connected to the current summary node and precedes the current summary node.
[0090] The data summarized by the summary node is determined based on the type of the previous nodes to which the summary node is connected.
[0091] Please refer to Figure 2 The data source for the first summary is only branch 2. Therefore, the first summary only needs to merge the data of the popped branch nodes. The second summary connects the first summary and branch 1. The data source is the data output by the first summary and the data of branch 1. Therefore, the second summary node merges the data of the popped branch nodes and the data of the previous summary node.
[0092] Please refer to Figure 4 In this embodiment of the application, the data of the branch nodes that are popped from the stack by the summary node includes the following steps S401-S402:
[0093] S401. After the data of the branch node is popped from the stack, the data of the branch node is processed according to the data processing rules corresponding to the multiple branches of the branch node to obtain the data of the branch node after multiple processing.
[0094] S402, The summary node merges the data from multiple processed branch nodes.
[0095] Please refer to Figure 2. From the framework diagram of the target engine strategy shown in the figure, the data in branch 2 has undergone two different processing steps, resulting in two different types of data for the branch nodes. The first summary node merges the data from these two types of processed branch nodes.
[0096] Here, the processing rules for each branch of the branch node are different. The processing rules include filtering data according to filtering conditions; and / or processing data according to rules, such as sorting the data, etc.
[0097] In the embodiments of this application, please refer to Figure 5 The summarizing node merges the data of the popped branch nodes and the data of the previous summarizing node, including the following steps S501-S502:
[0098] S501. After the data of the branch node is popped from the stack, the data of the branch node is processed according to the data processing rules of the branch node to obtain the processed data of the branch node.
[0099] S502, the summary node merges the processed data of the branch node with the data of the previous summary node.
[0100] Based on the same inventive concept, this application also provides an engine strategy data merging device corresponding to the engine strategy data merging method. Since the principle of the device in this application is similar to the above-mentioned engine strategy data merging method in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.
[0101] Please refer to Figure 6 , Figure 6 A schematic diagram of the data merging device for the engine strategy described in this application embodiment is shown; specifically, the data merging device includes:
[0102] The execution module 601 is used to execute a pre-built target engine strategy; wherein the target engine strategy includes at least one branch node and at least one summary node;
[0103] The first determining module 602 is used to determine the execution order of each branch node in the target engine strategy, and to push the data of each branch node onto the stack in the order of execution of the branch nodes.
[0104] The second determining module 603 is used to determine the execution order of each summary node in the target engine strategy, and pop the data of the branch nodes from the stack in the order of execution of the summary nodes; wherein, the data of the branch node corresponding to the currently executing summary node is located at the top of the stack.
[0105] The merging module 604 is used to merge the data of each summary node; wherein the data of the summary node includes the data of the popped branch nodes and / or the data of the previous summary node.
[0106] This application provides a data merging device for an engine strategy, which executes a pre-built target engine strategy. The target engine strategy includes at least one branch node and at least one aggregation node. The execution order of each branch node in the target engine strategy is determined, and the data of each branch node is pushed onto a stack according to the execution order. The execution order of each aggregation node in the target engine strategy is determined, and the data of each branch node is popped from the stack according to the execution order. The data of the branch node corresponding to the currently executing aggregation node is located at the top of the stack. Each aggregation node merges its data. The data of the aggregation node includes the data of the popped branch nodes and / or the data of the previous aggregation node. This better decouples backend data from frontend data, ensuring that modifications to the frontend's ID generation strategy do not affect the backend's strategy calculation logic. The backend algorithm is more efficient, eliminating the need for searching related nodes through a pre-defined logic.
[0107] In some embodiments, the data merging apparatus for the engine strategy further includes:
[0108] Build modules are used to construct target engine strategies;
[0109] Specifically, the building module is used to determine at least one branch node and at least one summary node in the target engine strategy;
[0110] Based on the push order of data in the branch nodes and the pop order of data in the summary nodes, the target connection relationship between the at least one branch node and the at least one summary node is determined, so that when the summary nodes are executed sequentially according to the execution order of the target engine strategy, the data of the branch node corresponding to the currently executed summary node is located at the top of the stack.
[0111] Based on the target connection relationship, connect at least one branch node and at least one summary node to obtain the constructed target engine strategy.
[0112] In some embodiments, the first determining module in the data merging device of the engine strategy, when determining the execution order of each branch node in the target engine strategy and sequentially pushing the data of each branch node onto the stack according to the execution order of the branch nodes, is specifically used for:
[0113] Execute each node of the target engine strategy in sequence, and determine whether the currently executed node is a branch node;
[0114] If so, push the data of that branch node onto the stack.
[0115] In some embodiments, the second determining module in the data merging device of the engine strategy, when determining the execution order of each aggregation node in the target engine strategy and popping the data of the branch nodes sequentially according to the execution order of the aggregation nodes, is specifically used for:
[0116] Execute each node of the target engine strategy sequentially, and determine whether the currently executing node is a summary node;
[0117] If so, pop the data from the branch node at the top of the stack.
[0118] In some embodiments, the merging module in the data merging device of the engine strategy, when merging the data of each aggregation node, is specifically used for:
[0119] The summary node merges the data from the popped branch nodes;
[0120] or,
[0121] The summary node merges the data of the popped branch nodes and the data of the previous summary node.
[0122] In some embodiments, the merging module in the data merging device of the engine strategy, when merging the data of the branch nodes popped from the stack at the aggregation node, is specifically used for:
[0123] After the data of the branch node is popped from the stack, the data of the branch node is processed according to the data processing rules corresponding to the multiple branches of the branch node, resulting in multiple processed branch node data.
[0124] The summary node merges data from various processed branch nodes.
[0125] In some embodiments, the merging module in the data merging device of the engine strategy, when merging the data of the popped branch node and the data of the previous summary node at the summary node, is specifically used for:
[0126] After the data of the branch node is popped from the stack, the data of the branch node is processed according to the data processing rules of the branch node to obtain the processed data of the branch node;
[0127] The summary node merges the data from the processed branch nodes with the data from the previous summary node.
[0128] Based on the same inventive concept, this application also provides an electronic device corresponding to the data merging method of the engine strategy. Since the principle of the electronic device in this application is similar to the data merging method of the engine strategy described above in this application, the implementation of the electronic device can refer to the implementation of the method, and the repeated parts will not be described again.
[0129] Please refer to Figure 7 , Figure 7 The diagram shows the structure of the electronic device according to an embodiment of this application. Specifically, the electronic device 700 includes a processor 702, a memory 701, and a bus. The memory 701 stores machine-readable instructions that can be executed by the processor 702. When the electronic device 700 is running, the processor 702 communicates with the memory 701 through the bus. When the machine-readable instructions are executed by the processor 702, the steps of the data merging method of the engine strategy are performed.
[0130] Based on the same inventive concept, this application also provides a computer-readable storage medium corresponding to the data merging method of the engine strategy. Since the principle of the computer-readable storage medium in this application is similar to the data merging method of the engine strategy described above in this application, the implementation of the computer-readable storage medium can refer to the implementation of the method, and the repeated parts will not be described again.
[0131] A computer-readable storage medium storing a computer program that, when executed by a processor, performs the steps of the data merging method of the engine strategy.
[0132] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems and devices described above can be referred to the corresponding processes in the method embodiments, and will not be repeated here. In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces; the indirect coupling or communication connection of devices or modules can be electrical, mechanical, or other forms.
[0133] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0134] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0135] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a processor-executable, non-volatile, computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a platform server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0136] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A data merging method for an engine strategy, characterized in that, The data merging method includes: Execute a pre-built target engine strategy; wherein the target engine strategy includes at least one branch node and at least one summary node; Determine the execution order of each branch node in the target engine strategy, and push the data of each branch node onto the stack in the order of execution. The execution order of each summary node in the target engine strategy is determined, and the data of the branch nodes are popped off the stack in sequence according to the execution order of the summary nodes; wherein, the connection relationship between the branch nodes and the summary nodes of the target engine strategy is determined according to the data push order of the branch nodes and the data pop order of the summary nodes, so as to ensure that when the summary nodes are executed in sequence according to the execution order of the target engine strategy, the data of the branch node corresponding to the currently executed summary node is at the top of the stack. Each aggregation node merges the data of that aggregation node; wherein the data of the aggregation node includes the data of the popped branch nodes and / or the data of the previous aggregation node.
2. The data merging method for engine strategies according to claim 1, characterized in that, The target engine strategy is constructed using the following method: Identify at least one branch node and at least one summary node in the target engine strategy; Based on the push order of data in the branch nodes and the pop order of data in the summary nodes, the target connection relationship between the at least one branch node and the at least one summary node is determined, so that when the summary nodes are executed sequentially according to the execution order of the target engine strategy, the data of the branch node corresponding to the currently executed summary node is located at the top of the stack. Based on the target connection relationship, connect at least one branch node and at least one summary node to obtain the constructed target engine strategy.
3. The data merging method for engine strategies according to claim 1, characterized in that, Determine the execution order of each branch node in the target engine strategy, and push the data of each branch node onto the stack in the order of execution, including: Execute each node of the target engine strategy in sequence, and determine whether the currently executed node is a branch node; If so, push the data of that branch node onto the stack.
4. The data merging method for engine strategies according to claim 1, characterized in that, Determine the execution order of each aggregation node in the target engine strategy, and pop the data from the branch nodes sequentially according to the execution order of the aggregation nodes, including: Execute each node of the target engine strategy sequentially, and determine whether the currently executing node is a summary node; If so, pop the data from the branch node at the top of the stack.
5. The data merging method for engine strategies according to claim 1, characterized in that, Each summary node merges the data from that summary node, including: The summary node merges the data from the popped branch nodes; or, The summary node merges the data of the popped branch nodes and the data of the previous summary node.
6. The method according to claim 5, characterized in that, The data from the branch nodes that are merged out of the stack by the summary node includes: After the data of the branch node is popped from the stack, the data of the branch node is processed according to the data processing rules corresponding to the multiple branches of the branch node, resulting in multiple processed branch node data. The summary node merges data from various processed branch nodes.
7. The method according to claim 5, characterized in that, The summary node merges the data of the popped branch nodes and the data of the previous summary node, including: After the data of the branch node is popped from the stack, the data of the branch node is processed according to the data processing rules of the branch node to obtain the processed data of the branch node; The summary node merges the data from the processed branch nodes with the data from the previous summary node.
8. A data merging device for an engine strategy, characterized in that, The data merging device includes: An execution module is used to execute a pre-built target engine strategy; wherein the target engine strategy includes at least one branch node and at least one summary node; The first determining module is used to determine the execution order of each branch node in the target engine strategy, and to push the data of each branch node onto the stack in the order of execution. The second determining module is used to determine the execution order of each summary node in the target engine strategy, and pop the data of the branch nodes sequentially according to the execution order of the summary nodes; wherein, the connection relationship between the branch nodes and the summary nodes of the target engine strategy is determined according to the data push order of the branch nodes and the data pop order of the summary nodes, so as to ensure that when the summary nodes are executed sequentially according to the execution order of the target engine strategy, the data of the branch node corresponding to the currently executed summary node is located at the top of the stack. The merge module is used to merge the data of each summary node; wherein the data of the summary node includes the data of the popped branch nodes and / or the data of the previous summary node.
9. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the data merging method of the engine strategy as described in any one of claims 1 to 7 are performed.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the data merging method of the engine strategy as described in any one of claims 1 to 7.