Service scheduling method and device, electronic equipment and storage medium

By deploying multiple microservices in the software system on the same process and using the service channel module for resource scheduling, the problem of resource waste and communication noise floor in a single microservice architecture in small-scale data scenarios is solved, and resource efficiency is achieved Improved utilization and communication efficiency.

CN119473525APending Publication Date: 2025-02-18ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311012163.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-10
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing software systems adopt a single microservice architecture, which is prone to waste of resources and communication noise between microservices when facing small-scale data scenarios.

Method used

By deploying multiple microservices in the first server to the same process and using the service channel module for resource scheduling, the second target microservice is determined to schedule its resources, so that the first target microservice can effectively use resources to complete target service processing.

Benefits of technology

It realizes the separation of microservice entities and external performance, reduces resource waste during service scheduling and communication noise floor between microservices, and is suitable for data scenarios of different scales.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473525A_ABST
    Figure CN119473525A_ABST
Patent Text Reader

Abstract

The invention relates to a service scheduling method and device, electronic equipment and a storage medium, and the method comprises the steps: receiving a target service request which is used for indicating the processing of a target business through employing a first target micro-service in a first server; according to the resource state of the first target micro-service, a second target micro-service is determined from the first server, the second target micro-service and the first target micro-service are deployed in the same process, and resource scheduling is carried out through a service channel module; and scheduling the resource of the second target micro-service, so that the first target micro-service completes the processing of the target service by using the resource of the second target micro-service. According to the method and the device, the plurality of micro-services are deployed in the same process of the first server, and resource scheduling of the plurality of micro-services in the same process is realized through the service channel module, so that separation of a micro-service entity and external performance is realized, and resource waste during service scheduling and communication background noise between the micro-services are reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a service scheduling method, device, electronic device and storage medium. Background Art

[0002] With the rise of microservices in the software field, more and more software systems are developed using microservices. With the enhancement of 5G networks and the rise of new fields, software systems will face the test of various data scenarios of different scales. However, current software systems usually adopt a single microservice architecture, and the microservice entities and external performance are basically aligned. When facing small-scale data scenarios, it is very easy to waste resources and increase the communication noise between microservices. Summary of the invention

[0003] In view of this, in order to solve the above-mentioned technical problems or part of the technical problems, the embodiments of the present application provide a service scheduling method, device, electronic device and storage medium.

[0004] In a first aspect, the present application provides a service scheduling method, which is applied to a first server, and the method includes:

[0005] Receive a target service request, where the target service request is used to instruct to process a target business using a first target microservice in the first server;

[0006] According to the resource status of the first target microservice, determine a second target microservice from the first server, wherein the second target microservice and the first target microservice are deployed in the same process and resources are scheduled through a service channel module;

[0007] The resources of the second target microservice are scheduled so that the first target microservice completes the processing of the target business by using the resources of the second target microservice.

[0008] In an optional implementation, determining the second target microservice from the first server according to the resource state of the first target microservice includes:

[0009] Determine the amount of resources used by the first target microservice;

[0010] If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, a second target microservice is determined from the first server.

[0011] In an optional implementation, if it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, determining the second target microservice from the first server includes:

[0012] If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, determine the target scheduling resources according to the resource amount corresponding to the target business and the used resource amount of the first target microservice;

[0013] The second target microservice is determined from the first server according to the target scheduling resources.

[0014] In an optional implementation, after determining the second target microservice from the first server according to the target scheduling resources, the method further includes:

[0015] If the second target microservice that meets the target scheduling resources cannot be determined from the first server, a third target microservice that meets the target scheduling resources is determined from the second server in the server cluster to schedule the resources of the third target microservice, so that the first target microservice uses the resources of the third target microservice to complete the processing of the target business, wherein the first target microservice and the third target microservice perform resource scheduling through a scheduling chain.

[0016] In an optional implementation, determining the second target microservice from the first server according to the target scheduling resources includes:

[0017] Determine a microservice that satisfies the target scheduling resources from the first server, wherein the microservice that satisfies the target scheduling resources and the first target microservice are in the same process;

[0018] Determine a scheduling interval time for the first target microservice to schedule a microservice that satisfies the target scheduling resources;

[0019] When the scheduling interval time is greater than a preset time threshold, a microservice that meets the target scheduling resources is determined as the second target microservice.

[0020] In an optional implementation, the scheduling of the resources of the second target microservice so that the first target microservice completes the processing of the target business by using the resources of the second target microservice includes:

[0021] Determine a preset elastic resource corresponding to the first target microservice, where the preset elastic resource corresponding to the first target microservice is less than a preset basic resource corresponding to the first target microservice;

[0022] When the target scheduling resources are less than or equal to the preset elastic resources corresponding to the first target microservice, the resources of the second target microservice are scheduled so that the first target microservice completes the processing of the target business by using the resources of the second target microservice.

