Service link arrangement method and device, electronic equipment, storage medium and program product
Through the service link orchestration method, the complex problems of microservice calls and dependencies in the Internet business system are solved, and the automatic orchestration of the service link and efficient support of the distributed system are realized.
Patent Information
- Application Number
- CN202510495169.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-18
- Publication Date
- 2025-06-13
AI Technical Summary
The call and dependency relationship between microservices in Internet business systems is complex, which leads to complex orchestration of service links, which is difficult to manage and maintain. The traditional workflow management methods lack the ability to monitor and dynamically adjust the status of each microservice.
Provide a service link orchestration method, by receiving orchestration requests for the service link, reading corresponding service link configuration information, determining workflow, reading microservice configuration information, generating atomic tasks, and assigning atomic tasks to the target task executor for execution.
It realizes automatic orchestration of any service link in the business system, supports distributed systems, has higher scalability, flexibility and fault tolerance, and can better handle large-scale concurrent tasks.
Smart Images

Figure CN120151402A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and in particular, to a service link orchestration method, apparatus, electronic device, storage medium, and program product. Background Art
[0002] With the rapid development of the Internet, the functions of various Internet business systems have become increasingly complex. Usually, each service link involved in the above Internet business systems can be composed of multiple microservices. However, in these Internet business systems, the call and dependency relationships between microservices are complex, resulting in complex service link orchestration and difficulty in management and maintenance. In addition, the traditional workflow management method for service links lacks the ability to monitor the status of each microservice in real time and make dynamic adjustments. Developers usually need to manually write a large amount of code to implement and publish workflow logic, which not only increases the development cost and maintenance difficulty, but also causes problems such as low development efficiency. Moreover, the existing workflow engines for service links are difficult to support large-scale and dynamically changing business requirements, and both scalability and flexibility are insufficient. Summary of the Invention
[0003] In view of this, embodiments of the present disclosure provide a service link orchestration method, apparatus, electronic device, storage medium, and program product, which can solve or partially solve the above problems to a certain extent.
[0004] In some embodiments of the present disclosure, the service link orchestration method described in the embodiments of the present disclosure may include: receiving an orchestration request for a service link; reading service link configuration information corresponding to the service link based on the orchestration request for the service link; determining a workflow corresponding to the service link based on the service link configuration information; reading microservice configuration information corresponding to at least one microservice involved in the workflow; generating at least one atomic task respectively based on the microservice configuration information corresponding to the at least one microservice; and allocating each atomic task to a target task executor corresponding to the atomic task based on the workflow, and the target task executor executes the allocated atomic task.
[0005] In some embodiments of the present disclosure, the orchestration request for the service link carries identification information of the service link; and the reading of the service link configuration information corresponding to the service link based on the orchestration request for the service link includes: reading the service link configuration information corresponding to the service link from a database using the identification information of the service link as an index.
[0006] In some embodiments of the present disclosure, determining the workflow corresponding to the service link based on the service link configuration information includes: determining a target task in accordance with the order of the tasks recorded in the task set in the service link configuration information and reading the configuration information of the target task; adding a node corresponding to the target task to the workflow based on the configuration information of the target task; ending when it is determined that corresponding nodes have been added to the workflow for all the tasks recorded in the task set; and returning to the step of determining a target task in accordance with the order of the tasks recorded in the task set in the service link configuration information when it is determined that corresponding nodes have not been added to the workflow for all the tasks recorded in the task set.
[0007] In some embodiments of the present disclosure, adding a node corresponding to the target task to the workflow based on the configuration information of the target task includes: generating a target node corresponding to the target task; setting the name of the target node based on the identification information of the target task; and setting the connection relationship between the target node and other nodes in the workflow based on the type information of the target task.
[0008] In some embodiments of the present disclosure, setting the connection relationship between the target node and other nodes in the workflow based on the type information of the target task includes: directly adding the target node to the workflow and taking the target node as the current node of the workflow when it is determined that the target task is the first task recorded in the task set; reading the type information of the target task, adding the target node to the workflow based on the type information of the target task, and taking the target node as the current node of the workflow when it is determined that the target task is not the first task recorded in the task set; wherein, adding the target node to the workflow based on the type information of the target task includes: adding the target node as the next-level node of the current node when it is determined that the type information of the target task is sequential execution; adding the target node as the next-level node of the next-level node of the current node's upper-level node as a node parallel to the current node when it is determined that the type information of the target task is parallel execution; adding the target node as the next-level node of the current node and setting the execution condition of the target node based on the content of the conditional execution when it is determined that the type information of the target task is conditional execution; and setting the target node as a virtual node and adding it as the next-level node of the current node when it is determined that the type information of the target task is nested workflow.
[0009] In some embodiments of the present disclosure, the method for choreographing the service link further includes: checking whether the workflow includes virtual nodes; ending in response to determining that the workflow does not include the virtual nodes; in response to determining that the workflow includes the virtual nodes, taking one virtual node in the workflow as the target virtual node; reading the service link configuration information corresponding to the target virtual node; determining the sub-workflow corresponding to the target virtual node based on the service link configuration information; and replacing the target virtual node in the workflow with the sub-workflow corresponding to the target virtual node, and then returning to the step of checking whether the workflow includes virtual nodes.
[0010] In some embodiments of the present disclosure, the reading of the microservice configuration information corresponding to at least one microservice involved in the workflow includes: respectively reading the names of the respective nodes included in the workflow; and using the names of the respective nodes as indexes to respectively read the microservice configuration information corresponding to the at least one microservice from the database.
[0011] In some embodiments of the present disclosure, the generating of at least one atomic task based on the microservice configuration information corresponding to the at least one microservice includes: for the microservice configuration information corresponding to each of the at least one microservices, generating the name of an atomic task based on the identification information of the microservice in the microservice configuration information; generating the attribute information of the atomic task based on the attribute information of the microservice in the microservice configuration information; and generating the exception handling policy of the atomic task based on the exception handling information of the microservice in the microservice configuration information.
[0012] In some embodiments of the present disclosure, the assigning of each atomic task to the target task executor corresponding to the atomic task based on the workflow includes: determining the target atomic task for the current round of scheduling based on the workflow and the execution result of the target atomic task in the previous round of scheduling; adding the target atomic task for the current round of scheduling to the atomic task queue; obtaining the execution result of the target atomic task for the current round of scheduling; and using the execution result as the execution result of the target atomic task in the previous round of scheduling, and returning to the step of determining the target atomic task for the current round of scheduling based on the workflow and the execution result of the target atomic task in the previous round of scheduling.
[0013] In some embodiments of the present disclosure, determining the target atomic task for the current round of scheduling based on the workflow and the execution result of the target atomic task in the previous round of scheduling includes: in response to determining that the execution result of the target atomic task in the previous round of scheduling is empty, taking the atomic task corresponding to the first node in the workflow as the target atomic task for the current round of scheduling; in response to determining that the execution result of the target atomic task in the previous round of scheduling is successful execution, taking the atomic task corresponding to the next-level node of the node corresponding to the target atomic task in the previous round of scheduling as the target atomic task for the current round of scheduling according to the order of the nodes in the workflow until the next-level node is empty; and in response to determining that the execution result of the target atomic task in the previous round of scheduling is failed execution, performing exception handling according to the exception handling policy corresponding to the target atomic task in the task set of the service link configuration information.
[0014] In some embodiments of the present disclosure, the target task executor executing the assigned atomic task includes: the target task executor pulling the target atomic task from the head of the atomic task queue; obtaining the task logic corresponding to the target atomic task based on the name of the target atomic task; processing the input parameters in the attribute information of the target atomic task based on the task logic; obtaining the execution result of the task logic; and returning the execution result as the output parameter in the attribute information of the target atomic task.
[0015] Corresponding to the above method, an embodiment of the present disclosure also discloses a service link orchestration device, including:
[0016] A request receiving module, configured to receive an orchestration request for a service link;
[0017] A first configuration information obtaining module, configured to read service link configuration information corresponding to the service link based on the orchestration request for the service link;
[0018] A parsing module, configured to determine the workflow corresponding to the service link based on the service link configuration information;
[0019] A second configuration information obtaining module, configured to read microservice configuration information corresponding to at least one microservice involved in the workflow;
[0020] An atomic task generating module, configured to generate at least one atomic task respectively based on the microservice configuration information corresponding to the at least one microservice; and
[0021] A scheduling module, configured to allocate each atomic task to the target task executor corresponding to the atomic task based on the workflow, and the target task executor executes the assigned atomic task.
[0022] In addition, embodiments of the present disclosure further provide an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the above-mentioned service link orchestration method is implemented.
[0023] Embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions for causing a computer to execute the above-mentioned service link orchestration method.
[0024] Embodiments of the present disclosure further provide a computer program product including computer program instructions that, when running on a computer, cause the computer to execute the above-mentioned service link orchestration method.
[0025] It can be seen from this that the above-mentioned service link orchestration method, device, electronic device, storage medium, and program product can achieve the orchestration of any service link in a service system, so that when a user requests a service corresponding to the service link, the functions of the above-mentioned service link can be automatically implemented. In addition, in the above-mentioned service link orchestration method, at least one atomic task generated for an orchestration request of a received service link will be separately assigned to multiple task executors for execution respectively. Therefore, the above-mentioned service link orchestration method can support a distributed system, has higher scalability, flexibility, and fault tolerance, and can better handle large-scale concurrent tasks. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the present disclosure or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments or related technologies. Obviously, the drawings in the following description are only embodiments of the present disclosure. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0027] Figure 1 Shows an example of applying the service link orchestration method described in the embodiments of the present disclosure in a service system.
[0028] Figure 2 Shows the implementation process of the service link orchestration method described in some embodiments of the present disclosure.
[0029] Figure 3 Shows the implementation process of determining a workflow corresponding to the service link based on the service link configuration information described in some embodiments of the present disclosure.
[0030] Figure 4 Shows the implementation process of updating a workflow described in some embodiments of the present disclosure.
[0031] Figure 5a Shows an example of a workflow according to some embodiments of the present disclosure.
[0032] Figure 5b Shows an example of a sub-workflow corresponding to a virtual node according to some embodiments of the present disclosure.
[0033] Figure 5c Shows another example of a workflow according to some embodiments of the present disclosure.
[0034] Figure 6 Shows the specific implementation process of allocating each atomic task to the target task executor corresponding to the atomic task based on the workflow according to some embodiments of the present disclosure.
[0035] Figure 7 Shows the internal structure of a service link orchestration device according to some embodiments of the present disclosure.
[0036] Figure 8 Illustrates a more specific schematic diagram of the hardware structure of an electronic device according to some embodiments of the present disclosure. Detailed implementation manners
[0037] To make the objectives, technical solutions and advantages of the present disclosure more clear and understandable, the present disclosure will be further described in detail below with reference to specific embodiments and the accompanying drawings.
[0038] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the embodiments of the present disclosure should have the ordinary meanings understood by those of ordinary skill in the art to which the present disclosure belongs. The "first", "second" and similar terms used in the embodiments of the present disclosure do not denote any order, quantity or importance, but are only used to distinguish different components. The terms such as "include" or "comprise" mean that the elements or items appearing before this term cover the elements or items listed after this term and their equivalents, without excluding other elements or items. The terms such as "connect" or "couple" are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The terms such as "upper", "lower", "left" and "right" are only used to represent relative positional relationships, and when the absolute position of the object being described changes, the relative positional relationship may also change accordingly.
[0039] It can be understood that, before using the technical solutions of the various embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved will be informed to the user in an appropriate manner and the user's authorization will be obtained.
[0040] For example, when responding to an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the present disclosure's technical solution based on the prompt message.
[0041] As an optional but non-limiting implementation manner, when responding to an active request received from a user, the manner of sending a prompt message to the user may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0042] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present disclosure. Other manners that comply with relevant laws and regulations can also be applied to the implementation manner of the present disclosure.
[0043] For the sake of clarity in description, before describing the specific technical solution of the embodiments of the present disclosure, the technical terms involved in the embodiments of the present disclosure are first described.
[0044] A microservice can be a software architecture pattern that splits a large application into multiple small, independent service units - microservices. Each microservice has its own boundaries and functions, and microservices can communicate with each other using lightweight communication mechanisms. For example, microservices can communicate with each other through Hypertext Transfer Protocol Representational State Transfer Application Programming Interface (HTTP RESTful API). In addition, microservices can be developed, deployed, and scaled independently, so they have high flexibility and scalability.
[0045] A service link can refer to the set of all microservices that a service request passes through from the initiating end to the destination end. In a microservice architecture, a service request may go through multiple microservice calls, forming a link.
[0046] Service link tracing can be a monitoring technology used to track the call process of each microservice in a service link, monitor performance bottlenecks, errors, and exceptions in the service link, thereby improving the availability and stability of the business system.
[0047] A distributed system can be a system that connects multiple independent computing nodes through a network to jointly complete complex computing tasks. The main purpose of a distributed system is to improve the scalability and fault tolerance of the system by splitting the system into multiple independent computing nodes and solve large-scale data processing and computing problems.
[0048] Distributed microservices can be a software design pattern that combines distributed systems and microservices architecture, aiming to achieve high scalability, flexibility, and fault tolerance by splitting complex applications into multiple independent and loosely coupled microservices and deploying them in a distributed network environment.
[0049] A Domain-Specific Language (DSL) can be a programming language designed specifically for a particular problem domain. Different from general-purpose programming languages, DSLs are more concise and understandable, and can usually be used to express the intentions and rules of a specific domain, making the process of writing, reading, and maintaining code more efficient and intuitive.
[0050] JavaScript Object Notation (JSON) can be a lightweight data interchange format widely used for data transmission between web applications and Application Programming Interfaces (APIs). JSON can usually represent data in a concise, easy-to-read, and easy-to-write text format.
[0051] Workflow can be a technology for formalizing, automating, and managing business processes. It ensures that business operations can be carried out efficiently and orderly by defining, executing, and monitoring tasks and activities in business processes.
[0052] An Atomic Task can refer to a basic execution unit or the smallest indivisible work unit in a workflow.
[0053] As mentioned above, with the rapid development of the Internet, the functions of systems such as e-commerce are becoming increasingly complex. For example, the reverse refund service link in an e-commerce business system can usually be composed of multiple microservices such as querying the logistics status, creating a refund work order, auditing the work order, refunding, holding someone accountable, and sending notifications. However, in a distributed system, there are still technical problems such as complex service link orchestration, difficult state management, low development efficiency, and insufficient scalability and flexibility. To solve or partially solve the above problems to a certain extent, the embodiments of the present disclosure provide a service link orchestration method, device, electronic device, storage medium, and program product.
[0054] Figure 1 Shows an example of applying the service link orchestration method described in the embodiments of the present disclosure in a business system. In Figure 1In the illustrated example, the service link orchestration method described in the embodiments of the present disclosure can be executed by a service link orchestration device 200. The above-mentioned service link orchestration device 200 can communicate with a console 300, a server 102 in a service system 100, a database 400, and multiple task executors 500. The above-mentioned service link orchestration device 200 can be used to complete the orchestration of the service links of the service system 100. It should be noted that in the embodiments of the present disclosure, the above-mentioned service system 100 can be any Internet service system, for example, an e-commerce service system, etc. In addition, it should also be noted that Figure 1 The application scenario of the service link orchestration method described in the embodiments of the present disclosure is illustrated by taking a service system 100 as an example. However, in actual applications, the above-mentioned service link orchestration device 200 and the service link orchestration method it executes can be independent of the above-mentioned service system 100 and can be respectively applied to multiple different service systems. That is to say, the above-mentioned service link orchestration device 200 can be connected to multiple different service systems, so as to realize the orchestration of service links for multiple different service systems.
[0055] In Figure 1 In the illustrated service system 100, for any service link in the above-mentioned service system 100, for example, for the reverse refund service link in the e-commerce service system, developers can first configure the service link. Specifically, developers can input service link configuration information to the above-mentioned service link orchestration device 200 through a console 300 that can communicate with the above-mentioned service link orchestration device 200. In addition, for any microservice involved in the service link, for example, the query logistics status microservice in the reverse refund service link, developers can also first configure the microservice. Specifically, developers can also input microservice configuration information through a console 300 that can communicate with the above-mentioned service link orchestration device 200. In some embodiments of the present disclosure, the above-mentioned console 300 can be a client device for performing service link configuration. In some other embodiments of the present disclosure, the above-mentioned console 300 can also be a client device of a code hosting platform. Developers can not only edit service link configuration information and microservice configuration information through the code hosting platform, but developers can also complete the development work of microservice code through the code hosting platform. In some embodiments of the present disclosure, the above-mentioned console 300 and the service link orchestration device 200 can also be connected through a gateway to complete data interaction. It should be noted that the embodiments of the present disclosure do not limit the specific number of the above-mentioned console 300, that is, in the embodiments of the present disclosure, the above-mentioned console 300 can be one or multiple. Figure 1 The number of the console 300 shown in
[0056] Under normal circumstances, in some embodiments of the present disclosure, the above service link configuration information can be uniquely identified using the identification information of the service link; and the above microservice configuration information can be uniquely identified by the identification information of the microservice. In the embodiments of the present disclosure, the above identification information of the service link can be the name of the service link or other information that can uniquely identify the service link, such as a number corresponding one-to-one with the service link, etc.; the above identification information of the microservice can be the name of the microservice, the alias of the microservice, or other information that can uniquely identify the microservice, such as a number corresponding one-to-one with the microservice, etc. The specific content of the above service link configuration information and microservice configuration information will be described in detail later, and will be skipped here for the time being.
[0057] Further, after receiving the above service link configuration information and / or the above microservice configuration information, the above service link orchestration device 200 can store the received service link configuration information and / or microservice configuration information in the database 400, so as to achieve the persistence of the above service link configuration information and / or microservice configuration information, for subsequent retrieval during the service link orchestration process. In some embodiments of the present disclosure, the identification information of the service link can be used as the index of the above service link configuration information for storing the service link configuration information in the database 400, or the identification information of the microservice can be used as the index of the above microservice configuration information for storing the microservice configuration information in the database 400, so as to facilitate operations such as storing, searching, modifying, and deleting the service link configuration information and the microservice configuration information.
[0058] Next, when a user of the business system 100 submits a certain service request to the server 102 of the business system 100 through the client 101 of the business system 100, the above service link orchestration device 200 can receive an orchestration request for the service link corresponding to the above service request from the server 102 of the business system. The above orchestration request for the service link can carry the identification information of the service link, which is used to identify the service link requested by the user. It can be understood that the service link identified by the above identification information should correspond to the service link requested by the service request submitted by the user. That is, the server 102 of the business system 100 can determine the identification information of the corresponding service link based on the service request submitted by the user, and further add the determined identification information of the service link to the orchestration request for the service link, and then send it to the service link orchestration device 200. In addition, it can be understood that the number of clients in the business system 100 is usually much larger than 1, and the number of servers may also be more than one. Therefore, in Figure 1The number of the client 101 and the server 102 shown is only an example and does not constitute a limitation on the specific number of the client 101 and the server 102 above.
[0059] After receiving the orchestration request of the service link, the service link orchestration device 200 may read the service link configuration information corresponding to the service link from the database 400 based on the identification information of the service link. Next, the service link orchestration device 200 may parse the read service link configuration information to determine the workflow corresponding to the service link. Based on the determined workflow, the service link orchestration device 200 may further read the microservice configuration information corresponding to at least one microservice involved in the workflow and generate at least one atomic task based on the read microservice configuration information. Then, the service link orchestration device 200 may further allocate the generated at least one atomic task to one of the multiple task executors 500 respectively based on the workflow for the execution of the atomic task, thereby realizing the instantiation of the service link, that is, realizing the orchestration of the service link.
[0060] It can be seen that through the service link orchestration device 200 and its process of processing the orchestration request of the service link, the orchestration of any service link in the service system 100 above can be realized, so that the function of the service link corresponding to the service request can be automatically realized when the user submits a certain service request. In addition, at least one atomic task generated for the received orchestration request of the service link will be respectively allocated by the service link orchestration device 200 to the multiple task executors 500 for execution respectively. Therefore, the above service link orchestration scheme can support distributed microservices, has higher scalability, flexibility and fault tolerance, and can better handle large-scale concurrent tasks.
[0061] The service link orchestration method executed by the above-mentioned service link orchestration device 200 in the embodiments of the present disclosure will be described in detail below in conjunction with the accompanying drawings. It should be noted that in the embodiments of the present disclosure, the above-mentioned service link can be any service link in a business system. For example, the reverse refund service link in an e-commerce business system or a service link for implementing other functions, etc. Moreover, the above-mentioned service link can usually be composed of multiple microservices. For example, the reverse refund service link in an e-commerce business system can usually be split into multiple microservices such as querying the logistics status, creating a refund work order, work order review, refund, liability pursuit, and sending notifications. In particular, the above-mentioned microservices can be distributed microservices. That is to say, the multiple microservices described in the embodiments of the present disclosure can be respectively deployed in a distributed network environment. In addition, it should be noted that the embodiments of the present disclosure do not involve the specific technical solutions for splitting a service link into multiple microservices, nor the specific technical solutions for completing the code development of each microservice. In actual applications, the multiple microservices included in a service link can be preset by developers according to experience and the specific functions of the service link during service link design and developed in an engineering system. The embodiments of the present disclosure only involve the orchestration of service links based on multiple microservices that have been developed and completed.
[0062] Figure 2 shows the implementation process of the service link orchestration method described in the embodiments of the present disclosure. As Figure 2 shown, the above-mentioned service link orchestration method can specifically include the following multiple steps.
[0063] In step 210, receive an orchestration request for a service link.
[0064] In step 220, read the service link configuration information corresponding to the service link based on the orchestration request for the service link.
[0065] In step 230, determine the workflow corresponding to the service link based on the service link configuration information.
[0066] In step 240, read the microservice configuration information corresponding to at least one microservice involved in the workflow.
[0067] In step 250, generate at least one atomic task respectively based on the microservice configuration information corresponding to at least one microservice.
[0068] In step 260, allocate each of the atomic tasks to the target task executor corresponding to the atomic task based on the workflow, and the target task executor executes the allocated atomic task.
[0069] It can be seen that through the above service link orchestration method, the orchestration of any service link in the above business system can be achieved, so that the functions of the above service link can be automatically realized when a user requests a service corresponding to the service link. In addition, in the above service link orchestration method, at least one atomic task generated for the received service link orchestration request will be separately assigned to multiple task executors for execution respectively. Therefore, the above service link orchestration method can support a distributed system, has higher scalability, flexibility and fault tolerance, and can better handle large-scale concurrent tasks.
[0070] Next, the specific implementation methods of each step in the above service link orchestration method will be further described in detail in combination with the accompanying drawings and specific embodiments.
[0071] Regarding the above steps 210 and 220, as described above, when a user of the business system submits a service request to the server of the business system through the client of the business system, the above service link orchestration device can receive the service link orchestration request from the server 102 of the business system 100. Next, the above service link orchestration device 200 can read the service link configuration information corresponding to the above service link from the database 400.
[0072] Specifically, in some embodiments of the present disclosure, during the storage process of the service link configuration information, the above service link orchestration device can store the service link configuration information in the database 400 with the identification information of the service link as the index, and can also store the microservice configuration information in the database with the identification information of the microservice as the index. Thus, in these embodiments, in the above step 210, the service link identification information may be carried in the service link orchestration request received by the above service link orchestration device 200. For example, the name of the service link or other information that can be used as an identifier, etc. Thus, in step 220, the above service link orchestration device can read the service link configuration information corresponding to the above service link identification information from the database 400 based on the above service link identification information (i.e., using the service link identification information as the index).
[0073] In some embodiments of the present disclosure, the above service link configuration information may include: the identification information of the service link and the task set configured for the service link.
[0074] As described above, the above service link identification information may include: the name of the service link or other information that can uniquely identify the service link, for example, a number corresponding one-to-one to the service link, etc.
[0075] In some embodiments of the present disclosure, the task set configured for the service link may include configuration information of at least one task configured for the service link. Specifically, the above-mentioned task may correspond to a microservice or a service link. In addition, the configuration information of the above-mentioned task may include: identification information of the task and type information of the task. In some other embodiments of the present disclosure, the configuration information of the above-mentioned task may further include: input parameters of the task, which may specifically correspond to the input parameters of a microservice or the input parameters of a service link. In some other embodiments of the present disclosure, the configuration information of the above-mentioned task may further include: an exception handling policy. The above-mentioned exception handling policy is mainly used to set the indication information on whether to execute the above-mentioned task again when the task execution fails.
[0076] Specifically, since the above-mentioned task may correspond to a microservice or a service link, the identification information of the above-mentioned task may be the identification information of a microservice or the identification information of a service link. In some embodiments of the present disclosure, as mentioned above, the identification information of the above-mentioned microservice may include one of the following information: the name of the microservice, the alias of the microservice, or other information that can uniquely identify the microservice (for example, a number corresponding one-to-one to the microservice), etc. The identification information of the above-mentioned service link may include one of the following information: the name of the service link or other information that can uniquely identify the service link (for example, a number corresponding one-to-one to the service link), etc.
[0077] In some embodiments of the present disclosure, the type information of the above-mentioned task may include: sequential execution, parallel execution, conditional execution, nested workflow, etc., which are type information that can reflect the execution mode of the microservice. Among them, the above-mentioned sequential execution means that the above-mentioned task can be directly executed sequentially according to the appearance order of each task in the task set; the above-mentioned parallel execution means that the above-mentioned task can be executed in parallel with one or more other tasks in the task set; the above-mentioned conditional execution means that the above-mentioned task can be executed under set conditions; and the above-mentioned nested workflow means that the above-mentioned task corresponds to a pre-configured service link.
[0078] In addition, in some other embodiments of the present disclosure, the service link configuration information may further include: description information of the service link, which is used to record other information associated with the service link, such as the functional description of the service link, etc.
[0079] In still some other embodiments of the present disclosure, as described above, the foregoing service link orchestration method may also be applied to different business systems. That is to say, the service link configuration for the same service link may be applicable to multiple business systems at the same time. Therefore, in order to identify the business systems to which the service link is applicable, so that in actual use, the same set of service link configuration information can be instantiated into multiple service links that are respectively applicable to multiple business systems, the foregoing service link configuration information may further include: identification information of the business system, which is used to record one or more business systems to which the service link can be applicable. In this case, in the orchestration request of the service link received in the foregoing step 210, in addition to the identification information of the service link, the identification information of the business system may also be carried. In this way, after reading the service link configuration information corresponding to the service link through the foregoing step 220, it will be further determined whether the identification information of the business system carried in the orchestration request of the service link belongs to one of the identification information of the business systems recorded in the service link configuration information. In response to determining that the identification information of the business system carried in the orchestration request of the service link belongs to one of the identification information of the business systems recorded in the service link configuration information, the subsequent step 230 may be continued; while in response to determining that the identification information of the business system carried in the orchestration request of the service link does not belong to one of the identification information of the business systems recorded in the service link configuration information, it may be determined that the foregoing service link configuration information is not applicable to the business system that currently sends the orchestration request of the service link. Therefore, an appropriate error prompt message (for example, feedback to the business system a prompt message of "no relevant service link configuration has been performed") may be first fed back to the business system, and then the current process may be ended.
[0080] In some embodiments of the present disclosure, the foregoing service link configuration information may be edited and stored using a domain-specific language (DSL). For example, the foregoing service link configuration information may be edited and stored in JSON format.
[0081] Regarding the foregoing step 230, after obtaining the service link configuration information, the task set in the foregoing service link configuration information may be parsed to determine the workflow corresponding to the foregoing service link. In the embodiments of the present disclosure, the foregoing workflow corresponding to the service link records information about at least one microservice involved in the service link and the coupling relationship between the at least one microservice.
[0082] Specifically, in the embodiments of the present disclosure, the implementation process of determining the workflow corresponding to the service link according to the service link configuration information described in the foregoing step 230 may be as Figure 3 shown, and may specifically include the following multiple steps.
[0083] In step 310, a target task is determined according to the order of the tasks recorded in the task set in the service link configuration information, and the configuration information of the target task is read.
[0084] As described above, the configuration information of the above target task may include: the identification information of the target task and the type information of the target task. In addition, the above target task may correspond to a microservice or a service link.
[0085] In step 320, a node corresponding to the target task is added to the workflow based on the configuration information of the target task.
[0086] Specifically, in the embodiments of the present disclosure, the above step 320 may include: generating a target node corresponding to the target task; setting the name of the target node based on the identification information of the target task; and setting the connection relationship between the target node and other nodes in the workflow based on the type information of the target task.
[0087] Specifically, the above setting the connection relationship between the target node and other nodes in the workflow based on the type information of the target task may specifically include the following steps: in response to determining that the target task is the first task recorded in the task set, since there are no nodes in the current workflow, the above target node may be directly added to the workflow, and the above target node is used as the current node of the workflow. In response to determining that the target task is not the first task recorded in the task set, the type information of the target task is read, the target node is added to the workflow based on the type information of the target task, and the target node is used as the current node of the workflow. Among them, adding the target node to the workflow based on the type information of the target task may include: in response to determining that the type information of the target task is sequential execution, adding the target node as the next-level node of the current node; in response to determining that the type information of the target task is parallel execution, adding the target node as a node parallel to the current node as the next-level node of the upper-level node of the current node; in response to determining that the type information of the target task is conditional execution, adding the target node as the next-level node of the current node, and setting the execution condition of the target node based on the content of the conditional execution; and in response to determining that the type information of the target task is nested workflow, setting the target node as a virtual node and adding it as the next-level node of the current node. Next, continue to execute the subsequent step 330.
[0088] In step 330, it is determined whether nodes have been added to the workflow for all the tasks recorded in the task set. If so, the current process ends; if not, return to step 310.
[0089] After ending the above Figure 3After the process shown above, it will further check whether the created workflow includes virtual nodes. Since a virtual node itself represents a configured service link and cannot be directly executed, for each virtual node in the above workflow, this virtual node needs to be further parsed. That is, for each virtual node in the above workflow, steps 220 and 230 will be repeatedly executed respectively in a loop, so as to further update the created workflow. Specifically, the process of updating the workflow described in the embodiments of the present disclosure can be as Figure 4 shown, including the following steps.
[0090] In step 410, check whether the workflow includes virtual nodes. In response to determining that the workflow includes virtual nodes, continue to execute step 420; while in response to determining that the workflow does not include virtual nodes, end the current process.
[0091] In step 420, take a virtual node in the workflow as the target virtual node.
[0092] In step 430, read the service link configuration information corresponding to the target virtual node.
[0093] In the above steps, the name of the target virtual node (for example, the identification information of the service link corresponding to the target virtual node) can be used as an index to read the service link configuration information corresponding to the name of the target virtual node from the database.
[0094] In step 440, determine the sub-workflow corresponding to the target virtual node based on the service link configuration information.
[0095] In the above step 440, the method shown above can be used to determine the sub-workflow corresponding to the target virtual node based on the service link configuration information. Figure 3 shown to determine the sub-workflow corresponding to the target virtual node based on the service link configuration information.
[0096] In step 450, replace the target virtual node in the workflow with the sub-workflow corresponding to the target virtual node, and then return to the above step 410.
[0097] It can be seen from this that by continuously looping and executing the above method, a complete workflow without virtual nodes can be finally obtained. The above complete workflow without virtual nodes includes multiple nodes, and each of these nodes will respectively correspond to a pre-configured microservice.
[0098] The implementation process of the above steps 220 and 230 will be further described below in combination with a specific example.
[0099] Assume that in step 210 above, the service link orchestration request received by the service link orchestration device from the server of the business system contains the identification information "example_influx_flow_00" of the service link. Then in step 220, the service link orchestration device will read from the database the service link configuration information stored with "example_influx_flow_00" as the index. Assume that the service link configuration information is edited and stored in JSON format. Then through step 220 above, the service link orchestration device can obtain the following task set code segment from the database:
[0100] {
[0101] "name":"00",
[0102] ……
[0103] "type":"DIRECT"
[0104] },
[0105] {
[0106] "name":"SUB_FLOW case",
[0107] "type":"SUB_FLOW",
[0108] ……
[0109] },
[0110] {
[0111] "name":"01",
[0112] ……
[0113] "type":"DIRECT"
[0114] }
[0115] {
[0116] "name":"02",
[0117] ……
[0118] "type":"PARALLEL"
[0119] }
[0120] It should be noted that in the above task set code segment example, only the name field of the task as the identification information of the task and the type field of the task are shown, while other fields in the task configuration information are omitted.
[0121] Next, in step 230, based on the task set shown in the above code segment example, extract the configuration information of the first task, and directly generate a node named "00" in the workflow as the initial node of the workflow. Then, read the configuration information of the second task from the task set shown in the above code segment example. Since the type of the second task is "SUB_FLOW", that is, a nested workflow, a virtual node named "SUB_FLOW case" is generated and connected under the node named "00". Then, read the configuration information of the third task from the task set shown in the above code segment example. Since the type of the third task is "DIRECT", that is, sequential execution, a node named "01" is generated and connected under the virtual node named "SUB_FLOW case". Finally, read the configuration information of the fourth task from the task set shown in the above code segment example. Since the type of the fourth task is "PARALLEL", that is, parallel execution, a node named "02" is generated and connected as a node parallel to the node named "01" under the virtual node named "SUB_FLOW case". Figure 5a shows an example of a workflow obtained through the above process. As Figure 5a shown, the above workflow includes four nodes, where the node named "SUB_FLOW case" is a virtual node, which is distinguished from other non-virtual nodes by shading in Figure 5a . It should be noted that Figure 5a the shown workflow can be considered an intermediate state in the workflow creation process, rather than a complete workflow corresponding to the service link without virtual nodes.
[0122] Since the workflow generated through the above process, such as Figure 5a shown, includes the virtual node "SUB_FLOWcase", therefore, for the virtual node therein, the method shown in Figure 4 will be further executed. That is, first read the service link configuration information corresponding to the name "SUB_FLOW case" of the virtual node from the database using the name "SUB_FLOW case" of the virtual node as the index. Next, determine the sub-workflow corresponding to the virtual node through the process shown in Figure 3 . Then, use the determined sub-workflow corresponding to the virtual node to replace the corresponding virtual node "SUB_FLOW case" in the workflow.
[0123] In the current example, the specific process of determining the workflow corresponding to the virtual node "SUB_FLOW case" through the process shown in Figure 3 will not be repeated here. Assume that throughFigure 3 The process shown can obtain Figure 5b the sub-workflow corresponding to the virtual node shown, including three serially connected nodes named "11", "12", and "13". Then, in the above process, Figure 5b the sub-workflow corresponding to the virtual node shown will be used to replace Figure 5a the virtual node "SUB_FLOW case" in Figure 5c to obtain the complete workflow corresponding to the service link without virtual nodes as shown.
[0124] It should be noted that in the above Figure 5a example shown, there is only one virtual node, and Figure 5b the example shown does not include virtual nodes either. Therefore, repeating the above Figure 4 method once can obtain the complete workflow corresponding to the service link. Those skilled in the art can understand that this is just an example. Assuming Figure 5a the example shown includes multiple virtual nodes, then for each virtual node, the above Figure 4 method needs to be executed separately. Moreover, if Figure 5b the example shown also includes new virtual nodes, then the workflow obtained therefrom Figure 5c will also include the new virtual nodes. Then, for the above new virtual nodes, the above Figure 4 method needs to be executed again to use the sub-workflow corresponding to the new virtual node to replace the above new virtual nodes. After repeating this process multiple times until the obtained workflow no longer includes virtual nodes.
[0125] It can be seen from the above process that by parsing the service link configuration information, the workflow corresponding to the service link can finally be obtained. It can be understood that the above workflow includes multiple nodes, where each node corresponds to a developed microservice. That is to say, each node on the workflow can correspond to the microservices involved in the service link one by one. Usually, the names of the nodes in the workflow can correspond to the identifiers of the microservices; and the connection relationships between the nodes represent the coupling relationships between the microservices.
[0126] As mentioned above, the names of the multiple nodes included on the above workflow correspond to the identifiers of the microservices. Therefore, in step 240 above, the service link orchestration device can respectively read the names of each node on the above workflow; then, using the read node names as indexes, read the microservice configuration information corresponding to the at least one microservice from the database.
[0127] In an embodiment of the present disclosure, the microservice configuration information corresponding to the above microservice may include the following information: the identification information of the microservice, the attribute information of the microservice, and the exception handling information of the microservice.
[0128] Specifically, the identification information of the above microservice may be the name of the microservice, the alias of the microservice, or other information that can uniquely identify a microservice, such as a number corresponding one-to-one to the microservice. Usually, different microservices may correspond to different microservice names, and in order to ensure its uniqueness, the microservice name is usually set to be relatively complex. In some embodiments of the present disclosure, in order to simplify the configuration and other work of the workflow corresponding to the service link composed of multiple microservices, an alias that is relatively simple and only takes effect in the single application scenario of service link orchestration may also be set for the microservice to reduce the complexity of development work. Therefore, in these embodiments, in addition to using the name of the microservice, the alias of the microservice may also be used as the above identification information of the microservice.
[0129] In addition, in some embodiments of the present disclosure, the attribute information of the above microservice may include: the input parameters of the microservice and the output parameters of the microservice. It can be seen that the attribute information of the above microservice may include the information required by the task executor to execute the atomic task corresponding to a certain microservice. The input parameters and output parameters of the above microservice can be used to define the names of the input parameters and output parameters of the above microservice, that is, to define the interface between this microservice and other microservices.
[0130] In some embodiments of the present disclosure, the above exception handling information of the microservice can be used to set the strategy to be taken when an exception occurs during the execution of the atomic task corresponding to the microservice. Usually, it may include: one or more of retry strategy information, timeout strategy information, adjustment strategy information, and so on. Among them, the above retry strategy information may include: the number of retries and the retry interval. Among them, the above number of retries can be used to set the maximum number of retries when the atomic task corresponding to the microservice fails to execute; the above retry interval can be used to set the time interval to wait before the next retry when the atomic task corresponding to the microservice fails to execute. The above timeout strategy information may include: the timeout time. The above timeout time can be used to set the longest time for executing the atomic task corresponding to the microservice. That is to say, when the total time for executing the atomic task corresponding to the microservice exceeds the above timeout time, even if the atomic task has not been completed, it will not continue to wait. The above adjustment strategy information can be used to set the name of the callback task to be executed when the atomic task corresponding to the microservice still fails to execute successfully after reaching the timeout time or reaching the number of retries, as an alternative solution when the microservice execution fails.
[0131] For the above step 250, the service link orchestration device may generate an atomic task respectively according to the identification information, attribute information, and exception handling information of the microservice. For example, for each set of microservice configuration information corresponding to each of the at least one microservice above, the following operations are respectively performed: generating the name of the atomic task based on the identification information of the microservice; generating the attribute information of the atomic task based on the attribute information of the microservice. For example, setting the input parameter and output parameter of the atomic task based on the input parameter and output parameter of the microservice; and generating the exception handling policy of the atomic task based on the exception handling information of the microservice. It can be seen from this that the atomic tasks generated through the above step 250 will correspond one by one to each node in the workflow. In addition, since each node in the workflow also corresponds one by one to at least one microservice involved in the service link, therefore, the atomic tasks generated through the above step 250 will also correspond one by one to at least one microservice involved in the service link.
[0132] For the above step 260, Figure 6 shows the specific implementation process of allocating each of the atomic tasks to the target task executor corresponding to the atomic task based on the workflow in the embodiments of the present disclosure. As Figure 6 shown, the service link encoding device can implement the scheduling of atomic tasks through the following multiple steps.
[0133] In step 610, determine the target atomic task for the current round of scheduling based on the workflow and the execution result of the target atomic task in the previous round of scheduling.
[0134] Since the workflow reflects all the microservices involved in the service link and the coupling relationship between each microservice, and the nodes included in the workflow correspond one by one to the generated atomic tasks. Therefore, the service link orchestration device can schedule the atomic tasks for the current round based on the order of the nodes shown in the workflow and the execution result of the target atomic task in the previous round of scheduling.
[0135] It should be noted that for the scheduling of the first-round atomic tasks, since there is no target atomic task for the previous-round scheduling, there is also no execution result of the target atomic task for the previous-round scheduling. At this time, the execution result of the target atomic task for the previous-round scheduling can be set to be empty. Based on the above setting, step 610 can specifically include: in response to determining that the execution result of the target atomic task for the previous-round scheduling is empty, the atomic task corresponding to the first node in the workflow can be used as the target atomic task for this-round scheduling. In response to determining that the execution result of the target atomic task for the previous-round scheduling is successful execution, the atomic task corresponding to the node at the next level of the target atomic task for the previous-round scheduling can be used as the target atomic task for this-round scheduling according to the order of the nodes in the workflow until the node at the next level is empty. In the above steps, the target atomic task determined for this-round scheduling may be one or more. Of course, if the node at the next level is empty, that is, there is no node at the next level, it means that the microservices involved in the entire service link have been successfully executed. So far, the orchestration process of the entire service link has been completed. In response to determining that the execution result of the target atomic task for the previous-round scheduling is failed execution, exception handling can be performed according to the exception handling policy corresponding to the target atomic task for the previous-round scheduling in the task set of the service link configuration information. Specifically, it can be determined whether to retry according to the exception handling policy corresponding to the target atomic task for the previous-round scheduling in the task set of the service link configuration information. If it is determined that retry is possible, the target atomic task for the previous-round scheduling can be used as the target atomic task for this-round scheduling again. Otherwise, a relevant report of failed execution will be returned to the business system. Then, the current process can be ended.
[0136] In step 620, the target atomic task for this-round scheduling is added to the atomic task queue.
[0137] In an embodiment of the present disclosure, the target atomic task of the current round of scheduling can be added to the end of the atomic task queue. After the service link orchestration device adds the target atomic task of the current round of scheduling to the atomic task queue, the task executor in the system can pull the atomic task from the atomic task queue and execute the corresponding task when its computing resources meet the conditions. Specifically, the task executor can perform the following multiple steps of operations: pull the target atomic task from the head of the atomic task queue; obtain the task logic corresponding to the target atomic task based on the name of the pulled target atomic task; process the input parameters in the attribute information of the target atomic task based on the obtained task logic; obtain the execution result of the task logic; and return the execution result as the output parameter in the attribute information of the target atomic task to the service link orchestration device. It should be noted that the task logic corresponding to the above target atomic task will be developed in advance by developers in the engineering system. These task logics can be stored in the database 400 mentioned in the embodiments of the present disclosure or other databases in the engineering system. In an embodiment of the present disclosure, the task executor can directly read the task logic corresponding to the target atomic task from the database storing the task logic based on the name of the target atomic task.
[0138] It should be noted that, in an embodiment of the present disclosure, during the execution of the target atomic task by the task executor, that is, during the process of the task executor processing the input parameters in the attribute information of the target atomic task based on the task logic, if an exception occurs, the exception can be handled based on the exception handling information of the target atomic task. Specifically, assuming that the exception handling information of the target atomic task sets retry policy information, timeout policy information, and adjustment policy information, if the number of executions of the target atomic task does not reach the retry count, the waiting time also meets the requirements of the retry interval, and the total execution time does not reach the timeout time, the target atomic task can be re-executed. If the number of executions of the target atomic task has reached the retry count or the total execution time has reached the timeout time, the callback task set in the set adjustment policy information can be executed.
[0139] In addition, the task executor will also maintain and update the execution status of the atomic tasks it executes in real time to the service link orchestration device. In the embodiments of the present disclosure, the above execution status may include: in execution, execution successful, or execution failed, etc. Further, during the execution of the target atomic task, the task executor will further feedback the process data associated with the execution process to the service link orchestration device, so as to assist the service link orchestration device in performing service link tracking. After receiving the above process data associated with the execution process, the service link orchestration device may also store the received process data associated with the execution process in the database using the identification information of the service link as an index, so that these data can be retrieved according to the identification information of the service link when needed, and operations such as data analysis and workflow backtracking can be performed based on these data.
[0140] In step 630, obtain the execution result of the target atomic task for this round of scheduling.
[0141] In the embodiments of the present disclosure, the service link orchestration device may obtain the execution status of the target atomic task for this round of scheduling from the task executor, and determine the execution result of the target atomic task for this round of scheduling based on the above execution status. For example, in response to determining that the execution status of the target atomic task for this round of scheduling is execution successful, it is determined that the execution result of the target atomic task for this round of scheduling is execution successful; in response to determining that the execution status of the target atomic task for this round of scheduling is execution failed, it is determined that the execution result of the target atomic task for this round of scheduling is execution failed. That is, in the embodiments of the present disclosure, the above execution result may generally include: execution successful or execution failed.
[0142] In some embodiments of the present disclosure, after the service link orchestration device obtains the execution status of the target atomic task for this round of scheduling from the task executor, it may further mark and update the status of the node on the workflow corresponding to the node in a timely manner. For example, if the execution status of the target atomic task for this round of scheduling is execution successful, the status of the corresponding node may be set to execution successful; if the execution status of the target atomic task for this round of scheduling is execution failed, the status of the corresponding node may be set to execution exception; if the execution status of the target atomic task for this round of scheduling is in execution, the status of the corresponding node may be set to in execution.
[0143] Further, based on the execution status and process data of the target atomic task returned by the task executor, the service link orchestration device can view and track the execution processes and statuses of the individual atomic tasks corresponding to the service link. Thus, when one of the atomic tasks fails to execute, data analysis and workflow backtracking can be performed based on this information to analyze the cause of the execution failure and determine the corresponding solution to provide a fault recovery capability. In addition, the service link orchestration device can also monitor abnormal data based on the service link tracking results and set alarm rules. For example, an alarm is triggered when the execution failure rate of an atomic task exceeds a threshold, so that real-time monitoring and timely intervention of abnormal situations can be achieved.
[0144] In step 640, the obtained execution result is used as the execution result of the target atomic task in the previous round of scheduling, and step 610 is returned.
[0145] The following will use Figure 5c The workflow shown as an example to exemplarily illustrate the process of allocating at least one atomic task to a target task executor among multiple task executors based on the workflow described in step 260 above. When performing the first atomic task scheduling, since the execution result of the target atomic task in the previous round of scheduling is empty (that is, for the first atomic task in the workflow, there is no previous atomic task (i.e., node 00 has no upper-level node), then for the first atomic task in the workflow, there is no previous round of scheduling), the service link orchestration device can directly Figure 5c The atomic task corresponding to the first node 00 in the workflow shown is used as the target atomic task and added to the atomic task queue. After obtaining the execution result of the atomic task corresponding to node 00 from the task executor, the service link orchestration device uses the execution result of the atomic task corresponding to node 00 as the execution result of the target atomic task in the previous round of scheduling, and then continues with a new round of scheduling. Specifically, assuming that the atomic task corresponding to node 00 is successfully executed, then in the new round of scheduling process, according to Figure 5c The next-level node 11 of node 00 in the workflow shown is used as the target node, and the atomic task corresponding to node 11 is used as the target atomic task and added to the atomic task queue. After obtaining the execution result of the atomic task corresponding to node 11 from the task executor, the service link orchestration device uses the execution result of the atomic task corresponding to node 11 as the execution result of the target atomic task in the previous round of scheduling, and then continues with a new round of scheduling. Assuming that the target atomic task is successfully executed, continue to schedule nodes 12 and 13 in the workflow in sequence according to the above method based on the order of the nodes in the workflow. Assuming that the atomic task corresponding to node 13 is also successfully executed, then continue according to Figure 5cThe execution order of the nodes in the workflow shown uses the next-level nodes 01 and 02 of node 13 (two nodes executed in parallel) as the target nodes, and the two atomic tasks corresponding to nodes 01 and 02 are added to the atomic task queue as the target atomic tasks, and pulled by the task executor. Assuming that the atomic tasks corresponding to nodes 01 and 02 are also successfully executed, the atomic tasks corresponding to the nodes on the entire workflow are all successfully executed, that is, the service link corresponding to the workflow is also successfully arranged. Assuming that any node in the middle fails to execute, exception handling can be performed according to the set exception handling strategy, and operations such as alarm notification and data reporting can be performed according to the pre-set alarm strategy. About specific alarm and data reporting strategies can be set according to business needs, and the disclosed embodiment does not limit this.
[0146] It can be seen from the above process that when the service link orchestration device performs scheduling of atomic tasks, it is not completed in one go, but can be flexibly scheduled according to the workflow and the execution results of the target atomic tasks of the previous round of scheduling. For example, when the target atomic task of the previous round of scheduling is successfully executed, the target atomic task of this round of scheduling can be determined according to the node sequence indicated by the workflow, and the target atomic task of this round of scheduling can continue to be scheduled; and when the target atomic task of the previous round of scheduling fails to execute, exception handling can be performed according to the exception handling strategy of the atomic task. Therefore, the above-mentioned scheduling method for atomic tasks can effectively solve the problem that the workflow engine of the existing service link is difficult to support large-scale and dynamically changing business needs, and improve the scalability and flexibility of service link orchestration.
[0147] In addition, by scheduling atomic tasks in an atomic task queue, the decoupling between the service link scheduling device and the task executor can be achieved. Specifically, the service link scheduling device can assign atomic tasks at any time, and the task executor can execute atomic tasks at any time. Through this asynchronous execution method, the throughput of atomic task execution can be greatly improved.
[0148] Furthermore, by marking the status of the node on the node corresponding to the workflow, service chain tracking can be achieved, that is, the call of each microservice in the service chain can be tracked to find out the performance bottlenecks, errors and exceptions in the service chain, thereby improving the availability and stability of the business system.
[0149] It can be seen that through the above service link orchestration method, the orchestration of any service link in the above business system can be achieved, so that the functions of the above service link can be automatically realized when a user requests a service corresponding to the service link. In addition, in the above service link orchestration method, at least one atomic task generated for the service link will be separately assigned to multiple task executors for execution respectively. Therefore, the above service link orchestration method can support a distributed system and has higher scalability, flexibility, and fault tolerance.
[0150] As described above, in some embodiments of the present disclosure, when configuring a service link, a developer can input microservice configuration information and / or service link configuration information corresponding to the microservice to the service link orchestration device through a console capable of communicating with the above service link orchestration device. After receiving the microservice configuration information and / or service link configuration information corresponding to the microservice, the service link orchestration device can store the received microservice configuration information and / or service link configuration information corresponding to the microservice in a database, thereby realizing the persistence of the microservice configuration information and / or service link configuration information corresponding to the microservice.
[0151] It can be seen from this that based on the already developed microservices, a developer only needs to edit and submit the service link configuration information to complete the orchestration of each microservice in the service link. In this way, the developer does not need to manually write a large amount of code to implement and publish the workflow logic, reducing the development workflow, cost, and maintenance difficulty, thereby improving the development efficiency.
[0152] Corresponding to the above service link orchestration method, some embodiments of the present disclosure also disclose a service link orchestration device. Figure 7 Shows the internal structure of the service link orchestration device described in the embodiments of the present disclosure. As Figure 7 shown, the above service link orchestration device may include the following multiple modules:
[0153] A request receiving module 710, configured to receive an orchestration request for a service link;
[0154] A first configuration information obtaining module 720, configured to read service link configuration information corresponding to the service link based on the orchestration request for the service link;
[0155] A parsing module 730, configured to determine a workflow corresponding to the service link based on the service link configuration information;
[0156] A second configuration information obtaining module 740, configured to read microservice configuration information corresponding to at least one microservice involved in the workflow;
[0157] An atomic task generating module 750, configured to generate at least one atomic task respectively based on the read microservice configuration information;
[0158] A scheduling module 760 is configured to assign each of the atomic tasks to a target task executor corresponding to the atomic task based on the workflow, and the target task executor executes the assigned atomic task.
[0159] It should be noted that the implementation methods of the various modules in the above device and the specific technical effects that can be achieved can refer to the implementation methods of the respective steps in the foregoing embodiments, and will not be repeated here.
[0160] Based on the same inventive concept, corresponding to the method of any of the above embodiments, the present disclosure further provides an electronic device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where when the processor executes the computer program, the service link orchestration method described in any of the above embodiments is implemented.
[0161] Figure 8 FIG. shows a schematic hardware structure diagram of a more specific electronic device provided in this embodiment. The device may include: a processor 2010, a memory 2020, an input / output interface 2030, a communication interface 2040, and a bus 2050. Among them, the processor 2010, the memory 2020, the input / output interface 2030, and the communication interface 2040 are communicatively connected to each other inside the device through the bus 2050.
[0162] The processor 2010 may be implemented in a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, etc., and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0163] The memory 2020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 2020 may store an operating system and other application programs. When implementing the technical solutions provided in the embodiments of this specification through software or firmware, the relevant program codes are stored in the memory 2020 and are called and executed by the processor 2010.
[0164] The input / output interface 2030 is used to connect input / output devices to achieve information input and output. Among them, the input / output devices can be configured as components in the device or externally connected to the device to provide corresponding functions. The input devices can include microphones, various sensors, etc., and the output devices can include displays, speakers, vibrators, indicator lights, etc.
[0165] The communication interface 2040 is used to connect a communication module (not shown in the figure) to achieve communication interaction between this device and other devices. The communication module can achieve communication through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0166] The bus 2050 includes a path for transmitting information between various components of the device (such as the processor 2010, the memory 2020, the input / output interface 2030, and the communication interface 2040).
[0167] It should be noted that although the above device only shows the processor 2010, the memory 2020, the input / output interface 2030, the communication interface 2040, and the bus 2050, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device may also only include the components necessary to implement the solution of the embodiments of this specification, and does not necessarily include all the components shown in the figure.
[0168] The electronic device in the above embodiment is used to implement the corresponding service link orchestration method in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0169] Based on the same inventive concept, corresponding to the method in any of the above embodiments, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the service link orchestration method as described in any of the foregoing embodiments.
[0170] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer 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 technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette tapes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0171] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the service link orchestration method described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0172] Based on the same inventive concept, corresponding to the service link orchestration method of any of the above embodiments, the present disclosure also provides a computer program product, which includes computer program instructions. In some embodiments, when the computer program instructions run on a computer, the computer is caused to execute the steps in each of the embodiments of the service link orchestration method. Corresponding to the execution subject of each step in each of the embodiments of the service link orchestration method, the processor that executes the corresponding step can belong to the corresponding execution subject.
[0173] The computer program product of the above embodiment is used to cause the processor to execute the service link orchestration method described in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be elaborated here.
[0174] Those of ordinary skill in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the present disclosure (including the claims) is limited to these examples; under the concept of the present disclosure, the technical features in the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations in different aspects of the embodiments of the present disclosure as described above, which are not provided in detail for the sake of brevity.
[0175] In addition, for simplicity of explanation and discussion, and so as not to make the embodiments of the present disclosure difficult to understand, well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Further, the devices may be shown in block diagram form in order to avoid making the embodiments of the present disclosure difficult to understand, and this also takes into account the fact that details of the implementation of such block diagram devices are highly dependent on the platform on which the embodiments of the present disclosure are to be implemented (i.e., these details should be entirely within the understanding of those skilled in the art). In cases where specific details (e.g., circuits) are set forth to describe exemplary embodiments of the present disclosure, it will be apparent to those skilled in the art that the embodiments of the present disclosure may be practiced without these specific details or with variations of these specific details. Accordingly, these descriptions should be considered illustrative rather than restrictive.
[0176] Although the present disclosure has been described in connection with specific embodiments thereof, many alternatives, modifications, and variations thereof will be apparent to those of ordinary skill in the art based on the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0177] Embodiments of the present disclosure are intended to cover all such alternatives, modifications, and variations that fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the embodiments of the present disclosure shall be included within the protection scope of the present disclosure.
Claims
1. A service link arrangement method, comprising: Receive a service link orchestration request; Reading service link configuration information corresponding to the service link based on the orchestration request of the service link; Determine the workflow corresponding to the service link based on the service link configuration information; Reading microservice configuration information corresponding to at least one microservice involved in the workflow; Generate at least one atomic task based on the microservice configuration information corresponding to the at least one microservice; as well as Each of the atomic tasks is assigned to a target task executor corresponding to the atomic task based on the workflow, and the target task executor executes the assigned atomic task.
2. The method according to claim 1, wherein: The arrangement request of the service link carries identification information of the service link; as well as The reading of the service link configuration information corresponding to the service link based on the orchestration request of the service link includes: reading the service link configuration information corresponding to the service link from a database using the identification information of the service link as an index.
3. The method according to claim 1, wherein: Determining the workflow corresponding to the service link based on the service link configuration information includes: Determine a target task according to the order of tasks recorded in the task set in the service link configuration information; Reading the configuration information of the target task; Adding a node corresponding to the target task in the workflow based on the configuration information of the target task; In response to determining that corresponding nodes have been added to all the tasks recorded in the task set in the workflow, ending; and In response to determining that corresponding nodes have not been added to all tasks recorded in the task set in the workflow, returning to the step of determining a target task according to the order of tasks recorded in the task set in the service link configuration information.
4. The method according to claim 3, wherein: Adding a node corresponding to the target task in the workflow based on the configuration information of the target task includes: Generate a target node corresponding to the target task; Setting the name of the target node based on the identification information of the target task; and A connection relationship between the target node and other nodes in the workflow is set based on the type information of the target task.
5. The method according to claim 4, wherein: The setting of the connection relationship between the target node and other nodes in the workflow based on the type information of the target task includes: In response to determining that the target task is the first task recorded in the task set, directly adding the target node in the workflow, and using the target node as the current node of the workflow; In response to determining that the target task is not the first task recorded in the task set, the type information of the target task is read, the target node is added to the workflow based on the type information of the target task, and the target node is used as the current node of the workflow; wherein, The adding the target node to the workflow based on the type information of the target task comprises: In response to determining that the type information of the target task is sequential execution, adding the target node as a next-level node of the current node; In response to determining that the type information of the target task is parallel execution, adding the target node as a node parallel to the current node as a next-level node of the previous-level node of the current node; In response to determining that the type information of the target task is conditional execution, adding the target node as a next-level node of the current node, and setting an execution condition of the target node based on the content of the conditional execution; and In response to determining that the type information of the target task is a nested workflow, the target node is set as a virtual node and added as a next-level node of the current node.
6. The method according to claim 5, further comprising: Checking whether the workflow includes a virtual node; In response to determining that the workflow does not include the virtual node, ending; In response to determining that the workflow includes the virtual node, taking a virtual node in the workflow as a target virtual node; Reading service link configuration information corresponding to the target virtual node; Determine the sub-workflow corresponding to the target virtual node based on the service link configuration information; as well as The target virtual node in the workflow is replaced by the sub-workflow corresponding to the target virtual node, and then the process returns to the step of checking whether the workflow includes a virtual node.
7. The method according to claim 1, wherein: The reading of microservice configuration information corresponding to at least one microservice involved in the workflow includes: Read the name of each node included in the workflow respectively; and Using the names of the nodes as indexes, microservice configuration information corresponding to the at least one microservice is read from the database respectively.
8. The method according to claim 1, wherein: Generating at least one atomic task based on the microservice configuration information corresponding to the at least one microservice includes: For each of the at least one microservice, microservice configuration information corresponding to the microservice, Generate a name of an atomic task based on the identification information of the microservice in the microservice configuration information; generating attribute information of the atomic task based on the attribute information of the microservice in the microservice configuration information; and An exception handling strategy for the atomic task is generated based on the exception handling information of the microservice in the microservice configuration information.
9. The method according to claim 1, wherein: The allocating each of the atomic tasks to a target task executor corresponding to the atomic task based on the workflow includes: Determine the target atomic task of this round of scheduling based on the workflow and the execution result of the target atomic task of the previous round of scheduling; Add the target atomic task of this round of scheduling to the atomic task queue; Obtaining the execution result of the target atomic task of the current round of scheduling; and The execution result is used as the execution result of the target atomic task of the previous round of scheduling, and the step of determining the target atomic task of the current round of scheduling based on the workflow and the execution result of the target atomic task of the previous round of scheduling is returned.
10. The method according to claim 9, wherein: Determining the target atomic task of this round of scheduling based on the workflow and the execution result of the target atomic task of the previous round of scheduling includes: In response to determining that the execution result of the target atomic task of the previous round of scheduling is empty, taking the atomic task corresponding to the first node in the workflow as the target atomic task of the current round of scheduling; In response to determining that the execution result of the target atomic task of the previous round of scheduling is successful, the atomic task corresponding to the next-level node of the node corresponding to the target atomic task of the previous round of scheduling is used as the target atomic task of the current round of scheduling according to the order of nodes in the workflow, until the next-level node is empty; and In response to determining that the execution result of the target atomic task of the previous round of scheduling is execution failure, performing exception handling according to the exception handling strategy corresponding to the target atomic task of the previous round of scheduling in the task set of the service link configuration information.
11. The method according to claim 1, wherein: The target task executor executing the assigned atomic task includes: The target task executor pulls the target atomic task from the head of the atomic task queue; Acquire the task logic corresponding to the target atomic task based on the name of the target atomic task; Processing input parameters in the attribute information of the target atomic task based on the task logic; Obtaining the execution result of the task logic; and The execution result is returned as an output parameter in the attribute information of the target atomic task.
12. A service link arrangement device, comprising: A request receiving module, used to receive a service link orchestration request; A first configuration information acquisition module, configured to read service link configuration information corresponding to the service link based on the orchestration request of the service link; A parsing module, configured to determine a workflow corresponding to the service link based on the service link configuration information; A second configuration information acquisition module, used to read microservice configuration information corresponding to at least one microservice involved in the workflow; An atomic task generation module, configured to generate at least one atomic task based on the microservice configuration information corresponding to the at least one microservice; as well as The scheduling module is used to allocate each of the atomic tasks to a target task executor corresponding to the atomic task based on the workflow, so that the target task executor executes the allocated atomic task.
13. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the service link orchestration method according to any one of claims 1 to 11 when executing the computer program.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the service link orchestration method according to any one of claims 1 to 11.
15. A computer program product, comprising computer program instructions, which, when executed on a computer, enable the computer to execute the service link orchestration method according to any one of claims 1 to 11.