Micro-service scheduling method and device and storage medium
Through the combination of visual editor and scheduling engine, the complexity of microservice process orchestration is solved, business personnel are able to realize independent orchestration and efficient management, and improve the operating efficiency of microservice processes.
Patent Information
- Application Number
- CN202410820078.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-03
AI Technical Summary
Microservice process orchestration steps are complex and only professional developers can edit and configure them. As a result, business personnel cannot quickly define business processes independently, which affects the effective orchestration and management of microservice processes.
Use a visual editor to build a process orchestration interface, edit the process by dragging nodes and connecting, configure node information and calling relationships, and execute process instances through the scheduling engine, support aggregation and parallel node processing, and provide a process monitoring interface to display running information in real time .
It lowers the threshold for operators, enables business personnel to directly orchestrate and manage microservice processes, improves process orchestration and management efficiency, and improves process operation efficiency.
Smart Images

Figure CN118585178A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of microservice applications, and in particular to a microservice scheduling method. The present invention also relates to a microservice scheduling device based on the microservice scheduling method, and a computer-readable storage medium capable of implementing the microservice scheduling method. Background Art
[0002] In the auto finance industry, the pre-loan risk control process is a key link to ensure the safe issuance of loans. With the rapid development of information technology, more and more third-party information is integrated into the pre-loan risk control process, such as credit data, equipment information, micro-loan data, identity verification information, etc. At the same time, due to the increasing complexity of the business, the monolithic architecture is difficult to maintain, expand and upgrade, so the microservice architecture is widely used in the credit system to support various independent and scalable service functions.
[0003] The microservice architecture splits the application into a series of small, independent services, each of which runs in its own process and communicates using lightweight communication mechanisms (such as HTTP / REST or message queues). This architectural style allows each service to be developed, deployed, and expanded independently, improving the maintainability and scalability of the system.
[0004] However, the current steps in microservice process orchestration are complex and professional, requiring specialized developers to edit and configure microservice processes. The development threshold is high, and general business personnel are unable to quickly define business processes independently, which is not conducive to the effective orchestration and management of microservice processes. Summary of the invention
[0005] In view of this, the present invention aims to propose a microservice scheduling method to optimize the steps of microservice scheduling process orchestration and improve the efficiency of microservice process orchestration and management.
[0006] To achieve the above object, the technical solution of the present invention is achieved as follows:
[0007] A microservice scheduling method, the method comprising:
[0008] Build a visual editor that can perform process orchestration and process node editing for microservices;
[0009] Create a process instance through the visual editor, and configure node information and node call relationship in the process instance;
[0010] Building a database, the database is used to store the configured process instance;
[0011] Building a microservice scheduling engine, which is used to execute the configured process instance;
[0012] Retrieving the process instance from the database and executing the process instance through the scheduling engine;
[0013] Among them, when the scheduling engine executes the process instance, if there is an aggregation node in the process instance, after the upstream node of the aggregation node is executed, the subsequent node is executed, and if there is a parallel node in the process instance, the parallel node is parallel scheduled. .
[0014] Furthermore, the process instance is created through a visual editor, and node information and node call relationships in the process instance are configured, including:
[0015] Establishing a start node in the visual editor;
[0016] According to the process task requirements, the process is arranged in the visual editor by dragging nodes and connecting nodes;
[0017] Edit the node and configure the node name and node information in the process;
[0018] Define the connections between nodes and configure the calling relationships between nodes.
[0019] Furthermore, the node information includes the name of the node, the request address and the product code.
[0020] Furthermore, the process node types of the visual editor include at least one of a start node, a common node, an asynchronous node, a parallel node, an aggregation node, a decision node and an asynchronous sending node.
[0021] Further, the visual editor includes a process monitoring interface;
[0022] The process monitoring interface is used to display the running information of the process instance in real time.
[0023] Furthermore, the running information includes the process name, process status, process running time, and information of the nodes in progress.
[0024] Further, selecting a process instance from the database and executing the process instance through the scheduling engine includes:
[0025] Obtain the start node of the process instance and execute the node task of the start node;
[0026] Find the next node to be executed and parse the node information of the node to be executed;
[0027] Execute the node task of the node to be executed;
[0028] Callback execution result and update node record;
[0029] Repeat the process of searching for the next node to be executed, parsing the node information, and executing the node task until the final node in the process instance is executed.
[0030] Furthermore, the visual editor is built using Vue.js and JsPlumb components.
[0031] Compared with the prior art, the present invention has the following advantages:
[0032] The microservice scheduling method described in the present invention edits the microservice process and configures nodes through a visual editor, can provide an intuitive graphical interface, and allows users to edit and define microservice processes by dragging nodes and connecting lines, which is conducive to lowering the threshold for operators, allowing business personnel to directly arrange and define microservice processes, thereby improving the efficiency of microservice process orchestration and management, and executing the microservice scheduling engine through the scheduling engine can improve the efficiency of microservice process operation.
[0033] In addition, by configuring the connection information between nodes in the microservice process, the node call relationship in the microservice process can be defined, which is simple to operate and conducive to design and implementation. Defining the node name, request address and product code as node information to the node in the microservice process can better unify the management of each node and facilitate design and implementation.
[0034] In addition, the setting of the process monitoring interface can display the running information of the process instance in real time, which is helpful for better management of microservice processes, and the visual process monitoring interface can intuitively show the running information of the process, which is conducive to design and implementation. By displaying the name, status, running time and information of the ongoing nodes of the process separately, the running status of the process instance is more intuitively displayed, which is conducive to design and implementation. The scheduling engine can execute each node in the process in sequence according to the edited process until it runs to the end of the process instance, which is conducive to design and implementation. Using Vue.js and JsPlumb components helps developers build visual editors, which is conducive to design and implementation.
[0035] The present invention also proposes a microservice scheduling device based on the above-mentioned microservice scheduling method, the device comprising a first building module, a first processing module and a second processing module;
[0036] The first building module is used to build a visual editor, a database, and a microservice scheduling engine;
[0037] The first processing module is used to create a process instance and configure node information and node call relationship in the process instance;
[0038] The second processing module is used to retrieve the process instance from the database and execute the process instance through the scheduling engine;
[0039] Among them, when the scheduling engine executes the process instance, if there is an aggregation node in the process instance, after the upstream node of the aggregation node is executed, the subsequent node is executed, and if there are parallel nodes in the process instance, the parallel nodes are parallel scheduled.
[0040] In addition, the present invention also proposes a computer-readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the microservice scheduling method as described above can be implemented.
[0041] The microservice scheduling device and computer-readable storage medium of the present invention have the same beneficial effects as the microservice scheduling method described above, and will not be described in detail herein. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the accompanying drawings:
[0043] Figure 1 This is a flow chart of the microservice scheduling method according to an embodiment of the present invention;
[0044] Figure 2 This is a flowchart of step S2 of the microservice scheduling method according to an embodiment of the present invention;
[0045] Figure 3 This is a flowchart of step S5 of the microservice scheduling method according to an embodiment of the present invention;
[0046] Figure 4 A schematic diagram of the structure of a microservice scheduling device according to an embodiment of the present invention;
[0047] Description of reference numerals:
[0048] 100, a scheduling device; 101, a first building module; 102, a first processing module; 103, a second processing module. DETAILED DESCRIPTION
[0049] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0050] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0051] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0052] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0053] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0054] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0055] The present invention will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.
[0056] Embodiment 1
[0057] This embodiment relates to a microservice scheduling method, which involves process orchestration and node configuration in microservice scheduling, can optimize the steps of microservice scheduling process orchestration, and improve the efficiency of microservice process orchestration and management.
[0058] Among them, before describing the microservice scheduling method of this embodiment, it is necessary to briefly introduce the concepts involved in microservice scheduling. Microservice refers to a software architecture style that splits an application into a series of small, independent services. Each service runs in its own process and uses a lightweight communication mechanism to communicate. For example, in the pre-loan risk control process, functions such as data collection, data analysis, and decision-making can be split into independent microservices. The microservice scheduling method of this embodiment refers to process editing and node configuration of these microservices, and then executing the configured microservice process through the scheduling engine. The microservice process editing mentioned in this embodiment refers to the process of managing and coordinating microservices to ensure that each microservice can interact and collaborate in the expected order and rules.
[0059] Therefore, based on the above introduction, combined with Figure 1 As shown, in terms of overall design, the microservice scheduling method of this embodiment includes the following steps.
[0060] Step S1: Build a visual editor that can perform process orchestration and process node editing for microservices.
[0061] Among them, in this step S1, building a visual editor can be built through Vue.js and JsPlumb components. The process node types in the visual editor include at least one of a start node, a normal node, an asynchronous node, a parallel node, an aggregation node, a decision node and an asynchronous sending node. The above nodes can be dragged and connected in the visual editor.
[0062] In addition, the visual editor can also include a process monitoring interface, which can be used to display the running information of the process instance in real time. The running information of the process includes the process name, process status, process running time, and the information of the ongoing nodes. The setting of the process monitoring interface can display the running information of the process instance in real time, which helps to better manage the microservice process, and the visual process monitoring interface can intuitively show the running information of the process, which is conducive to design and implementation. By displaying the name, status, running time and information of the ongoing nodes of the process separately, the running status of the process instance is more intuitively displayed, which is conducive to design and implementation.
[0063] Step S2: Create a process instance through a visual editor, and configure the node information and node call relationship in the process instance.
[0064] Among them, in this step S2, the process instance refers to the process after the microservice is node-orchestrated according to the expected rules and order, the node information includes the name of the node, the request address and the product code, and the node call relationship refers to the expected rules and order. By configuring the connection information between the nodes in the microservice process, the node call relationship in the microservice process can be defined, which is simple to operate and is conducive to design and implementation. Defining the node name, request address and product code as node information to the node in the microservice process can better manage each node in a unified manner, which is conducive to design and implementation.
[0065] Furthermore, in step S2, in order to better orchestrate and manage the microservice process, Figure 2 As shown, step S2 also includes the following steps:
[0066] Step S21: Create a start node in the visual editor.
[0067] Among them, in this step S21, after the start node is established, it indicates that a new process instance is created, and the start node is the execution starting point of the new process instance.
[0068] Step S22: According to the process task requirements, the process is arranged in the visual editor by dragging nodes and connecting nodes.
[0069] Among them, in step S22, after the start node is established, in the graphical operation interface of the visual editor, different nodes are dragged according to the expected task requirements, and the nodes are connected according to the expected interaction rules, so as to complete the editing of the process instance.
[0070] Step S23: edit the node and configure the node name and node information in the process.
[0071] Among them, in step S23, the name of each node, the request address of each node and the product code are configured according to the expected task requirements. For example, when configuring an asynchronous task node, the name of the asynchronous node and the configuration information of the node can be specified, so as to define each node as a microservice instance. Different request addresses correspond to configured nodes with different microservice functions, such as microservices such as data collection services, data analysis services and decision-making services.
[0072] Step S24: define the connections between nodes and configure the calling relationships between nodes.
[0073] Among them, in this step S24, the calling relationship between the nodes represents the expected interaction rules and operation order, and the line names and the nodes connected by the lines in the visual editor are configured, that is, the calling relationship between the microservice instances is configured.
[0074] Step S3: Build a database, which is used to save the configured process instances.
[0075] Among them, in this step S3, the database can be used to save the configured process instances, so that the configured process instances can be stored. In the subsequent use process, the corresponding process instances can be re-called according to the usage requirements, and the stored processes can be edited in the database, and the node information and node call relationships therein can be re-edited.
[0076] Step S4: Build a microservice scheduling engine, which is used to execute the configured process instances.
[0077] Among them, in step S4, the microservice scheduling engine can analyze and judge the real-time data according to the preset process logic and business rules. The business rules may include, for example, access strategies, anti-fraud strategies, blacklist strategies, etc. These business rules can guide the orchestration and decision-making of microservices and drive the process flow.
[0078] Step S5: retrieve the process instance from the database and execute the process instance through the scheduling engine.
[0079] Among them, in step S5, the orchestrated and configured process instance in the database is retrieved, and the process instance is executed by the scheduling engine according to the preset process logic and business rules. When the process instance is triggered, the scheduling engine initializes the process instance by querying the process definition in the database, and records the process status after the process is initialized.
[0080] In addition, during the execution of the scheduling engine, the scheduling engine executes the corresponding logic based on the node type. For example, for data processing nodes, the engine calls the corresponding microservices, and for decision nodes, the engine makes conditional judgments according to preset rules.
[0081] Furthermore, in step S5, in order to better execute the process instance, Figure 3 As shown, step S5 also includes the following steps:
[0082] Step S51: Obtain the start node of the process instance, and execute the node task of the start node.
[0083] Among them, in this step S51, the start node is the initial node of the process running. The scheduling engine finds the start node according to the process definition, and the scheduling engine starts to execute the process instance according to the start node.
[0084] Step S52: Find the next node to be executed, and parse the node information of the node to be executed.
[0085] In step S52, according to the execution order of the microservice instances in the arranged process instance, the next node to be executed is found, and the microservice instance required for the node is parsed.
[0086] Step S53: Execute the node task of the node to be executed.
[0087] Among them, in this step S53, the microservice instance required by the node after parsing is executed, and the information is uploaded to the database.
[0088] Step S54: callback the execution result and update the node record.
[0089] Among them, in step S54, after executing the microservice instance of the node, the execution result of the node is retrieved from the database, and the execution result of the node is updated.
[0090] Step S55: Repeat steps S52 to S54 until the final node in the process instance is reached.
[0091] Among them, in step S55, except for the starting nodes in each process, the scheduling engine repeats the order of steps S52 to S54 to parse and execute the nodes in the arranged order until the process instance is completed.
[0092] Based on the above steps, when the scheduling engine executes a process instance, if there is an aggregation node in the process instance, the subsequent nodes will be executed after the upstream nodes of the aggregation node are executed. If there are parallel nodes in the process instance, the parallel nodes will be scheduled in parallel.
[0093] For ease of explanation, this embodiment provides an exemplary process instance. An exemplary process instance of this embodiment includes a start node, four ordinary task nodes, a decision node, a parallel node, three asynchronous task nodes, an aggregation node and an end node.
[0094] When the exemplary process instance is executed, the scheduling engine retrieves the exemplary process instance from the database, and executes each node in sequence according to the configured node information and the calling relationship between nodes.
[0095] In this process instance, the process instance is first called through the scheduling engine, and then the scheduling engine parses the start node of the process instance and runs to the subsequent process nodes. After completing the first ordinary task node, the decision node determines whether the process flows to the second ordinary task node or the third ordinary task node. If it flows to the second ordinary task node, parallel processing is performed, and the first asynchronous task node, the second asynchronous task node and the third asynchronous task node are performed simultaneously to the aggregation node. After the first asynchronous task node, the second asynchronous task node and the third asynchronous task node are all executed, the aggregation node flows to the fourth ordinary task node. If the decision node decides that the process flows to the third ordinary task node, it will flow to the fourth ordinary task node after the third ordinary task node is executed. After the fourth ordinary task node is executed, it flows to the end node, and finally ends the process instance.
[0096] The microservice scheduling method in this embodiment edits the microservice process and configures nodes through a visual editor, and can provide an intuitive graphical interface, allowing users to edit and define microservice processes by dragging nodes and connecting lines, which helps to lower the threshold for operators, allowing business personnel to directly orchestrate and define microservice processes, thereby improving the efficiency of microservice process orchestration and management, and executing the microservice scheduling engine through the scheduling engine can improve the efficiency of microservice process operation.
[0097] Embodiment 2
[0098] This embodiment relates to a microservice scheduling device (hereinafter referred to as "scheduling device 100"), which is based on the microservice scheduling method of embodiment 1 and combines Figure 4 As shown, in terms of overall structure, the scheduling device 100 in this embodiment includes a first building module 101 , a first processing module 102 and a second processing module 103 .
[0099] Among them, the first building module 101 is used to build a visual editor, a database and a microservice scheduling engine. The first processing module 102 is used to create a process instance and configure the node information and node call relationship in the process instance. The second processing module 103 is used to call the process instance from the database and execute the process instance through the microservice scheduling engine.
[0100] As set above, when the microservice scheduling engine executes a process instance, if there is an aggregation node in the process instance, the subsequent nodes will be executed after the upstream nodes of the aggregation node are executed. If there are parallel nodes in the process instance, the parallel nodes will be scheduled in parallel.
[0101] It should be noted that the first building module 101, the first processing module 102 and the second processing module 103 can all be existing circuit modules with data storage, processing and input / output. In addition, in addition to the above modules, other modules such as data temporary storage and data communication are usually provided in the scheduling device 100 to temporarily store the microservice data information and other related processing information involved, and to realize the connection and communication with other related modules.
[0102] The scheduling device 100 of this embodiment, when used in detail, corresponds to the scheduling method, which can refer to the relevant description of the first embodiment.
[0103] Moreover, the scheduling device 100 of this embodiment can optimize the steps of microservice process orchestration by implementing the above-mentioned scheduling method, thereby improving the efficiency of microservice process orchestration and management, and can edit the microservice process and configure nodes through a visual editor, and can provide an intuitive graphical interface, allowing users to edit and define microservice processes by dragging nodes and lines, which is conducive to lowering the operator's threshold, allowing business personnel to directly arrange and define microservice processes, thereby improving the efficiency of microservice process orchestration and management, and executing the microservice scheduling engine through the scheduling engine can improve the efficiency of microservice process operation.
[0104] Embodiment 3
[0105] This embodiment relates to a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the microservice scheduling method in Embodiment 1 can be implemented.
[0106] The computer-readable storage medium of this embodiment is generally a memory, and includes permanent and non-permanent, removable and non-removable media, and can implement information storage by any method or technology.
[0107] In addition, the above information can be computer-readable instructions, data structures, modules of programs or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory, or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, disk storage or other magnetic storage devices, or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0108] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A microservice scheduling method, characterized in that: The method includes: Build a visual editor that can perform process orchestration and process node editing for microservices; Create a process instance through the visual editor, and configure node information and node call relationship in the process instance; Building a database, the database is used to store the configured process instance; Building a microservice scheduling engine, which is used to execute the configured process instance; Retrieving the process instance from the database and executing the process instance through the scheduling engine; Among them, when the scheduling engine executes the process instance, if there is an aggregation node in the process instance, after the upstream node of the aggregation node is executed, the subsequent node is executed, and if there are parallel nodes in the process instance, the parallel nodes are parallel scheduled.
2. The microservice scheduling method according to claim 1, characterized in that: The process instance is created by using a visual editor, and node information and node call relationships in the process instance are configured, including: Establishing a start node in the visual editor; According to the process task requirements, the process is arranged in the visual editor by dragging nodes and connecting nodes; Edit the node and configure the node name and node information in the process; Define the connections between nodes and configure the calling relationships between nodes.
3. The microservice scheduling method according to claim 2, characterized in that: The node information includes the node name, request address and product code.
4. The microservice scheduling method according to claim 1, characterized in that: The process node types of the visual editor include at least one of a start node, a common node, an asynchronous node, a parallel node, an aggregation node, a decision node and an asynchronous sending node.
5. The microservice scheduling method according to claim 1, characterized in that: The visual editor includes a process monitoring interface; The process monitoring interface is used to display the running information of the process instance in real time.
6. The microservice scheduling method according to claim 5, characterized in that: The running information includes the process name, process status, process running time, and information of the nodes in progress.
7. The microservice scheduling method according to claim 1, characterized in that: The selecting a process instance from the database and executing the process instance through the scheduling engine includes: Obtain the start node of the process instance and execute the node task of the start node; Find the next node to be executed and parse the node information of the node to be executed; Execute the node task of the node to be executed; Callback execution result and update node record; Repeat the process of searching for the next node to be executed, parsing the node information, and executing the node task until the final node in the process instance is executed.
8. The microservice scheduling method according to any one of claims 1 to 7, characterized in that: The visual editor is built using Vue.js and JsPlumb components.
9. A microservice scheduling device, characterized in that: The scheduling device (100) comprises a first building module (101), a first processing module (102) and a second processing module (103); The first building module (101) is used to build a visual editor, a database and a microservice scheduling engine; The first processing module (102) is used to create a process instance and configure node information and node call relationships in the process instance; The second processing module (103) is used to retrieve a process instance from the database and execute the process instance through the scheduling engine; Among them, when the scheduling engine executes the process instance, if there is an aggregation node in the process instance, after the upstream node of the aggregation node is executed, the subsequent node is executed, and if there are parallel nodes in the process instance, the parallel nodes are parallel scheduled.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program or instruction, and when the program or instruction is executed by the processor, the microservice scheduling method according to any one of claims 1 to 8 can be implemented.
Citation Information
Cited By
Orchestration fusion generation method based on digital networking digital object
CN120066745A