[0023] In an optional implementation, the first target microservice corresponds to a preset basic resource and a preset elastic resource, and the preset elastic resource corresponding to the first target microservice is smaller than the preset basic resource corresponding to the first target microservice;

[0024] The sum of the preset basic resources corresponding to the first target microservice and the preset basic resources corresponding to the remaining microservices in the first server is less than or equal to the preset resources corresponding to the first server, the remaining microservices in the first server and the first target microservice are deployed in the same process of the first server, and the preset basic resources corresponding to the first target microservice are determined by the business processing capability and usage frequency of the first target microservice;

[0025] The preset elastic resource corresponding to the first target microservice is equal to the product of a preset ratio and a preset basic resource corresponding to the first target microservice, and the preset elastic resource corresponding to the first target microservice is used to indicate the maximum scheduling resource of the first target microservice when scheduling resources of the second target microservice in the same process as the first target microservice deployed on the first server.

[0026] In an optional implementation, the first target microservice and the second target microservice deployed in the same process of the first server belong to the same type of business or have business coupling, and the service channel module is provided in the first server to schedule resources of the first target microservice and the second target microservice deployed in the same process of the first server through the service channel module.

[0027] In an optional implementation, the first server is deployed in a server cluster, a second server is further deployed in the server cluster, and at least one microservice having a scheduling chain with the first target microservice is deployed in the second server.

[0028] In a second aspect, the present application provides a service scheduling device, including:

[0029] A receiving module, used to receive a target service request, where the target service request is used to instruct to process a target business using a first target microservice in a first server;

[0030] a determination module, configured to determine a second target microservice from the first server according to a resource state of the first target microservice, wherein the second target microservice and the first target microservice are deployed in the same process and resources are scheduled through a service channel module;

[0031] The scheduling module is used to schedule the resources of the second target microservice so that the first target microservice completes the processing of the target business by using the resources of the second target microservice.

[0032] In a third aspect, the present application provides an electronic device, comprising: a processor and a memory, wherein the processor is used to execute a service scheduling program stored in the memory to implement the service scheduling method as described above.

[0033] In a fourth aspect, the present application also provides a storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the service scheduling method as described above.

[0034] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art. The method provided by the embodiment of the present application includes: receiving a target service request, the target service request is used to indicate that the target business is processed by the first target microservice in the first server; according to the resource status of the first target microservice, determining the second target microservice from the first server, wherein the second target microservice is deployed in the same process as the first target microservice and resources are scheduled through the service channel module; scheduling the resources of the second target microservice so that the first target microservice completes the processing of the target business by using the resources of the second target microservice. In the above manner, the embodiment of the present application realizes the separation of microservice entities and external performance by deploying multiple microservices in the same process of the first server and realizing resource scheduling of multiple microservices in the same process through the service channel module, reducing resource waste during service scheduling and communication background noise between microservices. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.

[0036] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0037] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0038] Figure 1 A flow chart of a service scheduling method provided in an embodiment of the present application;

[0039] Figure 2 A flowchart of another service scheduling method provided in an embodiment of the present application;

[0040] Figure 3 A flowchart of another service scheduling method provided in an embodiment of the present application;

[0041] Figure 4 A schematic diagram of microservice resource scheduling for a multi-modal microservice architecture provided in an embodiment of the present application;

[0042] Figure 5 A schematic diagram of the structure of a service scheduling device provided in an embodiment of the present application;

[0043] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0044] In the above attached figure:

[0045] 10. Receiving module; 20. Determining module; 30. Scheduling module;

[0046] 600, electronic device; 601, processor; 602, memory; 6021, operating system; 6022, application; 603, user interface; 604, network interface; 605, bus system. DETAILED DESCRIPTION

[0047] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0048] The disclosure below provides many different embodiments or examples to implement different structures of the present invention. In order to simplify the disclosure of the present invention, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present invention. In addition, the present invention can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0049] refer to Figure 1 , Figure 1 A flow chart of a service scheduling method provided in an embodiment of the present application. A service scheduling method provided in an embodiment of the present application comprises the following steps:

[0050] S101: Receive a target service request, where the target service request is used to instruct to process a target business using a first target microservice in a first server.

