Business processing method and device
By storing multiple nodes in the node pool and acquiring the target nodes based on configuration information, generating node chains to complete business processing, the problem of large system resource consumption during process orchestration is solved and system performance is improved.
Patent Information
- Application Number
- CN202110169045.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-07
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2041-02-07
AI Technical Summary
During the process orchestration process, process components need to be frequently registered or configured, resulting in a large consumption of system resources.
By storing multiple nodes in the node pool, each node is used to process preset business logic, directly obtain the target node based on the configuration information of the target service, generate the node chain and complete the business processing process.
Reduces the consumption of system resources during process orchestration and improves system performance.
Smart Images

Figure CN113760230B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a business processing method and device. Background Art
[0002] The design idea of process orchestration is to determine the processing flow of different businesses by arranging pre-written process components according to different business requirements. Process orchestration can enhance the reusability of code, reduce software development costs and testing costs, improve software maintainability and reduce maintenance costs. However, the process of process orchestration may require frequent registration or configuration of process components, which consumes more system resources. Summary of the invention
[0003] In view of this, an embodiment of the present invention provides a business processing method and device, which can reduce the system resources required for the process orchestration process.
[0004] In a first aspect, an embodiment of the present invention provides a service processing method, including:
[0005] Determine the configuration information of the target business;
[0006] According to the configuration information, at least one target node is obtained from a node pool, wherein the node pool stores a plurality of nodes, and the nodes are used to process preset business logic;
[0007] Generating a node chain corresponding to the target service according to the at least one target node;
[0008] According to the node chain, the processing flow of the target business is completed.
[0009] Optionally, the determining of the configuration information of the target service includes:
[0010] Monitoring whether the remote configuration information of the target service has been updated;
[0011] If yes, updating the local configuration information of the target service according to the updated remote configuration information;
[0012] The configuration information of the target service is determined according to the updated local configuration information.
[0013] Optionally, generating a node chain corresponding to the target service according to the at least one target node includes:
[0014] Determining a first node order of the at least one target node according to the configuration information;
[0015] The at least one target node is sorted according to the first node sequence to generate a node chain corresponding to the target business.
[0016] Optionally, the at least one target node includes: a static node, the static node is used to process business logic preset in a general business scenario;
[0017] The process of completing the target business according to the node chain includes:
[0018] From the node chain, obtain the current node;
[0019] Determine whether the current node is a static node;
[0020] If so, execute the processing logic corresponding to the current node.
[0021] Optionally, the at least one node includes: a static parent node, the static parent node is used to split into at least one dynamic node, and the dynamic node is used to process the business logic preset in the target business scenario;
[0022] The process of completing the target business according to the node chain includes:
[0023] From the node chain, obtain the current node;
[0024] Determine whether the current node is a static parent node;
[0025] If yes, obtain current environment parameters; determine at least one target dynamic node according to the current environment parameters and the current node;
[0026] The processing logic corresponding to the at least one target dynamic node is executed in sequence.
[0027] Optionally, determining at least one target dynamic node according to the current environment parameter and the current node includes:
[0028] Determine at least one target dynamic node and a second node order of the at least one target dynamic node according to the current environment parameter and the current node;
[0029] The sequentially executing the processing logic corresponding to the at least one target dynamic node includes:
[0030] inserting the at least one target dynamic node into the node chain according to the second node sequence;
[0031] The processing logic of each target dynamic node in the node chain is executed in sequence.
[0032] Optionally, inserting the at least one target dynamic node into the node chain according to the second node sequence includes:
[0033] Determine a next node corresponding to the current node;
[0034] inserting the at least one dynamic node after the current node in sequence according to the second node sequence;
[0035] A bridge node is inserted after the last inserted dynamic node and before the next node.
[0036] In a second aspect, an embodiment of the present invention provides a service processing device, including:
[0037] An information determination module, used to determine the configuration information of the target service;
[0038] A node acquisition module, used to acquire at least one target node from a node pool according to the configuration information, wherein the node pool stores a plurality of nodes, and the nodes are used to process preset business logic;
[0039] A node chain generation module, used to generate a node chain corresponding to the target business according to the at least one target node;
[0040] The business processing module is used to complete the processing flow of the target business according to the node chain.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, including:
[0042] one or more processors;
[0043] a storage device for storing one or more programs,
[0044] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.
[0045] In a fourth aspect, an embodiment of the present invention provides a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method described in any of the above embodiments.
[0046] An embodiment of the above invention has the following advantages or beneficial effects: a node pool is set, and a plurality of nodes are stored in the node pool, and each node is used to process the preset business logic. According to the configuration information of the target business, the target node can be directly obtained from the node pool without registering or configuring the process component, thereby reducing the system resources required for the orchestration process and improving the system performance.
[0047] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.
[0049] Figure 1 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;
[0050] Figure 2 It is a schematic diagram of a process of a business processing method provided by an embodiment of the present invention;
[0051] Figure 3 is a schematic diagram of the structure of a node pool provided by an embodiment of the present invention;
[0052] Figure 4 is a schematic diagram of a node chain structure provided by an embodiment of the present invention;
[0053] Figure 5 is a schematic diagram of the architecture of a business processing system provided by an embodiment of the present invention;
[0054] Figure 6 is a schematic diagram of a process of another business processing method provided by an embodiment of the present invention;
[0055] Figure 7 is a schematic diagram of a process of another business processing method provided by an embodiment of the present invention;
[0056] Figure 8 is a schematic diagram of the structure of an original node chain provided by an embodiment of the present invention;
[0057] Fig. 9 is a schematic diagram of the structure of a static parent node provided by an embodiment of the present invention;
[0058] Figure 10-1 Yes Fig. 9 The dynamic nodes split from the static parent node shown are inserted Figure 8 The process diagram of the original node chain shown;
[0059] Figure 10-2 yes Figure 10-1 Schematic diagram of the process of dynamic node insertion afterwards;
[0060] Figure 10-3 yes Figure 10-2 Schematic diagram of the process of dynamic node insertion afterwards;
[0061] Figure 10-4 yes Figure 10-3 Schematic diagram of the process of dynamic node insertion afterwards;
[0062] Fig.11 is a schematic diagram of the structure of a service processing device provided by an embodiment of the present invention;
[0063] Fig.12 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0065] like Figure 1 As shown, the system architecture 100 may include communication devices 101, 102, 103, a network 104, and a configuration center 105. The network 104 is used to provide a medium for storing communication links between the communication devices 101, 102, 103 and the configuration center 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0066] The configuration center 105 may store remote configuration information of each service. Relevant technicians may flexibly configure the remote configuration information according to system failures, service requirements of special application scenarios, deployment environment, etc. The communication devices 101, 102, and 103 may monitor the remote configuration information on the configuration center 105 so as to obtain the latest configuration content in a timely manner and refresh the local configuration information.
[0067] The communication devices 101, 102, and 103 determine the configuration information of the target service according to the local configuration information; obtain at least one target node from the node pool according to the configuration information, and generate a node chain corresponding to the target service; and complete the processing flow of the target service according to the node chain.
[0068] It should be noted that the service processing method and service processing method provided in the embodiments of the present invention are generally executed by the communication devices 101 , 102 , and 103 , and accordingly, the service processing device and service processing device are generally arranged in the communication devices 101 , 102 , and 103 .
[0069] It should be understood that Figure 1 The number of communication devices, networks and configuration centers in the embodiment is only for illustration. Any number of communication devices, networks and configuration centers may be provided according to implementation requirements.
[0070] Figure 2 is a schematic diagram of a process of a business processing method provided by an embodiment of the present invention, such as Figure 2 As shown, the method includes:
[0071] Step 201: Determine configuration information of the target service.
[0072] Configuration information is information needed to orchestrate the target business. Configuration information may include: node identification, node metadata information, node sequence information, process links, environmental parameter information, etc.
[0073] Step 202: According to the configuration information, at least one target node is obtained from the node pool, where a plurality of nodes are stored, and the nodes are used to process preset business logic.
[0074] According to the needs of different businesses in each business scenario, the implementation logic of each business can be refined and split into multiple nodes with a single function. Nodes with different functions can be orchestrated to complete a specific business.
[0075] The node pool is used to store multiple nodes with node identifiers, which are unique. In the software development industry, the node pool can also be called a container, and the node can also be called an instance. The node is instantiated and placed in the container. Each node has its own unique identifier. The node also has its own serial number to determine the position of the node in the linked list. Figure 3 FIG. 1 is a schematic diagram of a node pool structure provided by an embodiment of the present invention. Figure 3 As shown, the embodiment of the present invention provides three types of nodes: static node, static parent node, dynamic node. Each node can be any of these three types.
[0076] Static nodes can be used directly to orchestrate business processes and cannot be split. They are generally used to process common logic. The logic applicable to all business lines in the system can be abstracted as static nodes.
[0077] Static parent nodes can be used directly to orchestrate business processes. They need to be split and consist of multiple dynamic nodes. In principle, static parent nodes do not participate in any business logic and are only responsible for splitting into multiple dynamic nodes.
[0078] Dynamic nodes cannot be used directly to orchestrate business processes. They are split from static parent nodes and belong only to a fixed static parent node. They are used to handle special business scenarios.
[0079] The node pool stores static nodes, static parent nodes, and dynamic nodes. Each node has a unique number and is in an unordered state in the node pool. A dynamic node belongs to only one static parent node, which is implemented by default rules. When the linked list needs node information, it searches the node pool through the node identifier to find a unique node instance for the linked list to use.
[0080] The node pool can be implemented by a lightweight container, such as a Spring container, or a heavyweight EJB container, or even a collection. The specific choice is determined by the architecture solution. It is usually required to be able to manage the node life cycle, support dependency injection, implement inversion of control, and be able to find node information based on node identifiers.
[0081] Step 203: Generate a node chain corresponding to the target business according to at least one target node.
[0082] The node chain is formed by combining each target node in the execution order of each target node. Figure 4 FIG. 1 is a schematic diagram of a node chain structure provided by an embodiment of the present invention. Figure 4 As shown in the figure, the configuration information of the business can be implemented in the form of an array, and the value of the configuration information occupies a continuous storage space in the memory. The array only records the node identification, whether it needs to be skipped and other metadata information, and the actual content in the node chain is obtained by searching in the node pool at runtime. In this way, a virtual linked list structure is formed, and the final linked list content is dynamically generated according to the configuration information.
[0083] Each node in the node chain only records metadata and does not directly point to the next node. It locates the next node by dynamically searching based on the business configuration information.
[0084] When the execution reaches the last node, since there is no subsequent node, the node will be returned in sequence after execution, thus ensuring the first-in-last-out execution order of the call stack.
[0085] Step 204: Complete the processing flow of the target business according to the node chain.
[0086] In the embodiment of the present invention, a node pool is set up, in which multiple nodes are stored, and each node is used to process the preset business logic. According to the configuration information of the target business, the target node can be directly obtained from the node pool without registering or configuring the process component. Therefore, the problem that the process arrangement process requires more system resources can be solved.
[0087] In a first embodiment of the present invention, determining the configuration information of the target service includes:
[0088] Monitor whether the remote configuration information of the target business has been updated;
[0089] If yes, then update the local configuration information of the target service according to the updated remote configuration information;
[0090] The configuration information of the target service is determined according to the updated local configuration information.
[0091] Remote configuration information is used to store the configuration information of the process arrangement of multiple businesses in the system. The remote configuration information of multiple business processes of multiple related business systems can be stored in the same configuration center. Relevant technicians can flexibly configure remote configuration information through the configuration center according to system failures, business requirements of special application scenarios, deployment environment, etc.
[0092] Figure 5 FIG. 1 is a schematic diagram of the architecture of a business processing system provided by an embodiment of the present invention. Figure 5 As shown, remote configuration information can come from the local file system or a remote configuration center: such as a Web (World Wide Web, Global Wide Area Network) server, file server, database, etc. After pulling these configurations, simple data verification and format conversion operations are required, and the processed configuration information is stored in the local configuration information. At the same time, the remote configuration information should be monitored to obtain the latest configuration content in a timely manner and refresh the local configuration information.
[0093] In a first embodiment of the present invention, generating a node chain corresponding to a target service according to at least one target node includes:
[0094] Determining a first node order of at least one target node according to the configuration information;
[0095] According to the first node sequence, at least one target node is sorted to generate a node chain corresponding to the target business.
[0096] The first node order is used to characterize the position of each target node in the node chain. The first node order can be determined in a variety of ways. For example, the first node order can be determined by the order information of each node in the configuration information. The first node order can also be determined by the order in which each node is placed in the configuration information. The embodiment of the present invention does not limit the implementation method of how to determine the first node order based on the configuration information.
[0097] Figure 6 FIG. 1 is a schematic diagram of another business processing method provided by an embodiment of the present invention. Figure 6 As shown, the process of the business processing method includes:
[0098] The node pool is initialized, each node is instantiated, and the instantiated nodes are placed in the node pool. Each node has a unique node identifier.
[0099] Business process configuration, obtains the configuration information of the target business from remote configuration information or local configuration information.
[0100] Initialize local configuration information according to the configuration information. The local configuration information only contains the node identifier, but does not include the specific node instance. You need to obtain the specific node instance by searching in the node pool.
[0101] Search for the node instance in the node pool based on the node ID in the local configuration information.
[0102] Sort each node and confirm the final node chain.
[0103] During execution, the static parent node will be split and filled by a series of dynamic nodes, and the last dynamic node will be bridged back to the original node chain.
[0104] Figure 7 is a schematic diagram of the process of another business processing method provided by an embodiment of the present invention, such as Figure 7 As shown, the method includes:
[0105] Step 701: Determine configuration information of the target service.
[0106] Step 702: According to the configuration information, obtain at least one target node from the node pool.
[0107] Step 703: Generate a node chain corresponding to the target business according to at least one target node.
[0108] Step 704: Get the current node from the node chain.
[0109] Step 705: Determine the node type of the current node.
[0110] The node type may include: a static node and a static parent node. The following step 706 or step 707 may be performed according to the node type.
[0111] It should be noted that the method of the embodiment of the present invention further includes obtaining metadata information of the current node. If the metadata information of the current node indicates that the current node needs to be skipped, the following step 706 or step 707 is not performed.
[0112] Step 706: If the current node is a static node, execute the processing logic corresponding to the current node.
[0113] Static nodes are used to process preset business logic in common business scenarios. The logic applicable to all business lines in the system can be abstracted into static nodes.
[0114] Step 707: If the current node is a static parent node, obtain the current environment parameters.
[0115] The static parent node is used to split into at least one dynamic node, and the dynamic node is used to process the business logic preset in the target business scenario. The logic applicable to special business scenarios in the system can be abstracted into dynamic nodes.
[0116] Step 708: Determine at least one target dynamic node according to the current environment parameters and the current node.
[0117] The current environment parameters may include: current business scenario parameters, fault automatic downgrade parameters, deployment environment parameters, etc.
[0118] For example, the general capability corresponding to the static parent node is: item purchase authority verification. The static parent node can be split into the following dynamic nodes: dynamic node 1, dynamic node 2, and dynamic node 3. Dynamic node 1 corresponds to the business logic of user-defined authority verification. Dynamic node 2 corresponds to the business logic of authority verification that only books can be purchased. Dynamic node 3 corresponds to the business logic of authority verification that only items in the customer's item pool can be purchased. It can be seen that the static parent node corresponds to the implementation of the general capability in the system, and the dynamic node corresponds to the implementation of the general capability in a special business scenario.
[0119] The process of determining the target dynamic node according to the current environment parameters is as follows: if the current environment parameters obtained are applied to user-defined permission verification, the static parent node will be split into dynamic node 1. If the current environment parameters obtained are applied to the purchase of books, the static parent node will be split into dynamic node 2. If the current environment parameters obtained are applied to the purchase of only items in the customer's item pool, the static parent node will be split into dynamic node 3.
[0120] For another example, the current environment parameters include fault automatic degradation parameters. When the system detects that there are some faulty nodes in the system, the faulty nodes can be skipped according to the fault automatic degradation parameters to achieve service degradation.
[0121] Step 709: Execute the processing logic corresponding to at least one target dynamic node in sequence.
[0122] In the embodiment of the present invention, by designing a new responsibility chain implementation algorithm, the next node can be dynamically calculated according to the current environmental parameters; through unified configuration management, online services can be adjusted in real time to achieve service degradation and disaster recovery.
[0123] In a first embodiment of the present invention, at least one target dynamic node is determined according to current environment parameters and current node, including:
[0124] Determine at least one target dynamic node and a second node order of at least one target dynamic node according to current environment parameters and a current node;
[0125] inserting at least one target dynamic node into the node chain according to the second node sequence;
[0126] Execute the processing logic of each target dynamic node in the node chain in sequence.
[0127] The second node order is used to characterize the front-to-back order of each target dynamic node in the node chain. The second node order can be determined in a variety of ways. For example, the second node order can be determined by the configuration information in the static parent node. The second node order can also be determined by the identifier of each target dynamic node in the node pool. The embodiment of the present invention does not limit the implementation method of how to determine the second node order.
[0128] In an embodiment of the present invention, at least one target dynamic node split from a static parent node is inserted into a node chain, and the next node can be dynamically selected according to the runtime state, thereby realizing flexible configuration of process orchestration and completing dynamic adjustment of runtime process orchestration.
[0129] In a first embodiment of the present invention, inserting at least one target dynamic node into the node chain according to the second node sequence includes:
[0130] Determine the next node corresponding to the current node;
[0131] Insert at least one dynamic node after the current node in sequence according to the second node sequence;
[0132] Insert a bridge node after the last inserted dynamic node and before the next node.
[0133] When a static parent node is encountered during execution, the static parent node will split and the dynamic node under the static parent node will be inserted to realize the dynamic selection process of the linked list. A bridge node will be automatically inserted at the end of the dynamic node to bridge the linked list and realize the connection between the dynamic linked list and the parent linked list.
[0134] Figure 8 FIG. 1 is a schematic diagram of the structure of an original node chain provided by an embodiment of the present invention. Figure 8 As shown, the node identifier of each node in the node list and the node order are defined by the configuration information. The application initializes the node list according to the configuration information and waits for the execution of the program. Figure 8 Node N2 in the node chain shown is a static parent node.
[0135] Fig. 9 FIG. 1 is a schematic diagram of a static parent node structure provided by an embodiment of the present invention. Fig. 9As shown, the static parent node corresponds to N2, and the static parent node corresponds to 6 dynamic nodes, whose node identifiers are: N2-0, N2-1, N2-2, N2-3, N2-4, N2-5, N2-6. The above dynamic nodes can be dynamically selected and inserted according to the current environment.
[0136] Figure 10-1 Yes Fig. 9 The dynamic nodes split from the static parent node shown are inserted Figure 8 The process diagram of the original node chain is shown in FIG. Figure 10-1 As shown, according to the current business scenario, if the result of dynamic selection is that N2-0, N2-1, and N2-5 need to be inserted into the linked list, N2-0, N2-1, and N2-5 need to be sorted first. If the sorting result is: N2-0, N2-1, and N2-5, N2-0 is inserted first. N2 is split, N2-0 is inserted, and the basic information of N2-0 is set. At this time, the complete linked list structure is not formed, waiting for the subsequent node N2-1 to be inserted.
[0137] Figure 10-2 yes Figure 10-1 The following is a schematic diagram of the dynamic node insertion process. Figure 10-2 As shown, N2-1 is inserted after N2-0, and sets basic information, waiting for N2-5 to join.
[0138] Figure 10-3 yes Figure 10-2 The following is a schematic diagram of the dynamic node insertion process. Figure 10-3 As shown, N2-5 is inserted at the end of the dynamic linked list. At this time, all dynamic nodes under N2 have been inserted (N2-2, N2-3, and N2-4 are not in the result of this dynamic selection). In order to ensure the integrity of the call link, a bridge node is inserted at the end of the dynamic link to form a complete linked list structure, connecting the dynamic linked list and the static linked list to form a complete link structure.
[0139] Figure 10-4 yes Figure 10-3 The following is a schematic diagram of the dynamic node insertion process. Figure 10-4 As shown, a bridge node DX is inserted at the end of the dynamic linked list to bridge the dynamic linked list and the static linked list, and a new, dynamically selected linked list is constructed.
[0140] The newly inserted node has the same status as other nodes, and the node type is not distinguished. The newly added dynamic nodes also have serial numbers and need to be sorted before insertion to ensure the order of the entire linked list; dynamic nodes and static nodes are sorted separately, that is, the newly inserted node will only be after the static node and before the next static node, thus ensuring the order of the entire linked list.
[0141] The bridge node is also a dynamic node. It is automatically initialized and added. The purpose is to bridge the linked list back to the original static link to ensure the integrity of the entire linked list. At the same time, after the node completes the method call, it can fall back to each newly added dynamic node to ensure the method stack order. The implementation of the bridge node only does one thing, which is to point the next node to the next static node and complete the merging action after the static node is split. It does not participate in any business logic.
[0142] Based on the same principle, if other static parent nodes are encountered later, such as N3, N4, etc., the same dynamic selection, insertion, and bridging process can be performed.
[0143] The method of the embodiment of the present invention provides an implementation scheme for processing special business scenarios through dynamic nodes, and has the following beneficial effects: it can flexibly complete static node configuration and static node skipping; obtain the latest configuration information in real time without restarting the service, and can be used to complete service degradation, such as skipping which service fault nodes; it can solve business segmentation problems in various complex scenarios, and process differences are processed through different dynamic nodes; it supports dynamic selection and insertion of nodes, and bridges dynamic linked lists and static linked lists.
[0144] Fig.11 1 is a schematic diagram of a business processing device provided by an embodiment of the present invention, including:
[0145] An information determination module 1101 is used to determine the configuration information of the target service;
[0146] A node acquisition module 1102 is used to acquire at least one target node from a node pool according to the configuration information, wherein the node pool stores a plurality of nodes, and the nodes are used to process preset business logic;
[0147] A node chain generating module 1103, configured to generate a node chain corresponding to the target service according to the at least one target node;
[0148] The business processing module 1104 is used to complete the processing flow of the target business according to the node chain.
[0149] Optionally, the information determination module 1101 is specifically used to:
[0150] Monitoring whether the remote configuration information of the target service has been updated;
[0151] If yes, updating the local configuration information of the target service according to the updated remote configuration information;
[0152] The configuration information of the target service is determined according to the updated local configuration information.
[0153] Optionally, the node chain generation module 1103 is specifically used for:
[0154] Determining a first node order of the at least one target node according to the orchestration configuration information;
[0155] The at least one target node is sorted according to the first node sequence to generate a node chain corresponding to the target business.
[0156] Optionally, the at least one target node includes: a static node, the static node is used to process business logic preset in a general business scenario;
[0157] The business processing module 1104 is specifically used for:
[0158] From the node chain, obtain the current node;
[0159] Determine whether the current node is a static node;
[0160] If so, execute the processing logic corresponding to the current node.
[0161] Optionally, the at least one node includes: a static parent node, the static parent node is used to split into at least one dynamic node, and the dynamic node is used to process the business logic preset in the target business scenario;
[0162] The business processing module 1104 is specifically used for:
[0163] From the node chain, obtain the current node;
[0164] Determine whether the current node is a static parent node;
[0165] If yes, obtain current environment parameters; determine at least one target dynamic node according to the current environment parameters and the current node;
[0166] The processing logic corresponding to the at least one target dynamic node is executed in sequence.
[0167] Optionally, the service processing module 1104 is specifically configured to:
[0168] Determine at least one target dynamic node and a second node order of the at least one target dynamic node according to the current environment parameter and the current node;
[0169] inserting the at least one target dynamic node into the node chain according to the second node sequence;
[0170] The processing logic of each target dynamic node in the node chain is executed in sequence.
[0171] Optionally, the service processing module 1104 is specifically configured to:
[0172] Determine a next node corresponding to the current node;
[0173] inserting the at least one dynamic node after the current node in sequence according to the second node sequence;
[0174] A bridge node is inserted after the last inserted dynamic node and before the next node.
[0175] An embodiment of the present invention provides an electronic device, including:
[0176] one or more processors;
[0177] a storage device for storing one or more programs,
[0178] When one or more programs are executed by one or more processors, the one or more processors implement the method of any of the above embodiments.
[0179] Reference below Fig.12 , which shows a schematic diagram of the structure of a computer system 1200 of a terminal device suitable for implementing an embodiment of the present invention. Fig.12 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0180] As shown in 12, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1202 or a program loaded from a storage part 1208 to a random access memory (RAM) 1203. In the RAM 1203, various programs and data required for the operation of the system 1200 are also stored. The CPU 1201, the ROM 1202, and the RAM 1203 are connected to each other through a bus 1204. An input / output (I / O) interface 1205 is also connected to the bus 1204.
[0181] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed, so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0182] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1209, and / or installed from the removable medium 1211. When the computer program is executed by the central processing unit (CPU) 1201, the above-mentioned functions defined in the system of the present invention are executed.
[0183] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0184] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0185] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, they may be described as: an information determination module, a node acquisition module, a node chain generation module, and a business processing module. The names of these modules do not, in some cases, constitute limitations on the modules themselves. For example, the information determination module may also be described as a "module for determining the configuration information of the target business."
[0186] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:
[0187] Determine the configuration information of the target business;
[0188] According to the configuration information, at least one target node is obtained from a node pool, wherein the node pool stores a plurality of nodes, and the nodes are used to process preset business logic;
[0189] Generating a node chain corresponding to the target service according to the at least one target node;
[0190] According to the node chain, the processing flow of the target business is completed.
[0191] According to the technical solution of the embodiment of the present invention, the target node can be directly obtained from the node pool according to the configuration information of the target business, without registering or configuring the process component. In the process of orchestrating each node, the embodiment of the present invention does not need to register or configure the process component, which can reduce the system resources required for the orchestration process and improve the system performance.
[0192] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A business processing method, characterized in that: include: Determine the configuration information of the target business; According to the configuration information, at least one target node is obtained from a node pool, wherein the node pool stores a plurality of nodes, and the nodes are used to process preset business logic; Generate a node chain corresponding to the target business according to the at least one target node; wherein the at least one target node includes: a static parent node, the static parent node is used to split into at least one dynamic node, and the dynamic node is used to process the business logic preset in the target business scenario; According to the node chain, completing the processing flow of the target business; The process of completing the target business according to the node chain includes: From the node chain, obtain the current node; Determine whether the current node is a static parent node; If so, obtain current environment parameters; determine at least one target dynamic node according to the current environment parameters and the current node; and execute processing logic corresponding to the at least one target dynamic node in sequence.
2. The method according to claim 1, characterized in that The configuration information of the target service is determined, including: Monitoring whether the remote configuration information of the target service has been updated; If yes, updating the local configuration information of the target service according to the updated remote configuration information; The configuration information of the target service is determined according to the updated local configuration information.
3. The method according to claim 2, characterized in that The generating, according to the at least one target node, a node chain corresponding to the target service includes: Determining a first node order of the at least one target node according to the configuration information; The at least one target node is sorted according to the first node sequence to generate a node chain corresponding to the target business.
4. The method according to claim 1, characterized in that: The at least one target node includes: a static node, which is used to process the business logic preset in the general business scenario; The process of completing the target business according to the node chain includes: From the node chain, obtain the current node; Determine whether the current node is a static node; If so, execute the processing logic corresponding to the current node.
5. The method according to claim 1, characterized in that The step of determining at least one target dynamic node according to the current environment parameter and the current node includes: Determine at least one target dynamic node and a second node order of the at least one target dynamic node according to the current environment parameter and the current node; The sequentially executing the processing logic corresponding to the at least one target dynamic node includes: inserting the at least one target dynamic node into the node chain according to the second node sequence; The processing logic of each target dynamic node in the node chain is executed in sequence.
6. The method according to claim 5, characterized in that The step of inserting the at least one target dynamic node into the node chain according to the second node sequence includes: Determine a next node corresponding to the current node; inserting the at least one dynamic node after the current node in sequence according to the second node sequence; A bridge node is inserted after the last inserted dynamic node and before the next node.
7. A service processing device, characterized in that: include: An information determination module, used to determine the configuration information of the target service; A node acquisition module, used to acquire at least one target node from a node pool according to the configuration information, wherein the node pool stores a plurality of nodes, and the nodes are used to process preset business logic; A node chain generation module, configured to generate a node chain corresponding to the target business according to the at least one target node; wherein the at least one target node includes: a static parent node, the static parent node is used to split into at least one dynamic node, and the dynamic node is used to process the business logic preset in the target business scenario; A business processing module, used to complete the processing flow of the target business according to the node chain; The business processing module is specifically used to: obtain the current node from the node chain; Determine whether the current node is a static parent node; If so, obtain current environment parameters; determine at least one target dynamic node according to the current environment parameters and the current node; and execute processing logic corresponding to the at least one target dynamic node in sequence.
8. An electronic device, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Business processing method and device of business system, storage medium and electronic equipment
CN112181402A