Distributed micro-service scheduling method, device and equipment
By presetting call logic arrangement information and process control in microservice programs, the problem of uncontrollable call relationship complexity between microservice programs is solved, efficient microservice scheduling and exception handling is achieved, and highly available applications are built.
Patent Information
- Application Number
- CN202311845450.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-07-01
AI Technical Summary
The complexity of the mutual call relationship between existing microservice programs is uncontrollable, resulting in problems such as long response time and unpredictable results due to failure of some links.
By determining the call logic arrangement information corresponding to the business request in the preset file, analyzing the orchestration order of functional entities and distributed microservices, scheduling the functional entities and microservices in the orchestration order, and setting process control information to handle scheduling exceptions.
It realizes the standardization of microservice orchestration, builds highly available applications, and does not require customized transformation of microservice programs, avoids uncontrollable problems caused by unexpected scheduling, and simplifies exception handling and retry handling.
Smart Images

Figure CN120234104A_ABST
Abstract
Description
Background Art
[0002] Currently, many applications, in order to achieve service splitting and autonomy, loose coupling and replaceability, independent deployment and scalability, improve team collaboration for agile development and rapid application delivery, and also to solve the problems of technological heterogeneity and diversity, adopt the microservices approach as the basic design architecture of the software.
[0003] The microservices approach splits a large application into a set of small, independent services, each service focusing on completing a specific function and collaborating with each other through lightweight communication mechanisms.
[0004] The microservices architecture can solve or alleviate the above problems, but also brings some challenges, such as communication and coordination between services, the complexity of distributed systems, and data consistency problems.
[0005] At the same time, due to the uncontrollable complexity of the mutual call relationships between programs, it often brings problems such as unexpectedly long response times and unpredictable results due to partial link failures. Summary of the Invention
[0006] The purpose of this application is to provide a scheduling method for distributed microservices, which is used to solve the problems that the complexity of the mutual call relationships between existing microservice programs is uncontrollable, often resulting in unexpectedly long response times and unpredictable results due to partial link failures.
[0007] In a first aspect, an embodiment of this application provides a scheduling method for distributed microservices, and the method includes:
[0008] In response to a service request, determine the call logic orchestration information corresponding to the service request from a preset file, where the preset file includes call logic orchestration information corresponding to different service requests;
[0009] Parse the determined call logic orchestration information to obtain a first orchestration order of multiple functional entities for completing the service request, and at least one distributed microservice corresponding to each functional entity and a second orchestration order of the at least one distributed microservice, where the functional entity corresponds to a complete logical processing flow;
[0010] Schedule the multiple functional entities according to the first orchestration order, and for the target functional entity to be scheduled, schedule the multiple target distributed microservices according to the second orchestration order of the multiple target distributed microservices corresponding to the target functional entity.
[0011] In some possible embodiments, process control information is set for the functional entity in the preset file; the method further includes:
[0012] In the process of scheduling the multiple functional entities according to the first scheduling order, process control is performed on the scheduling of the functional entities that meet the process control conditions according to the process control information.
[0013] In some possible embodiments, the process control information includes an upper limit of execution time. Performing process control on the scheduling of the functional entities that meet the process control conditions according to the process control information includes:
[0014] In the case where, according to the scheduling results of the multiple target distributed microservices corresponding to the target functional entity, it is determined that the execution time of the target functional entity reaches the time limit and the execution is not successful, it is determined that the process control condition for retry is met, and a retry scheduling is performed on the target functional entity.
[0015] In some possible embodiments, the process control information includes the number of retries for ending the scheduling. Performing process control on the scheduling of the functional entities that meet the process control conditions according to the process control information includes:
[0016] In the case where, according to the scheduling results of the multiple target distributed microservices corresponding to the target functional entity, it is determined that the number of retries reaches the number of retries and the execution is still not successful, it is determined that the process control condition for ending is met, the scheduling is ended, and a result of business request failure is returned.
[0017] In some possible embodiments, the process control information includes synchronous or asynchronous execution. Performing process control on the scheduling of the functional entities that meet the process control conditions according to the process control information includes:
[0018] In the case where it is determined that the currently scheduled target functional entity is one that is not allowed to be executed simultaneously with other functional entities, it is determined that the process control condition for asynchrony is met, and the target functional entity is executed in an asynchronous execution manner;
[0019] In the case where it is determined that the currently scheduled are multiple target functional entities that are allowed to be scheduled simultaneously, it is determined that the process control condition for synchronous execution is met, and the multiple target functional entities are executed in a synchronous execution manner.
[0020] In some possible embodiments, the process control information includes the synchronous execution quantity N. Executing the multiple target functional entities in a synchronous execution manner includes:
[0021] When executing the multiple target functional entities in a synchronous execution manner, queue the multiple target functional entities, and synchronously execute the first N target functional entities in the queuing order;
[0022] Delete the executed target functional entities from the queue until all the multiple target functional entities are executed.
[0023] In some possible embodiments, in the distributed microservices corresponding to the target functional entity of the retry scheduling, there is a data processing program for cleaning up the garbage data generated during the previous execution of the scheduling.
[0024] In some possible embodiments, the target functional entity includes a data cleaning program that is only used to clean up the garbage data generated by the retry scheduling of at least one previous target functional entity's distributed microservices. The process control information includes jumping out. According to the process control information, the scheduling of the functional entity that meets the process control conditions is controlled, including:
[0025] In the case where it is determined that the data cleaning program has not read the garbage data generated by the retry scheduling of at least one previous target functional entity's distributed microservices, jump out of the data cleaning program and schedule the next target functional entity.
[0026] In a second aspect, another embodiment of the present application provides a scheduling device for distributed microservices, and the device includes:
[0027] An orchestration information determination module, configured to, in response to a service request, determine the call logic orchestration information corresponding to the service request from a preset file, where the preset file includes call logic orchestration information corresponding to different service requests;
[0028] A scheduling order determination module, configured to parse the determined call logic orchestration information to obtain a first orchestration order of multiple functional entities for completing the service request, and a second orchestration order of at least one distributed microservice corresponding to each functional entity and the at least one distributed microservice, where the functional entity corresponds to a complete logical processing flow;
[0029] A logical scheduling module, configured to schedule the multiple functional entities according to the first orchestration order, and for the target functional entity to be scheduled, schedule the multiple target distributed microservices according to the second orchestration order of the multiple target distributed microservices corresponding to the target functional entity.
[0030] In a third aspect, another embodiment of the present application further provides a scheduling device for distributed microservices, including at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the scheduling method for distributed microservices provided in the first aspect above.
[0031] In a fourth aspect, another embodiment of the present application further provides a computer storage medium, where the computer storage medium stores a computer program, and the computer program is used to cause a computer to execute the scheduling method for distributed microservices provided in the first aspect above.
[0032] The scheduling method of distributed microservices provided by the embodiments of the present application can achieve microservice orchestration. Without customizing and transforming the microservice program, a highly available application program can be built. While standardizing microservice calls, it does not bring any intrusion to the microservices themselves, but realizes the overall scheduling function through an external scheduler.
[0033] Other features and advantages of the present application will be described in the following specification, and, in part, will be obvious from the specification, or will be understood by implementing the present application. The objectives and other advantages of the present application can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] To more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required to be used in the embodiments of the present application. Obviously, the following introduced drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0035] Figure 1 It is a schematic diagram of an application environment according to an embodiment of the present application;
[0036] Figure 2 It is a schematic flowchart of the scheduling method of distributed microservices according to an embodiment of the present application;
[0037] Figure 3 It is a schematic diagram of call logic orchestration corresponding to a business request according to an embodiment of the present application;
[0038] Figure 4 It is a schematic structural diagram of a scheduling device for distributed microservices according to an embodiment of the present application;
[0039] Figure 5 It is a structural diagram of a scheduling device for distributed microservices according to an embodiment of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0040] To further illustrate the technical solutions provided by the embodiments of the present application, the following provides a detailed description in combination with the drawings and specific implementation manners. Although the embodiments of the present application provide the method operation steps as shown in the following embodiments or drawings, more or fewer operation steps may be included in the method based on routine or non-creative labor. In steps where there is no necessary causal relationship logically, the execution order of these steps is not limited to the execution order provided by the embodiments of the present application. When the method is actually processed or executed by a control device, it can be executed in the order shown in the embodiments or drawings or executed in parallel.
[0041] The functions of an application system are split into multiple independent services, which communicate and cooperate through a network. These services are often deployed on different nodes and interact through message passing or remote call mechanisms. Distributed services are often the foundation of a distributed system.
[0042] The microservices architecture can solve or alleviate the above problems, but also brings some challenges, such as communication and coordination between services, the complexity of distributed systems, and data consistency issues.
[0043] At the same time, due to the uncontrollable complexity of the mutual call relationships between microservices programs, it often brings problems such as unexpectedly long response times and unpredictable results due to partial link failures.
[0044] In view of the uncontrollable complexity of the mutual call relationships between microservices programs in the related art, which often brings problems such as unexpectedly long response times and unpredictable results due to partial link failures, this application proposes a scheduling method for distributed microservices.
[0045] Other features and advantages of this application will be described in the subsequent specification, and part of them will be obvious from the specification or understood by implementing this application. The objectives and other advantages of this application can be achieved and obtained through the structures specifically pointed out in the written specification, claims, and drawings.
[0046] See Figure 1 , which is a schematic diagram of an application environment according to an embodiment of this application.
[0047] As Figure 1 shown, the application environment may include a client 10, a distributed application server 20, and distributed nodes 30. Among them, the user logs in to the business service platform through the client 10. The distributed server 20 is used to provide the business platform and communicate with the client 10 through the business service platform. When the distributed server 20 receives a business request sent by the user through the client 10, it calls the distributed microservices distributed on the distributed nodes 30. In the related art, the distributed nodes 30 cooperate through corresponding communication mechanisms to complete the services of the business request. The above-mentioned distributed application server can be an independent server or a server integrated on a certain distributed node.
[0048] An embodiment of this application provides a scheduling method for distributed microservices. This method is applied to a distributed application server. As Figure 2 shown, the method includes:
[0049] Step 201: In response to a service request, determine the call logic orchestration information corresponding to the service request from a preset file, where the preset file includes call logic orchestration information corresponding to different service requests.
[0050] After a user logs in to the service platform through a client, a service request is generated through an operation and sent to a distributed application server. After receiving the service request, the distributed application server, in response to the service request, determines the call logic orchestration information corresponding to the service request from a preset file.
[0051] In the embodiment of the present application, for various service requests of the service platform, the calls to the distributed microservices for completing the service requests are pre-orchestrated. The expected call logic is orchestrated into a fixed order and stored in a script file to obtain a preset file. The call logic orchestration information can be expressed by program code or a general text definition method.
[0052] Step 202: Parse the determined call logic orchestration information to obtain the first orchestration order of multiple functional entities for completing the service request, and the second orchestration order of at least one distributed microservice corresponding to each functional entity, where the functional entity corresponds to a complete logical processing flow.
[0053] In the embodiment of the present application, when generating the call logic orchestration information of the service request, first determine the functional entities belonging to the complete logical processing flow in the logical processing flow for completing the service request and the orchestration order of the functional entities. The above functional entity is an executable object belonging to a complete logical processing flow. This object can be regarded as a function, and its content can be anything. For example, it can include: certain specific operations, program logic processing work, and communication with one or more microservice addresses to complete the work. When the current functional entity is executed, it is necessary to call the distributed microservices corresponding to the functional entity and orchestrate the call order.
[0054] Step 203: Schedule the multiple functional entities according to the first orchestration order. For the target functional entity to be scheduled, schedule the multiple target distributed microservices according to the second orchestration order of the multiple target distributed microservices corresponding to the target functional entity.
[0055] In the embodiment of the present application, the functional entities are scheduled according to the first orchestration order. When calling the current target functional entity, the distributed application server determines the distributed nodes where the multiple target distributed microservices corresponding to the target functional entity are located, and communicates with the corresponding distributed nodes according to the second orchestration order of the multiple target distributed microservices corresponding to the target functional entity to schedule the multiple target distributed microservices.
[0056] By using the scheduling method of distributed microservices provided in this embodiment, microservice orchestration can be achieved. Without customizing and transforming the microservice program, a highly available application program can be constructed. While standardizing microservice calls, it does not cause any intrusion to the microservices themselves, but realizes the overall scheduling function through an external scheduler.
[0057] In some possible embodiments, process control information is set for the functional entities in the preset file, and the method further includes:
[0058] During the process of scheduling the multiple functional entities in the first orchestration order, the scheduling of the functional entities that meet the process control conditions is controlled according to the process control information.
[0059] During the process of microservice calls, various scheduling situations may occur. Corresponding process control conditions can be set for different scheduling situations. If the scheduling situation meets the process control conditions, the process control is performed according to the process control information. Different process control conditions correspond to different process control information.
[0060] To solve the above problems caused by uncontrollable microservice scheduling, the scheduling framework of the microservices is designed through a preset file to pre-orchestrate the microservices involved in the service request. The business logic of at least one distributed microservice is regarded as a functional entity, the order of the functional entities and the order of the microservices corresponding to the functional entities are orchestrated, and the execution process of the orchestrated content is controlled. Thus, the microservice scheduling is standardized, the uncontrollable problems caused by unexpected scheduling are avoided, and the service scheduling scenario is planned.
[0061] Such as Figure 3An example of the scheduling method for distributed microservices according to an embodiment of the present application is shown. For a service request call, functional entities FuncEntity1 - FuncEntity4 that complete the call process can be determined, and the orchestration order of the functional entities is functional entity FuncEntity1, functional entity FuncEntity2, functional entity FuncEntity3, and functional entity FuncEntity4. Determine at least one distributed microservice corresponding to each functional entity and the orchestration order of at least one distributed microservice. For example, determine that the orchestration order of at least one distributed microservice corresponding to functional entity FuncEntity1 is distributed microservice MicroSrv1, distributed microservice MicroSrv5, and distributed microservice MicroSrv2; the orchestration order of at least one distributed microservice corresponding to functional entity FuncEntity2 is distributed microservice MicroSrv3 and distributed microservice MicroSrv6; functional entity FuncEntity3 corresponds to one distributed microservice MicroSrv4; the orchestration order of at least one distributed microservice corresponding to functional entity FuncEntity4 is distributed microservice MicroSrv7 and distributed microservice MicroSrv8.
[0062] In the embodiments of the present application, different process control conditions can be set. When the corresponding process control conditions are met, the corresponding process control information is used for process control. Specifically, the following several process control scenarios can be included:
[0063] 1) Process control for reaching the execution time limit
[0064] The above process control information includes the execution time limit. Process control for the scheduling of functional entities that meet the process control conditions is performed according to the process control information, including:
[0065] In the case where it is determined, based on the scheduling results of multiple target distributed microservices corresponding to the target functional entity, that the execution time of the target functional entity reaches the time limit and the execution is not successful, it is determined that the process control condition for retry is met, and retry scheduling is performed on the target functional entity. The above execution time limit can be set for the process, that is, the process timeout flowtimeout is determined, or it can be set for the start time, such as the start timeout time Starttimeout.
[0066] When a target functional entity is called, the corresponding distributed microservices are called according to the second orchestration order of at least one distributed microservice corresponding to the target functional entity. After the distributed microservice is successfully called, it feeds back information to the target functional entity. The target functional entity determines whether the call is successful based on the feedback information. If the call is successful, the next distributed microservice to be called is determined.
[0067] This upper limit of execution time can be very long. However, since it is part of the overall call logic, it should also have an expected termination time so that the entire call logic can be completed.
[0068] 2) Retry process control
[0069] In the embodiments of the present application, the target functional entity for retry scheduling is determined in the above manner. The process control information further includes the number of retries for ending the scheduling. The scheduling of the functional entity that meets the process control conditions is controlled according to the process control information, including:
[0070] When it is determined, based on the scheduling results of multiple target distributed microservices corresponding to the target functional entity, that the retry has reached the number of retries and the execution is still not successful, it is determined that the process control condition for ending is met, the scheduling is ended, and the result of the business request failure is returned.
[0071] 3) Synchronous or asynchronous execution
[0072] Normally, the orchestrated functional entities are executed sequentially, which ensures the service call order. At the same time, it also supports non-blocking calls to asynchronous objects when necessary. Although this poses a challenge to the service call order, since the pre-orchestration method is adopted, it is easy to control the orchestrated functional entities.
[0073] In the embodiments of the present application, the process control information includes synchronous or asynchronous execution. The scheduling of the functional entity that meets the process control conditions is controlled according to the process control information, including:
[0074] When it is determined that the currently scheduled target functional entity is not allowed to be executed simultaneously with other functional entities, it is determined that the process control condition for asynchrony is met, and the target functional entity is executed in an asynchronous execution manner;
[0075] When it is determined that the currently scheduled target functional entities are multiple and allowed to be scheduled simultaneously, it is determined that the process control condition for synchronous execution is met, and the multiple target functional entities are executed in a synchronous execution manner.
[0076] In the embodiments of the present application, the execution manner of each functional entity can be set to be an asynchronous execution manner or a synchronous execution manner.
[0077] If the above functional entity FuncEntity1 is in an asynchronous execution mode, functional entities FuncEntity2 and FuncEntity3 are in a synchronous execution mode, and functional entity FuncEntity4 is in an asynchronous execution mode, then the functional entities are executed in the order of functional entity FuncEntity1 > functional entities FuncEntity2 and FuncEntity3 > functional entity FuncEntity4.
[0078] In a certain step, when the number of functional entities in the synchronous execution mode is relatively large, in order to ensure that resources are not over-occupied, the number of functional entities that are synchronously executed simultaneously can be restricted, and a queuing mechanism is adopted for scheduling.
[0079] In the embodiment of the present application, the process control information includes the synchronous execution quantity N. Executing the multiple target functional entities in the synchronous execution mode includes:
[0080] When executing the multiple target functional entities in the synchronous execution mode, queue the multiple target functional entities, and synchronously execute the first N target functional entities in the queuing order;
[0081] Delete the executed target functional entities from the queue until all the multiple target functional entities are executed.
[0082] 4) Process control for functional entities supporting idempotent and non-idempotent operations
[0083] In the embodiment of the present application, the entire call logic is orchestrated. The goal is to make the orchestrated script execute successfully finally. The orchestrated process control is to solve the error handling (the retry count reaches the end of scheduling, timeout triggers retry) for the failure of the executed functional entity itself. Therefore, it should be ensured that the orchestrated functional entity can run repeatedly without causing additional impacts, and the operations in the distributed microservices called by the target functional entity should be idempotent. That is, in the distributed microservices corresponding to the target functional entity for retry scheduling, there is a data processing program for cleaning up the garbage data generated during the previous execution scheduling, so as to ensure that the functional entity can run repeatedly.
[0084] If the orchestrated functional entity is non-idempotent in execution, it is necessary to orchestrate the functional entity with relevant processing logic in the process. That is to say, the operations in the distributed microservices corresponding to the functional entity can be allowed to fail, but the failure also belongs to the content of the process orchestration.
[0085] In an embodiment of the present application, the target functional entity includes a data cleaning program that is only used to clean up the garbage data generated by the retry scheduling distributed microservices of at least one previous target functional entity. The process control information includes "jump out". The scheduling of the functional entity that meets the process control conditions is controlled according to the process control information, including:
[0086] When it is determined that the data cleaning program has not read the garbage data generated by the retry scheduling distributed microservices of at least one previous target functional entity, jump out of the data cleaning program and schedule the next target functional entity.
[0087] For example, the operations in some distributed microservices called by the functional entity FuncEntity2 and the functional entity FuncEntity3 are non-idempotent, and corresponding garbage data will be generated and not cleaned up in time. To ensure the normal operation of the call, the functional entity FuncEntity4 is designed to be dedicated to cleaning up the garbage generated when calling the functional entity FuncEntity2 and the functional entity FuncEntity3. If no garbage data is read, the call to the functional entity FuncEntity4 is jumped out and the call to the next functional entity is executed.
[0088] Through the above process control, the microservice scheduling is standardized, avoiding uncontrollable problems caused by unexpected scheduling, planning the service scheduling scenario, and simplifying the implementation methods of exception handling and retry handling.
[0089] Based on the same inventive concept, the present application also provides a scheduling device 400 for distributed microservices, as Figure 4 shown. The device includes:
[0090] An orchestration information determination module 401, configured to determine, in response to a service request, the call logic orchestration information corresponding to the service request from a preset file, where the preset file includes call logic orchestration information corresponding to different service requests;
[0091] A scheduling order determination module 402, configured to parse the determined call logic orchestration information to obtain a first orchestration order of multiple functional entities for completing the service request, and a second orchestration order of at least one distributed microservice corresponding to each functional entity and the at least one distributed microservice, where the functional entity corresponds to a complete logical processing flow;
[0092] A logical scheduling module 403, configured to schedule the multiple functional entities according to the first orchestration order, and for the target functional entity to be scheduled, schedule the multiple target distributed microservices according to the second orchestration order of the multiple target distributed microservices corresponding to the target functional entity.
[0093] In some possible embodiments, process control information is set for the functional entities in the preset file, and it further includes:
[0094] A process control module 404, configured to perform process control on the scheduling of the functional entities that meet the process control conditions according to the process control information during the process of scheduling the multiple functional entities in the first scheduling order.
[0095] In some possible embodiments, the process control information includes an upper limit of execution time. The process control module 404 performs process control on the scheduling of the functional entities that meet the process control conditions according to the process control information, including:
[0096] In the case that, according to the scheduling results of the multiple target distributed microservices corresponding to the target functional entity, it is determined that the execution time of the target functional entity reaches the time limit and the execution is not successful, it is determined that the process control condition for retry is met, and a retry scheduling is performed on the target functional entity.
[0097] In some possible embodiments, the process control information includes the number of retries. The process control module 404 performs process control on the scheduling of the functional entities that meet the process control conditions according to the process control information, including:
[0098] In the case that, according to the scheduling results of the multiple target distributed microservices corresponding to the target functional entity, it is determined that the number of retries reaches the number of retries and the execution is still not successful, it is determined that the process control condition for ending is met, and the scheduling is ended and a result of business request failure is returned.
[0099] In some possible embodiments, the process control information includes synchronous or asynchronous execution. The process control module 404 performs process control on the scheduling of the functional entities that meet the process control conditions according to the process control information, including:
[0100] In the case that it is determined that the currently scheduled is a target functional entity that is not allowed to be executed simultaneously with other functional entities, it is determined that the process control condition for asynchrony is met, and the target functional entity is executed in an asynchronous execution manner;
[0101] In the case that it is determined that the currently scheduled are multiple target functional entities that are allowed to be scheduled simultaneously, it is determined that the process control condition for synchronous execution is met, and the multiple target functional entities are executed in a synchronous execution manner.
[0102] In some possible embodiments, the process control information includes the synchronous execution quantity N. The process control module 404 executes the multiple target functional entities in a synchronous execution manner, including:
[0103] When executing the multiple target functional entities in a synchronous execution manner, queue the multiple target functional entities, and synchronously execute the first N target functional entities in the queuing order;
[0104] Delete the executed target functional entities from the queue until all the multiple target functional entities are executed.
[0105] In some possible embodiments, in the distributed microservice corresponding to the target functional entity for retry scheduling, there is a data processing program for cleaning up the garbage data generated during the previous execution scheduling.
[0106] In some possible embodiments, the target functional entity includes a data cleanup program that is only used to clean up the garbage data generated by the retry scheduling of at least one previous target functional entity's distributed microservice. The process control information includes "jump out". The process control module 404 performs process control on the scheduling of the functional entities that meet the process control conditions according to the process control information, including:
[0107] In the case where it is determined that the data cleanup program has not read the garbage data generated by the retry scheduling of at least one previous target functional entity's distributed microservice, jump out of the data cleanup program and schedule the next target functional entity.
[0108] After introducing the scheduling method and device of the distributed microservice according to the exemplary embodiments of the present application, next, a scheduling device of the distributed microservice according to another exemplary embodiment of the present application is introduced.
[0109] Those skilled in the art can understand that various aspects of the present application can be implemented as a system, method, or program product. Therefore, various aspects of the present application can be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation combining hardware and software aspects, which can be collectively referred to as "circuit", "module", or "system" here.
[0110] In some possible embodiments, the scheduling device of the distributed microservice according to the present application may at least include at least one processor and at least one memory. Among them, the memory stores program code, and when the program code is executed by the processor, the processor executes the steps in the scheduling method of the distributed microservice according to various exemplary embodiments of the present application described above in this specification.
[0111] Next, refer to Figure 5 to describe the scheduling device 150 of the distributed microservice according to this embodiment of the present application. Figure 5 The shown scheduling device 150 of the distributed microservice is only an example and should not bring any limitation to the functions and usage scope of the embodiments of the present application.
[0112] As shown Figure 5 in the figure, the scheduling device 150 of the distributed microservices is presented in the form of a general-purpose electronic device. The components of the scheduling device 150 of the distributed microservices may include, but are not limited to: the above-mentioned at least one processor 151, the above-mentioned at least one memory 152, and a bus 153 that connects different system components (including the memory 152 and the processor 151).
[0113] The bus 153 represents one or more of several types of bus structures, including a memory bus or a memory controller, a peripheral bus, a processor, or a local bus using any bus structure in a variety of bus structures.
[0114] The memory 152 may include a readable medium in the form of volatile memory, such as a random access memory (RAM) 1521 and / or a cache memory 1522, and may further include a read-only memory (ROM) 1523.
[0115] The memory 152 may further include a program / utilities 1525 having a set (at least one) of program modules 1524. Such program modules 1524 include, but are not limited to: an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include the implementation of a network environment.
[0116] The scheduling device 150 of the distributed microservices may also communicate with one or more external devices 154 (such as a keyboard, a pointing device, etc.), may also communicate with one or more devices that enable a user to interact with the scheduling device 150 of the distributed microservices, and / or may communicate with any device (such as a router, a modem, etc.) that enables the scheduling device 150 of the distributed microservices to communicate with one or more other electronic devices. Such communication may be performed through an input / output (I / O) interface 155. And, the scheduling device 150 of the distributed microservices may also communicate with one or more networks (such as a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 156. As shown in the figure, the network adapter 156 communicates with other modules for the scheduling device 150 of the distributed microservices through the bus 153. It should be understood that although not shown in the figure, other hardware and / or software modules may be used in combination with the scheduling device 150 of the distributed microservices, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0117] In some possible embodiments, various aspects of a scheduling method for distributed microservices provided by the present application can also be implemented in the form of a program product, which includes program code. When the program product runs on a computer device, the program code is used to cause the computer device to execute the steps in a scheduling method for distributed microservices according to various exemplary embodiments of the present application described above in this specification.
[0118] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0119] The program product for scheduling distributed microservices according to the embodiments of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can run on an electronic device. However, the program product of the present application is not limited to this. In this document, the readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0120] The readable signal medium can include a data signal propagated in a baseband or as part of a carrier wave, which carries the readable program code. Such a propagated data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The readable signal medium can also be any readable medium other than the readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0121] The program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination of the above.
[0122] The program code for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also including conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's electronic device, partially on the user's device, executed as a stand-alone software package, partially on the user's electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In cases involving a remote electronic device, the remote electronic device can be connected to the user's electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external electronic device (e.g., by using an Internet service provider to connect through the Internet).
[0123] It should be noted that although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more of the above-described units can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided and embodied by multiple units.
[0124] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that these operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, some steps can be omitted, multiple steps can be combined into one step for execution, and / or one step can be decomposed into multiple steps for execution.
[0125] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0126] This application is described with reference to the flowcharts and block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and block diagrams, as well as combinations of flows and blocks in the flowcharts and block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device produce a means for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and blocks Figure 1 or a means for implementing the functions specified in one or more of the blocks.
[0127] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction means that implements the functions specified in one or more of the flows Figure 1 one or more of the flows and blocks Figure 1 or a means for implementing the functions specified in one or more of the blocks.
[0128] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more of the flows Figure 1 one or more of the flows and blocks Figure 1 or a means for implementing the functions specified in one or more of the blocks.
[0129] Although the preferred embodiments of the present application have been described, those skilled in the art can make additional changes and modifications once they learn the basic creative concepts. Therefore, the appended claims are intended to be construed to include the preferred embodiments as well as all changes and modifications that fall within the scope of the present application.
[0130] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application is also intended to include these changes and modifications.
Claims
1. A scheduling method for distributed microservices, characterized in that, The method includes: In response to a service request, determining call logic orchestration information corresponding to the service request from a preset file, where the preset file includes call logic orchestration information corresponding to different service requests; Parsing the determined call logic orchestration information to obtain a first orchestration order of multiple functional entities for completing the service request, and at least one distributed microservice corresponding to each functional entity and a second orchestration order of the at least one distributed microservice, where the functional entity corresponds to a complete logical processing flow; Scheduling the multiple functional entities according to the first orchestration order, and for a target functional entity to be scheduled, scheduling the multiple target distributed microservices according to the second orchestration order of the multiple target distributed microservices corresponding to the target functional entity.
2. The method according to claim 1, wherein Process control information is set for the functional entity in the preset file; the method further includes: During the process of scheduling the multiple functional entities according to the first orchestration order, performing process control on the scheduling of the functional entity that meets the process control conditions according to the process control information.
3. The method according to claim 2, characterized in that The process control information includes an upper limit of execution time. Performing process control on the scheduling of the functional entity that meets the process control conditions according to the process control information includes: In the case where, according to the scheduling results of the multiple target distributed microservices corresponding to the target functional entity, it is determined that the execution time of the target functional entity reaches the time limit and the execution is not successful, it is determined that the process control condition for retry is met, and a retry schedule is performed on the target functional entity.
4. The method according to claim 3, wherein The process control information includes the number of retries for ending the schedule. Performing process control on the scheduling of the functional entity that meets the process control conditions according to the process control information includes: In the case where, according to the scheduling results of the multiple target distributed microservices corresponding to the target functional entity, it is determined that the retry reaches the number of retries and the execution is still not successful, it is determined that the process control condition for ending is met, and the schedule is ended and a result of service request failure is returned.
5. The method according to claim 2, wherein The process control information includes synchronous or asynchronous execution. Performing process control on the scheduling of the functional entity that meets the process control conditions according to the process control information includes: In the case where it is determined that the currently scheduled target functional entity is not allowed to be executed simultaneously with other functional entities, it is determined that the process control condition for asynchronous execution is met, and the target functional entity is executed according to the asynchronous execution method; In the case where it is determined that the currently scheduled target functional entities are multiple target functional entities allowed to be scheduled simultaneously, it is determined that the process control condition for synchronous execution is met, and the multiple target functional entities are executed according to the synchronous execution method.
6. The method according to claim 5, characterized in that, The process control information includes the synchronous execution quantity N. Executing the multiple target functional entities according to the synchronous execution method includes: When executing the multiple target functional entities according to the synchronous execution method, queuing the multiple target functional entities, and synchronously executing the first N target functional entities according to the queuing order; Deleting the executed target functional entities from the queue until all the multiple target functional entities are executed.
7. The method according to claim 3, characterized in that, In the distributed microservice corresponding to the target functional entity of the retry scheduling, there is a data processing program for cleaning up the garbage data generated during the previous execution of the scheduling.
8. The method according to claim 3, wherein The target functional entity includes a data cleaning program only for cleaning up the garbage data generated by the retry scheduling distributed microservice of at least one previous target functional entity. The process control information includes jumping out. The process control of the scheduling of the functional entity that meets the process control conditions is performed according to the process control information, including: When it is determined that the data cleaning program has not read the garbage data generated by the retry scheduling distributed microservice of at least one previous target functional entity, jump out of the data cleaning program and schedule the next target functional entity.
9. A scheduling device for distributed microservices, characterized in that, The device includes: An orchestration information determination module, configured to determine, in response to a service request, the call logic orchestration information corresponding to the service request from a preset file, where the preset file includes the call logic orchestration information corresponding to different service requests; A scheduling order determination module, configured to parse the determined call logic orchestration information to obtain a first orchestration order of multiple functional entities for completing the service request, and a second orchestration order of at least one distributed microservice corresponding to each functional entity and the at least one distributed microservice, where the functional entity corresponds to a complete logical processing flow; A logic scheduling module, configured to schedule the multiple functional entities according to the first orchestration order, and for the scheduled target functional entity, schedule the multiple target distributed microservices according to the second orchestration order of the multiple target distributed microservices corresponding to the target functional entity.
10. A scheduling device for distributed microservices, characterized in that, It includes at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method according to any one of claims 1-8.
11. A computer storage medium, characterized in that, The computer storage medium stores a computer program, and the computer program is used to cause a computer to execute the method according to any one of claims 1-8.