[0051] In this embodiment, the execution subject is the first server, which is deployed in a server cluster. Servers other than the first server are also deployed in the server cluster. In this embodiment, all servers other than the first server in the server cluster are referred to as second servers. Multiple microservices belonging to the same process are deployed in the first server, and a service channel module is provided in the first server. Multiple microservices deployed in the same process in the first server belong to the same type of business, or there is business coupling between multiple microservices deployed in the same process in the first server. The resources of the first target microservice and the second target microservice deployed in the same process are scheduled through the service channel module to realize the scheduling of resources of different microservices in the first server, thereby realizing the separation of microservice entities and external performance. At least one microservice is also deployed in the second server, and a scheduling chain can be provided between at least one microservice in the second server and multiple microservices in the first server to realize the scheduling of microservice resources between different servers. It should be noted that the number of microservices deployed in the first server and the second server can be set according to actual needs, which will not be repeated in this embodiment. In addition, a scheduling chain is set between multiple microservices deployed in the same process in the first server, and the resources of the microservices with scheduling chain relationship in the same process are scheduled through the service channel module. Since the first server is provided with a service channel module and multiple microservices in the first server are deployed in the same process, and there is also a scheduling chain between the microservices in the first server and the microservices in the second server, based on the above, it is possible to realize the construction of a multi-form microservice architecture. For details, please refer to Figure 4As shown, it is possible to realize the scheduling of microservice resources within the same server and between different servers, where Figure 4 The dashed line in the middle represents the scheduling of microservice resources within the same server. Figure 4 The solid line in the middle is used to represent the scheduling of microservice resources between different servers.

[0052] In the above, the first server and the second server can be a physical server. Of course, the first server and the second server can also be virtual servers divided on a physical server. The specific forms of the first server and the second server can be set according to actual needs, and this embodiment does not specifically limit this. In this embodiment, the target service request carries a microservice identifier. When the first server receives the target service request, the corresponding relationship between the microservice identifier and the microservice can be queried according to the microservice identifier carried in the target service request, and the first target microservice corresponding to the microservice identifier in the first server can be obtained. When it is necessary to use the first target microservice in the first server to process the target business, in order to ensure that the processing of the target business can be completed, the resource status of the current first target microservice is determined, so as to determine the microservice that meets the processing requirements of the target business from the first server according to the resource status of the first target microservice, and dispatch the resources of the microservice to complete the processing of the target business. Among them, the resource status of the first target microservice is used to characterize whether the resources of the first target microservice complete the processing of the target business, and the resources of the first target microservice specifically refer to the remaining available virtual resources.

[0053] S102: Determine a second target microservice from the first server according to the resource status of the first target microservice, wherein the second target microservice and the first target microservice are deployed in the same process and resources are scheduled through a service channel module.

[0054] In this embodiment, when a target service request is received, the resource status of the first target microservice is determined. When it is determined that the resource status of the first target microservice is insufficient to complete the processing of the target business, the microservice resources need to be scheduled to complete the processing of the target business based on the scheduled resources. Since the service channel module is deployed in the first server, and multiple microservices with scheduling chains are deployed in the same process of the first server, the second target microservice that can perform resource scheduling can be determined from the same process based on the service channel module to complete the processing of the target business using the resources of the second target microservice.

[0055] S103: Scheduling resources of the second target microservice so that the first target microservice completes processing of the target business by using the resources of the second target microservice.

[0056] In this embodiment, after determining the second target microservice for which the first target microservice can schedule resources from the same process of the first server, the service channel module in the first server can be used to schedule the resources of the second target microservice, so that the first target microservice can use the resources of the second target microservice to process the target business, thereby completing the processing of the target business, reducing resource waste during service scheduling and communication noise between microservices. Among them, the resource amount of the second target microservice specifically refers to the available virtual resources.

[0057] A service scheduling method provided in this embodiment deploys multiple microservices in the same process of a first server, and implements resource scheduling of multiple microservices in the same process through a service channel module, thereby achieving separation of microservice entities and external presentations, reducing resource waste during service scheduling and communication noise between microservices.

[0058] refer to Figure 2 , Figure 2 A flow chart of another service scheduling method provided in an embodiment of the present application. A service scheduling method provided in an embodiment of the present application comprises the following steps:

[0059] S201: Receive a target service request, where the target service request is used to instruct to process a target business using a first target microservice in a first server.

[0060] In this embodiment, step S201 is consistent with step S101, and this embodiment will not be described in detail here. For details, please refer to the above description.

[0061] S202: Determine the amount of used resources of the first target microservice.

[0062] S203: Determine, according to the used resource amount of the first target microservice, whether the resources of the first target microservice meet the resource amount corresponding to the target business.

[0063] With respect to the above-mentioned steps S202 and S203, the amount of resources corresponding to the target business can be understood as the amount of resources required by the first target microservice to process the target business. After determining the amount of resources used by the first target microservice, the remaining available resources of the current first target microservice can be determined based on the preset basic resources corresponding to the first target microservice and the amount of resources used by the first target microservice. If the remaining available resources of the first target microservice can meet the amount of resources corresponding to the target business, the first target microservice can use its own remaining available resources to process the target business. If the remaining available resources of the first target microservice cannot meet the amount of resources corresponding to the target business, it is necessary to schedule the resources of the microservice in the same process as the first target microservice through the service channel module, and complete the processing of the target business according to the scheduled resources.

[0064] Among them, the first target microservice corresponds to a preset basic resource, and the preset basic resource corresponding to the first target microservice can be determined by the business processing capacity and usage frequency of the first target microservice. In addition, the sum of the preset basic resources corresponding to the first target microservice and the preset basic resources corresponding to the remaining microservices in the first server is less than or equal to the preset resources corresponding to the first server, and the remaining microservices in the first server are deployed in the same process of the first server with the first target microservice. For example, there are three microservices service1, service2 and service3 deployed in the same process of the first server, service1 is the first target microservice, and service2 and service3 are the remaining microservices in the first server. Then the preset basic resources corresponding to service1, the preset basic resources corresponding to service2, and the preset basic resources corresponding to service3 should be less than the preset resources corresponding to the first server. It should be noted that the preset resources corresponding to the first server can be set to 100%. For another example, for the three microservices service1, service2 and service3 deployed in the same process of the first server, service1 is a task transfer module of service2, which has little resource overhead compared with service2. Service2, as a service module that truly reflects business capabilities, requires greater resource overhead, and service3 mainly provides part of the capabilities of service2. Therefore, the relationship between the preset basic resources corresponding to service1, service2 and service3 can be set as: service2>service3>service1, that is, the preset basic resources corresponding to service1 can be set to 20%, the preset basic resources corresponding to service2 can be set to 50%, and the preset basic resources corresponding to service3 can be set to 30%. In addition, the preset basic resources corresponding to each microservice and the preset resources corresponding to the first server are all virtual resources.

[0065] S204: If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice meet the resource amount corresponding to the target business, the resources of the first target microservice are used to complete the processing of the target business.

[0066] In this embodiment, if it is determined based on the used resource amount of the first target microservice that the resources of the first target microservice meet the resource amount corresponding to the target business, it indicates that the remaining usable resources of the first target microservice can complete the processing of the target business. At this time, the first target microservice can directly use the remaining usable resources of the first target microservice to complete the processing of the target business.

[0067] S205: If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, a second target microservice is determined from the first server.

[0068] In this embodiment, if it is determined based on the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, it is characterized that the remaining available resources of the first target microservice can complete the processing of the target business. At this time, it is necessary to determine the required scheduling resources based on the remaining available resources of the first target microservice and the resource amount corresponding to the target business, so as to schedule the service according to the required scheduling resources.

[0069] Specifically, step S205 specifically includes:

[0070] If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, the target scheduling resources are determined according to the resource amount corresponding to the target business and the used resource amount of the first target microservice;

[0071] A second target microservice is determined from the first server according to the target scheduling resources.

[0072] In this embodiment, the resources of the first target microservice can be understood as the remaining available resources of the first target microservice. The target scheduling resources can be understood as the resources required for scheduling, which are determined by the remaining available resources of the first target microservice and the amount of resources corresponding to the target business. After determining the target scheduling resources, the remaining available resources of multiple microservices in the first server that are deployed in the same process as the first target microservice and have a scheduling chain can be determined, and a microservice greater than or equal to the target scheduling resources can be determined from the multiple remaining available resources, and the microservice greater than or equal to the target scheduling resources can be determined as the second target microservice.

[0073] In the above, determining the second target microservice from the first server according to the target scheduling resources includes:

[0074] Determine a microservice that meets the target scheduling resources from the first server, wherein the microservice that meets the target scheduling resources and the first target microservice are in the same process;

[0075] Determine the scheduling interval time of the first target microservice scheduling the microservice that meets the target scheduling resources;

[0076] When the scheduling interval time is greater than a preset time threshold, the microservice that meets the target scheduling resources is determined as the second target microservice.

[0077] In this embodiment, the preset time threshold can be set according to actual needs, and the specific value of the preset time threshold is not limited in this embodiment. Among them, the microservice that meets the target scheduling resource can be determined from the first server with reference to the above method, which is not repeated in this embodiment. When the scheduling interval time of the microservice that meets the target scheduling resource is greater than the preset time threshold, it indicates that the current service throughput is small, and the resource scheduling can be performed directly in the same process of the first server, and when the scheduling interval time of the microservice that meets the target scheduling resource is less than or equal to the preset time threshold, it indicates that the current service scheduling throughput is large, and the resource scheduling in the same process of the first server cannot be satisfied at this time, which will increase the throughput of the service scheduling. In order to avoid the above situation, when the scheduling interval time is less than or equal to the preset time threshold, the microservice resource scheduling is no longer performed in the first server, and the microservice architecture can be switched based on the server cluster, and the resource scheduling can be performed between the first server and the second server, wherein the resource scheduling between the first server and the second server is performed. The method of performing resource scheduling will be described as follows, and it will not be further described in this embodiment.

[0078] S206: Scheduling resources of the second target microservice so that the first target microservice completes processing of the target business by using the resources of the second target microservice.

[0079] In this embodiment, after determining the second target microservice for which the first target microservice can schedule resources from the same process of the first server, the service channel module in the first server can be used to schedule the resources of the second target microservice, so that the first target microservice can use the resources of the second target microservice to process the target business, thereby completing the processing of the target business, reducing resource waste during service scheduling and communication noise between microservices. Among them, the resource amount of the second target microservice specifically refers to the available virtual resources.

[0080] In the above, the first target microservice also corresponds to a preset elastic resource, and the preset elastic resource corresponding to the first target microservice is equal to the product of the preset ratio and the preset basic resource corresponding to the first target microservice. The preset elastic resource corresponding to the first target microservice is used to indicate the maximum scheduling resource of the first target microservice when scheduling resources for the second target microservice in the same process as the first target microservice deployed on the first server. By setting the preset elastic resource, the service channel module performs resource scheduling in the same process based on the preset elastic resource to avoid affecting the processing capacity of the microservice. The preset ratio can be set according to actual needs. In this embodiment, the specific value of the preset ratio is not limited. For details, please refer to the above description. For example, the preset ratio can be 50%. When the preset basic resource is 50%, the preset elastic resource can be 25%. Therefore, the maximum scheduling resource that can be scheduled by the first target microservice when scheduling resources in the same process is 25%. It should be noted that when each microservice in the same process has usage pressure (i.e., approaching their own preset basic resources), the preset elastic resource is invalid at this time. In other words, when performing resource scheduling at the same time, it is necessary to ensure that the sum of the used resources of each microservice is less than the preset resource corresponding to the first server.

[0081] In this embodiment, step S206 specifically includes:

[0082] Determine a preset elastic resource corresponding to the first target microservice, where the preset elastic resource corresponding to the first target microservice is less than a preset basic resource corresponding to the first target microservice;

[0083] When the target scheduling resources are less than or equal to the preset elastic resources corresponding to the first target microservice, the resources of the second target microservice are scheduled so that the first target microservice uses the resources of the second target microservice to complete the processing of the target business.

[0084] Among them, after determining the second target microservice, when the target scheduling resources are less than or equal to the preset elastic resources corresponding to the first target microservice, the remaining available resources of the second target microservice can be directly scheduled to process the target business. When the target scheduling resources are greater than the preset elastic resources corresponding to the first target microservice, the preset elastic resources can be scheduled from the remaining available resources of the second target microservice to process the target business, and the resource difference between the target scheduling resources and the preset elastic resources can be determined to determine the microservice that meets the resource difference from the second server in the server cluster according to the resource difference, and schedule the resources of the microservice to complete the processing of the target business. Among them, the method of performing resource scheduling between the first server and the second server will be explained as follows, and will not be further explained in this embodiment.

[0085] A service scheduling method provided in this embodiment deploys multiple microservices in the same process of a first server, and implements resource scheduling of multiple microservices in the same process through a service channel module, thereby separating microservice entities and external presentations, reducing resource waste during service scheduling and communication noise between microservices.

[0086] refer to Figure 3 , Figure 3 A flow chart of another service scheduling method provided in an embodiment of the present application. A service scheduling method provided in an embodiment of the present application comprises the following steps:

[0087] S301: Receive a target service request, where the target service request is used to instruct to process a target business using a first target microservice in a first server.

[0088] S302: Determine the amount of used resources of the first target microservice.

[0089] S303: Determine, according to the used resource amount of the first target microservice, whether the resources of the first target microservice meet the resource amount corresponding to the target business.

[0090] S304: If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice meet the resource amount corresponding to the target business, the resources of the first target microservice are used to complete the processing of the target business.

[0091] For the above-mentioned steps S301 to S304, details may refer to the above-mentioned steps S201 to S204, which will not be described in detail in this embodiment.

[0092] S305: If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, determine the target scheduling resources according to the resource amount corresponding to the target business and the used resource amount of the first target microservice.

[0093] S306: Determine, according to the target scheduling resources, whether a second target microservice that satisfies the target scheduling resources can be determined in the first server.

[0094] S307: If a second target microservice that meets the target scheduling resources can be determined from the first server according to the target scheduling resources, the resources of the second target microservice are scheduled so that the first target microservice uses the resources of the second target microservice to complete the processing of the target business.

[0095] For the above-mentioned steps S305 to S307, details may refer to the above-mentioned step S205, which will not be described in detail in this embodiment.

[0096] S308: If a second target microservice that meets the target scheduling resources cannot be determined from the first server according to the target scheduling resources, a third target microservice that meets the target scheduling resources is determined from the second server in the server cluster.

[0097] S309: Scheduling resources of the third target microservice so that the first target microservice completes processing of the target business by using the resources of the third target microservice.

[0098] For the above-mentioned steps S308 and S309, the second target microservice has a scheduling chain with the first target microservice. Since the first server and the second server are deployed in the server cluster and there is also a scheduling chain between the multiple microservices in the first server and the microservices in the second server, resource scheduling between the first server and the second server can be achieved. Therefore, when the second target microservice that meets the target scheduling resources cannot be determined from the first server, the microservice architecture can be switched to switch to resource scheduling between services, thereby meeting the processing requirements of the target business and realizing the application of different scale data scenarios.

[0099] Among them, when it is determined that the second target microservice that meets the target scheduling resources cannot be determined from the first server, a microservice that has a scheduling chain with the first target microservice can be determined from multiple microservices in the second server, and the remaining available resources of each microservice that has a scheduling chain with the first target microservice are determined, and a microservice greater than or equal to the target scheduling resources is determined from the multiple remaining available resources, and the microservice greater than or equal to the target scheduling resources is determined as the third target microservice. It should be noted that when it is necessary to determine a microservice that meets the resource difference from the second server based on the resource difference, after determining the remaining available resources of each microservice that has a scheduling chain with the first target microservice from the second server, a microservice greater than or equal to the resource difference is determined from the multiple remaining available resources, and the microservice greater than or equal to the resource difference is determined as the third target microservice.

[0100] A service scheduling method provided in this embodiment realizes separation of microservice entity and external performance by deploying multiple microservices in the same process of a first server and realizing resource scheduling of multiple microservices in the same process through a service channel module, thereby reducing resource waste during service scheduling and communication noise between microservices. In addition, a microservice having a scheduling chain of a first server and a second server is deployed in a server cluster to build a multi-modal microservice architecture. Therefore, when a first target microservice needs to schedule resources of a microservice in a second server, different microservice architectures are dynamically used to schedule the remaining resources of other microservices to complete the processing of corresponding business, thereby realizing adaptive adaptation to data scenarios of different scales and improving resource utilization.

[0101] refer to Figure 5 , Figure 5 A structural diagram of a service scheduling device provided in an embodiment of the present application. A service scheduling device provided in an embodiment of the present application includes: a receiving module 10, a determining module 20 and a scheduling module 30. Among them, the receiving module 10 is used to receive a target service request, and the target service request is used to indicate that the target business is processed using the first target microservice in the first server; the determining module 20 is used to determine the second target microservice from the first server according to the resource status of the first target microservice, wherein the second target microservice is deployed in the same process as the first target microservice and resources are scheduled through the service channel module; the scheduling module 30 is used to schedule the resources of the second target microservice so that the first target microservice completes the processing of the target business using the resources of the second target microservice.

[0102] In this embodiment, the determination module 20 is further configured to:

[0103] Determine the amount of resources used by the first target microservice;

[0104] If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, a second target microservice is determined from the first server.

[0105] In this embodiment, the determination module 20 is further configured to:

[0106] If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, determine the target scheduling resources according to the resource amount corresponding to the target business and the used resource amount of the first target microservice;

[0107] The second target microservice is determined from the first server according to the target scheduling resources.

[0108] In this embodiment, the determination module 20 is further configured to:

[0109] If the second target microservice that meets the target scheduling resources cannot be determined from the first server, a third target microservice that meets the target scheduling resources is determined from the second server in the server cluster to schedule the resources of the third target microservice, so that the first target microservice uses the resources of the third target microservice to complete the processing of the target business, wherein the first target microservice and the third target microservice perform resource scheduling through a scheduling chain.

[0110] In this embodiment, the determination module 20 is further configured to:

[0111] Determine a microservice that satisfies the target scheduling resources from the first server, wherein the microservice that satisfies the target scheduling resources and the first target microservice are in the same process;

[0112] Determine a scheduling interval time for the first target microservice to schedule a microservice that satisfies the target scheduling resources;

[0113] When the scheduling interval time is greater than a preset time threshold, a microservice that meets the target scheduling resources is determined as the second target microservice.

[0114] In this embodiment, the scheduling module 30 is further used for:

[0115] Determine a preset elastic resource corresponding to the first target microservice, where the preset elastic resource corresponding to the first target microservice is less than a preset basic resource corresponding to the first target microservice;

[0116] When the target scheduling resources are less than or equal to the preset elastic resources corresponding to the first target microservice, the resources of the second target microservice are scheduled so that the first target microservice completes the processing of the target business by using the resources of the second target microservice.

[0117] In this embodiment, the first target microservice corresponds to a preset basic resource and a preset elastic resource, and the preset elastic resource corresponding to the first target microservice is smaller than the preset basic resource corresponding to the first target microservice;

[0118] The sum of the preset basic resources corresponding to the first target microservice and the preset basic resources corresponding to the remaining microservices in the first server is less than or equal to the preset resources corresponding to the first server, the remaining microservices in the first server and the first target microservice are deployed in the same process of the first server, and the preset basic resources corresponding to the first target microservice are determined by the business processing capability and usage frequency of the first target microservice;

[0119] The preset elastic resource corresponding to the first target microservice is equal to the product of a preset ratio and a preset basic resource corresponding to the first target microservice, and the preset elastic resource corresponding to the first target microservice is used to indicate the maximum scheduling resource of the first target microservice when scheduling resources of the second target microservice in the same process as the first target microservice deployed on the first server.

[0120] In this embodiment, the first target microservice and the second target microservice deployed in the same process of the first server belong to the same type of business or have business coupling, and the first server is provided with the service channel module to schedule resources of the first target microservice and the second target microservice deployed in the same process of the first server through the service channel module.

[0121] In this embodiment, the first server is deployed in a server cluster, a second server is further deployed in the server cluster, and at least one microservice having a scheduling chain with the first target microservice is deployed in the second server.

[0122] A service scheduling device provided in this embodiment deploys multiple microservices in the same process of a first server, and implements resource scheduling of multiple microservices in the same process through a service channel module, thereby separating microservice entities and external presentations, reducing resource waste during service scheduling and communication noise between microservices.

[0123] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 The electronic device 600 shown includes: at least one processor 601, a memory 602, at least one network interface 604 and other user interfaces 603. The various components in the electronic device 600 are coupled together via a bus system 605. It is understood that the bus system 605 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 605 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 605 is not shown in FIG. Figure 6 Various buses are labeled as bus system 605 .

[0124] The user interface 603 may include a display, a keyboard, or a pointing device (eg, a mouse, a trackball, a touch pad, or a touch screen).

[0125] It can be understood that the memory 602 in the embodiment of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), and direct RAM bus random access memory (DRRAM). The memory 602 described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0126] In some implementations, the memory 602 stores the following elements, executable units or data structures, or a subset thereof, or an extended set thereof: an operating system 6021 and an application 6022 .

[0127] Among them, the operating system 6021 includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., which are used to implement various basic services and process hardware-based tasks. The application 5022 includes various application programs, such as a media player (Media Player), a browser (Browser), etc., which are used to implement various application services. The program for implementing the method of the embodiment of the present application can be included in the application 6022.

[0128] In an embodiment of the present application, by calling a program or instruction stored in the memory 602, specifically, a program or instruction stored in the application 6022, the processor 601 is used to execute the method steps provided by each method embodiment, for example, including: receiving a target service request, the target service request is used to indicate that the target business is processed using the first target microservice in the first server; according to the resource status of the first target microservice, determining the second target microservice from the first server, wherein the second target microservice and the first target microservice are deployed in the same process and resources are scheduled through the service channel module; scheduling the resources of the second target microservice so that the first target microservice uses the resources of the second target microservice to complete the processing of the target business.

[0129] The method disclosed in the above embodiment of the present application can be applied to the processor 601, or implemented by the processor 601. The processor 601 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 601. The above processor 601 can be a general processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to execute, or the hardware and software units in the decoding processor can be executed. The software unit can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 602, and the processor 601 reads the information in the memory 602 and completes the steps of the above method in combination with its hardware.

[0130] It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit may be implemented in one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPDevice, DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described in the present application, or a combination thereof.

[0131] For software implementation, the technology described herein can be implemented by a unit that performs the functions described herein. The software code can be stored in a memory and executed by a processor. The memory can be implemented in the processor or outside the processor.

[0132] The electronic device provided in this embodiment may be Figure 6 The electronic device shown in FIG. 1 may perform the following steps: Figure 1-3 All steps of the service scheduling method in the implementation Figure 1-3 For details, please refer to the technical effect of the service scheduling method shown in Figure 1-3 For the sake of brevity, the relevant description is not repeated here.

[0133] The embodiment of the present application also provides a storage medium (computer-readable storage medium). The storage medium here stores one or more programs. The storage medium may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a read-only memory, a flash memory, a hard disk or a solid-state drive; the memory may also include a combination of the above-mentioned types of memory.

[0134] When one or more programs in the storage medium can be executed by one or more processors, the service scheduling method executed on the service scheduling device side is implemented.

[0135] The processor is used to execute the service scheduling program stored in the memory to implement the following steps of the service scheduling method executed on the service scheduling device side: receiving a target service request, the target service request is used to indicate that a first target microservice in a first server is used to process a target business; according to a resource status of the first target microservice, a second target microservice is determined from the first server, wherein the second target microservice is deployed in the same process as the first target microservice and resources are scheduled through a service channel module; and resources of the second target microservice are scheduled so that the first target microservice completes the processing of the target business using the resources of the second target microservice.

[0136] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to the function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0137] It should be noted that the phrases "one implementation", "an embodiment", "an exemplary embodiment", "some embodiments", etc. mentioned in the specification indicate that the described embodiments may include certain features, structures or characteristics, but not every embodiment may include the certain features, structures or characteristics. In addition, such phrases do not necessarily refer to the same embodiment. In addition, when describing certain features, structures or characteristics in conjunction with an embodiment, it is within the knowledge of those skilled in the art to implement such features, structures or characteristics in conjunction with other embodiments, whether explicitly or not explicitly described.

[0138] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0139] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A service scheduling method, characterized in that: Applied to the first server, the method comprises: Receive a target service request, where the target service request is used to instruct to process a target business using a first target microservice in the first server; According to the resource status of the first target microservice, determine a second target microservice from the first server, wherein the second target microservice and the first target microservice are deployed in the same process and resources are scheduled through a service channel module; The resources of the second target microservice are scheduled so that the first target microservice completes the processing of the target business by using the resources of the second target microservice.

2. The method according to claim 1, characterized in that The determining, from the first server, a second target microservice according to a resource state of the first target microservice includes: Determine the amount of resources used by the first target microservice; If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, a second target microservice is determined from the first server.

3. The method according to claim 2, characterized in that If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, determining a second target microservice from the first server includes: If it is determined according to the used resource amount of the first target microservice that the resources of the first target microservice do not meet the resource amount corresponding to the target business, determine the target scheduling resources according to the resource amount corresponding to the target business and the used resource amount of the first target microservice; The second target microservice is determined from the first server according to the target scheduling resources.

4. The method according to claim 3, characterized in that After determining the second target microservice from the first server according to the target scheduling resources, the method further includes: If the second target microservice that meets the target scheduling resources cannot be determined from the first server, a third target microservice that meets the target scheduling resources is determined from the second server in the server cluster to schedule the resources of the third target microservice, so that the first target microservice uses the resources of the third target microservice to complete the processing of the target business, wherein the first target microservice and the third target microservice perform resource scheduling through a scheduling chain.

5. The method according to claim 3, characterized in that: The determining the second target microservice from the first server according to the target scheduling resources includes: Determine a microservice that satisfies the target scheduling resources from the first server, wherein the microservice that satisfies the target scheduling resources and the first target microservice are in the same process; Determine a scheduling interval time for the first target microservice to schedule a microservice that satisfies the target scheduling resources; When the scheduling interval time is greater than a preset time threshold, a microservice that meets the target scheduling resources is determined as the second target microservice.

6. The method according to claim 3, characterized in that The scheduling of the resources of the second target microservice so that the first target microservice completes the processing of the target business by using the resources of the second target microservice includes: Determine a preset elastic resource corresponding to the first target microservice, where the preset elastic resource corresponding to the first target microservice is less than a preset basic resource corresponding to the first target microservice; When the target scheduling resources are less than or equal to the preset elastic resources corresponding to the first target microservice, the resources of the second target microservice are scheduled so that the first target microservice completes the processing of the target business by using the resources of the second target microservice.

7. The method according to claim 1, characterized in that The first target microservice corresponds to a preset basic resource and a preset elastic resource, and the preset elastic resource corresponding to the first target microservice is smaller than the preset basic resource corresponding to the first target microservice; The sum of the preset basic resources corresponding to the first target microservice and the preset basic resources corresponding to the remaining microservices in the first server is less than or equal to the preset resources corresponding to the first server, the remaining microservices in the first server and the first target microservice are deployed in the same process of the first server, and the preset basic resources corresponding to the first target microservice are determined by the business processing capability and usage frequency of the first target microservice; The preset elastic resource corresponding to the first target microservice is equal to the product of a preset ratio and a preset basic resource corresponding to the first target microservice, and the preset elastic resource corresponding to the first target microservice is used to indicate the maximum scheduling resource of the first target microservice when scheduling resources of the second target microservice in the same process as the first target microservice deployed on the first server.

8. The method according to claim 1, characterized in that The first target microservice and the second target microservice deployed in the same process of the first server belong to the same type of business or have business coupling, and the first server is provided with the service channel module to schedule resources of the first target microservice and the second target microservice deployed in the same process of the first server through the service channel module.

9. The method according to claim 8, characterized in that The first server is deployed in a server cluster, a second server is further deployed in the server cluster, and at least one microservice having a scheduling chain with the first target microservice is deployed in the second server.

10. A service scheduling device, characterized in that: include: A receiving module, used to receive a target service request, where the target service request is used to instruct to process a target business using a first target microservice in a first server; a determination module, configured to determine a second target microservice from the first server according to a resource state of the first target microservice, wherein the second target microservice and the first target microservice are deployed in the same process and resources are scheduled through a service channel module; The scheduling module is used to schedule the resources of the second target microservice so that the first target microservice completes the processing of the target business by using the resources of the second target microservice.

11. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to execute a service scheduling program stored in the memory to implement the service scheduling method according to any one of claims 1 to 9.

12. A storage medium, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the service scheduling method according to any one of claims 1 to 9.