A micro-service scheduling method, device and equipment and storage medium
By deploying controllers on target computing nodes, determining the categories and service values of microservices, and optimizing microservice scheduling, the problem of low cluster efficiency caused by unreasonable resource usage is solved, and efficient and stable service cluster operation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-26
- Publication Date
- 2026-03-03
AI Technical Summary
In microservice scheduling, unreasonable resource usage settings can affect the overall cluster's resource utilization and service stability, which is detrimental to the overall operation of the service cluster.
By selecting target compute nodes to deploy the target controller, the category, first service value, and second service value of microservices are determined, and microservices are scheduled to the corresponding compute nodes based on these parameters, thereby optimizing resource utilization.
The scheduling results of microservices have been optimized to ensure the efficient operation and stability of the service cluster and reduce operation and maintenance costs.
Smart Images

Figure CN116647599B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of service scheduling technology, specifically to a microservice scheduling method, apparatus, device, and storage medium. Background Technology
[0002] In the cloud-native environment of microservice scheduling technology, a service cluster may contain thousands of microservices. Therefore, it is necessary to manage and store the call relationships of each microservice. During service deployment, operations and maintenance personnel will schedule each microservice according to the estimated resource usage of different microservices.
[0003] However, resource usage can change. If the service values of each microservice, such as CPU and memory values, are not set reasonably, it will affect the overall resource utilization of the cluster and be detrimental to the overall operation of the service cluster. Summary of the Invention
[0004] In view of this, this application provides a microservice scheduling method, apparatus, device, and storage medium to address the issue that resource usage may change, and unreasonable settings of service values for each microservice, such as CPU and memory values, can affect the overall resource utilization of the cluster and hinder its overall operation.
[0005] To achieve the above objectives, the following solution is proposed:
[0006] Firstly, a microservice scheduling method includes:
[0007] In response to a request instruction to schedule various microservices in the service cluster, a target computing node is selected from various computing nodes in the service cluster;
[0008] The pre-acquired target controller is deployed on the target computing node to obtain an independent computing node;
[0009] Each of the microservices is sent to the independent computing node so that the independent computing node can determine the category, first service value, and second service value of each microservice.
[0010] Based on the category, first service value, and second service value of each microservice, each microservice is sent to each computing node other than the independent computing node to complete the scheduling process of each microservice.
[0011] Preferably, the process by which the independent computing node determines the category of each microservice includes:
[0012] Determine the call information between every two microservices and combine them into a call information set;
[0013] The dimensionality of the call information set is reduced to obtain a two-dimensional dataset corresponding to the call relationship set;
[0014] The two-dimensional dataset is clustered to obtain the categories of each microservice.
[0015] Preferably, the process by which the independent computing node determines the first service value of each microservice includes:
[0016] For each microservice, obtain the corresponding processor values for that microservice within a first preset time period;
[0017] The average value of each processor is taken as the minimum processor value corresponding to the microservice.
[0018] The minimum value of the processor is used as the first service value of the microservice.
[0019] Preferably, the process by which the independent computing node determines the second service value of each microservice includes:
[0020] For each microservice, obtain the memory values corresponding to that microservice within the first preset time period;
[0021] The average of all the memory values is taken as the minimum memory value corresponding to the microservice.
[0022] The minimum memory value is used as the second service value of the microservice.
[0023] Preferably, the step of sending each microservice to each computing node other than the independent computing node based on the category, first service value, and second service value of each microservice includes:
[0024] For each category, the microservices belonging to the same category are designated as the corresponding software parent services.
[0025] The individual software families and services corresponding to this category are grouped into microservice groups corresponding to this category;
[0026] Based on the first and second service values of each soft affinity and service in the microservice group, the response node corresponding to the microservice group is determined from each computing node other than the independent computing node.
[0027] Send the microservice group to the response node.
[0028] Preferably, determining the call information between every two microservices and combining them into a call information set includes:
[0029] For each microservice, determine whether there is a first service corresponding to that microservice in the independent computing node;
[0030] If a first service corresponding to the microservice exists in the independent computing node, then the first call information of the first service is obtained;
[0031] Based on the first call information, the mutual call relationships between this microservice and other microservices are determined;
[0032] The call information set is obtained by integrating the mutual call relationships between each microservice and other microservices.
[0033] Preferably, the target controller is a MutatingAdmission webhooks admission controller.
[0034] Secondly, a microservice scheduling device includes:
[0035] The target computing node selection module is used to select a target computing node from the computing nodes in the service cluster in response to a request instruction to schedule various microservices in the service cluster.
[0036] The deployment module is used to deploy the pre-acquired target controller to the target computing node to obtain an independent computing node;
[0037] The parameter determination module is used to send each of the microservices to the independent computing node so that the independent computing node can determine the category, first service value and second service value of each microservice.
[0038] The sending module is used to send each microservice to each computing node other than the independent computing node based on the category, first service value and second service value of each microservice, so as to complete the scheduling process of each microservice.
[0039] Thirdly, a microservice scheduling device, including memory and processor;
[0040] The memory is used to store programs;
[0041] The processor is used to execute the program to implement the various steps of the microservice scheduling method as described in the first aspect.
[0042] Fourthly, a storage medium storing a computer program that, when executed by a processor, implements the steps of the microservice scheduling method as described in the first aspect.
[0043] As can be seen from the above technical solution, this application, in response to a request instruction to schedule various microservices in a service cluster, selects a target computing node from among the computing nodes in the service cluster; deploys a pre-obtained target controller on the target computing node to obtain an independent computing node; sends each of the microservices to the independent computing node so that the independent computing node can determine the category, first service value, and second service value of each microservice; and, based on the category, first service value, and second service value of each microservice, sends each microservice to various computing nodes other than the independent computing node to complete the scheduling process of each microservice. This solution deploys the target controller on the target computing node to obtain an independent computing node, and then sends all microservices to this independent computing node to obtain parameters for each microservice, including category, first service value, and second service value. Then, it schedules each microservice based on these parameters, which can optimize the scheduling results and ensure the efficient operation of the service cluster. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0045] Figure 1 An optional flowchart of a microservice scheduling method provided in an embodiment of this application;
[0046] Figures 2-5 Code logic diagrams provided for embodiments of this application;
[0047] Figure 6 A schematic diagram of the structure of a microservice scheduling device provided in an embodiment of this application;
[0048] Figure 7 This is a schematic diagram of the structure of a microservice scheduling device provided in an embodiment of this application. Detailed Implementation
[0049] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0050] In the cloud-native environment of microservice scheduling technology, a service cluster may contain thousands of microservices. Therefore, it is necessary to manage and store the call relationships of each microservice. During service deployment, operations and maintenance personnel will schedule each microservice according to the estimated resource usage of different microservices.
[0051] However, resource usage can change. If the service values of each microservice, such as CPU and memory values, are not set reasonably, for example, if the CPU and memory values are set too high, it will affect the overall resource utilization of the cluster. If they are set too low, it will affect service stability and be detrimental to the overall operation of the service cluster.
[0052] To address the aforementioned shortcomings, this invention provides a microservice scheduling method. This method can be applied to various computer terminals or smart terminals, and its execution entity can be the processor or server of the computer terminal or smart terminal. The method flowchart is shown below. Figure 1 As shown, it specifically includes:
[0053] S1: In response to a request instruction to schedule various microservices in the service cluster, select a target computing node from the various computing nodes in the service cluster.
[0054] Specifically, the Kubernetes cluster can be used as the service cluster in this application. This service cluster contains multiple compute nodes, which can be understood as servers, and each compute node is an independent server. Each compute node contains multiple microservices. When each microservice needs to be updated, in response to the request instruction to schedule each microservice in the service cluster, a compute node is selected from the compute nodes in the service cluster as the target compute node.
[0055] The selection method can be random selection or selection based on the characteristics of the service cluster; this embodiment does not impose any restrictions on this.
[0056] S2: Deploy the pre-acquired target controller on the target computing node to obtain an independent computing node.
[0057] To avoid impacting online services, a pre-selected target controller can be deployed on the target computing node to obtain an independent computing node. The target controller can be deployed in a containerized manner on the target computing node.
[0058] S3: Send each of the microservices to the independent computing node so that the independent computing node can determine the category, first service value and second service value of each microservice.
[0059] Optionally, before sending each microservice to the independent compute node, the `majorization` tag of each microservice is obtained. It is then determined whether the `majorization` tag is false or true. This is because the `majorization` tag is pre-set to indicate whether each microservice needs adaptive optimization. For each microservice, if its `majorization` tag is false, it does not need to be sent to the independent compute node; if its `majorization` tag is true, it needs to be sent to the independent compute node.
[0060] Once the microservices that need adaptive optimization are identified, each microservice is sent to an independent compute node so that the independent compute node can determine the category, first service value, and second service value of each microservice.
[0061] S4: Based on the category, first service value, and second service value of each microservice, send each microservice to each computing node other than the independent computing node to complete the scheduling process of each microservice.
[0062] Based on the categories, first service values, and second service values of each microservice, we can determine how to schedule each microservice, thereby reducing the operational costs of the service cluster. Optionally, this step can be implemented using kube-apiserver (a microservice response component).
[0063] The process by which an independent computing node determines the category of each microservice in the method provided in this embodiment of the invention is described in detail below:
[0064] S31: Determine the call information between every two microservices and combine them into a call information set.
[0065] Specifically, this step may include:
[0066] For each microservice, determine whether there is a first service corresponding to the microservice in the independent computing node; if there is a first service corresponding to the microservice in the independent computing node, obtain the first call information of the first service; based on the first call information, determine the mutual call relationship between the microservice and other microservices; integrate the mutual call relationship between each microservice and other microservices to obtain the call information set.
[0067] The first service can be understood as a service of the same type as the microservice. If a first service of the same type as the microservice exists in an independent compute node, the ISITO DataStore microservice governance capabilities can be used to extract trace and span data from the ISITO component dapper to obtain the first call information of the first service. Then, based on the first call information, the mutual call relationship between this microservice and other microservices can be determined. If there is a call relationship between microservice A and microservice B, the call information between microservice A and microservice B is represented as 1; if there is no call relationship between microservice A and microservice B, the call information between microservice A and microservice B is represented as 0. In addition, the call information between a microservice itself is 1. In an example, there are four microservices A, B, C, and D. The set of call information between these four microservices can be shown in Table 1 below:
[0068] Table 1
[0069] Serve A B C D A 1 0 1 0 B 1 1 0 1 C 0 1 1 0 D 1 0 0 1
[0070] S32: Reduce the dimensionality of the call information set to obtain a two-dimensional dataset corresponding to the call relationship set.
[0071] In this step, the call information set in Table 1 above is used to perform PAC dimensionality reduction, thereby obtaining a two-dimensional dataset corresponding to the call information set, as shown in Table 2 below:
[0072] Table 2
[0073] A B C D X Xa Xb Cx Dx Y Ya Yb Cy Dy
[0074] S33: Cluster the two-dimensional dataset to obtain the categories of each of the microservices.
[0075] Specifically, using the two-dimensional dataset in Table 2 above, adaptive clustering of this two-dimensional dataset through DBSCAN clustering can yield the categories of each microservice, as shown in Table 3 below:
[0076] Table 3
[0077] A B C D category Label1 Label2 Label2 Label1
[0078] As shown in Table 3 above, microservices A and D are classified in the same category, Label1; microservices B and C are classified in the same category, Label2.
[0079] The above embodiments illustrate the process by which the independent computing node in this application determines the category of each microservice. The process by which the independent computing node in this application determines the first service value and the second service value of each microservice will be described in detail below.
[0080] First service value: For each microservice, obtain the processor values corresponding to the microservice within a first preset time period; take the average of the processor values as the minimum processor value corresponding to the microservice; take the minimum processor value as the first service value of the microservice.
[0081] Second service value: For each microservice, obtain the memory values corresponding to the microservice within a first preset time period; take the average of the memory values as the minimum memory value corresponding to the microservice; take the minimum memory value as the second service value of the microservice.
[0082] Optionally, the target controller can obtain the CPU and memory values for each processor within a first preset time period using Prometheus. This first preset time period can be 7 days, meaning the CPU and memory values for each of those 7 days represent the CPU and memory values for each day within those 7 days. After calculating their averages, these averages are used as the minimum value for the microservice, i.e., the requests value, thereby optimizing resource utilization.
[0083] The process of sending each microservice to each computing node other than the independent computing node based on the category, first service value and second service value of each microservice in this application will be described in detail below.
[0084] For each category, each microservice of the same category is designated as a software parent and service corresponding to that category; each software parent and service corresponding to that category is grouped into a microservice group corresponding to that category; based on the first and second service values of each software parent and service in the microservice group, the response node corresponding to the microservice group is determined from each computing node other than the independent computing node; the microservice group is sent to the response node.
[0085] Specifically, to improve the efficiency of inter-service communication, operations personnel can set affinity for microservices with high call relationships or belonging to the same category. Setting affinity between microservices is more complex than setting resource affinity. When microservices are deployed, operations personnel set corresponding pod affinity (soft or hard), pod anti-affinity (soft or hard), node affinity (soft or hard), and node anti-affinity (soft or hard) based on the call relationships between microservices. The call relationships of compute nodes generally do not change, but the scheduling relationships of microservices become more complex as the number of microservices increases.
[0086] Optionally, the Kubernetes apiserver includes two special admission controllers: MutatingAdmission webhooks and ValidatingAdmission. These controllers can send admission requests to external HTTP callback services and return the processing results to the kube-apiserver for updating and scheduling microservices. In this application, the target controller can be the MutatingAdmission webhooks admission controller, which can intercept requests for updating or scheduling microservices. Furthermore, it is necessary to ensure that the MutatingAdmission webhooks admission controller is enabled in the apiserver configuration file to guarantee its proper functioning. The logical code diagram for this process is shown below. Figure 2 As shown in the diagram. During this process, the logic code of the MutatingAdmission webhooks admission controller can be packaged into a Docker image and run using a Deployment. The logic code diagram of the MutatingAdmission webhooks admission controller can be shown as follows: Figure 3 As shown in the diagram. Next, the process of containerizing and deploying the MutatingAdmission webhooks admission controller on a service cluster, such as a Kubernetes cluster, can be implemented using Deployment + Service. The logic code diagram for this process is shown below. Figure 4 As shown.
[0087] After containerizing and deploying the MutatingAdmission webhooks admission controller on a Kubernetes cluster, it's not yet integrated with mutate webhooks. Therefore, we need to register the service we implemented above with mutate webhooks. This process only requires creating a Kubernetes resource object of type mutate webhookConfiguration. Within this object, we can configure the webhook service and name the webhook...
[0088] The webhook should be named `io.ydzs.admission-registry`, and this name must be unique within the cluster. The `rules` property specifies the conditions under which the webhook should be used; it should only be invoked when the Pod is created. Furthermore, the `ClientConfig` property specifies how the Kubernetes APIServer finds the webhook service. This can be done through a Service named `admission-registry` in the `default` namespace, located at the ` / validate` path. A `caBundle` property is also specified, which uses a PEM-formatted CA bundle to indicate that the APIServer, as a client, can use it to verify the server certificate on the webhook application. The corresponding resource list for registering the webhook is as follows: Figure 5 As shown.
[0089] and Figure 1 Corresponding to the method described above, this embodiment of the invention also provides a microservice scheduling device for scheduling microservices. Figure 1 In the specific implementation of the method, the microservice scheduling device provided in this embodiment of the invention can be used in computer terminals or various mobile devices, combined with Figure 6 The document introduces the scheduling mechanism for microservices, such as... Figure 6 As shown, the device may include:
[0090] The target computing node selection module 10 is used to select a target computing node from the computing nodes of the service cluster in response to a request instruction to schedule each microservice in the service cluster.
[0091] Deployment module 20 is used to deploy the pre-acquired target controller to the target computing node to obtain an independent computing node;
[0092] The parameter determination module 30 is used to send each of the microservices to the independent computing node so that the independent computing node can determine the category, first service value and second service value of each microservice.
[0093] The sending module 40 is used to send each microservice to each computing node other than the independent computing node based on the category, first service value and second service value of each microservice, so as to complete the scheduling process of each microservice.
[0094] As can be seen from the above technical solution, this application, in response to a request instruction to schedule various microservices in a service cluster, selects a target computing node from among the computing nodes in the service cluster; deploys a pre-obtained target controller on the target computing node to obtain an independent computing node; sends each of the microservices to the independent computing node so that the independent computing node can determine the category, first service value, and second service value of each microservice; and, based on the category, first service value, and second service value of each microservice, sends each microservice to various computing nodes other than the independent computing node to complete the scheduling process of each microservice. This solution deploys the target controller on the target computing node to obtain an independent computing node, and then sends all microservices to this independent computing node to obtain parameters for each microservice, including category, first service value, and second service value. Then, it schedules each microservice based on these parameters, which can optimize the scheduling results and ensure the efficient operation of the service cluster.
[0095] In one example, the parameter determination module 30 may include:
[0096] The combination module is used to determine the call information between every two microservices and combine them into a call information set;
[0097] The dimensionality reduction module is used to reduce the dimensionality of the call information set to obtain a two-dimensional dataset corresponding to the call relationship set;
[0098] The clustering module is used to cluster the two-dimensional dataset to obtain the categories of each of the microservices.
[0099] In one example, the parameter determination module 30 may include:
[0100] The first acquisition module is used to acquire the processor values corresponding to each microservice within a first preset time period for each microservice.
[0101] The first mean calculation module is used to take the mean of each processor value as the minimum processor value corresponding to the microservice.
[0102] The first assignment module is used to take the minimum value of the processor as the first service value of the microservice.
[0103] In one example, the parameter determination module 30 may further include:
[0104] The second acquisition module is used to acquire the memory values corresponding to each microservice within a first preset time period for each microservice.
[0105] The second mean calculation module is used to take the mean of each memory value as the minimum memory value corresponding to the microservice.
[0106] The second assignment module is used to take the minimum memory value as the second service value of the microservice.
[0107] In one example, the sending module 40 may include:
[0108] The microservice group module is used to group the various software relatives and services corresponding to this category into a microservice group corresponding to this category;
[0109] The response node determination module is used to determine the response node corresponding to the microservice group from each computing node other than the independent computing node, based on the first service value and the second service value of each soft affinity and service in the microservice group.
[0110] The microservice group sending module is used to send the microservice group to the response node.
[0111] In one example, the combined module may include:
[0112] The judgment module is used to determine, for each microservice, whether there is a first service corresponding to that microservice in the independent computing node;
[0113] The first call information acquisition module is used to acquire the first call information of the first service if there is a first service corresponding to the microservice in the independent computing node;
[0114] The mutual call relationship determination module is used to determine the mutual call relationship between the microservice and other microservices based on the first call information.
[0115] The integration module is used to integrate the mutual calling relationships between each microservice and other microservices to obtain the calling information set.
[0116] Furthermore, embodiments of this application provide a microservice scheduling device. Optionally, Figure 7 The hardware structure block diagram of the microservice scheduling device is shown, with reference to... Figure 7 The hardware structure of the microservice scheduling device may include: at least one processor 01, at least one communication interface 02, at least one memory 03, and at least one communication bus 04.
[0117] In this embodiment, the number of processor 01, communication interface 02, memory 03 and communication bus 04 is at least one, and processor 01, communication interface 02 and memory 03 communicate with each other through communication bus 04.
[0118] Processor 01 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
[0119] Memory 03 may include high-speed RAM, and may also include non-volatile memory, such as at least one disk storage device.
[0120] The memory stores programs, which the processor can call. These programs are used to execute the scheduling methods for the following microservices:
[0121] In response to a request instruction to schedule various microservices in the service cluster, a target computing node is selected from various computing nodes in the service cluster;
[0122] The pre-acquired target controller is deployed on the target computing node to obtain an independent computing node;
[0123] Each of the microservices is sent to the independent computing node so that the independent computing node can determine the category, first service value, and second service value of each microservice.
[0124] Based on the category, first service value, and second service value of each microservice, each microservice is sent to each computing node other than the independent computing node to complete the scheduling process of each microservice.
[0125] Optionally, the refined and extended functions of the program can be found in the description of the microservice scheduling method in the method embodiment.
[0126] This application embodiment also provides a storage medium that can store a program suitable for processor execution, wherein when the program runs, it controls the device where the storage medium resides to execute the following microservice scheduling method, including:
[0127] In response to a request instruction to schedule various microservices in the service cluster, a target computing node is selected from various computing nodes in the service cluster;
[0128] The pre-acquired target controller is deployed on the target computing node to obtain an independent computing node;
[0129] Each of the microservices is sent to the independent computing node so that the independent computing node can determine the category, first service value, and second service value of each microservice.
[0130] Based on the category, first service value, and second service value of each microservice, each microservice is sent to each computing node other than the independent computing node to complete the scheduling process of each microservice.
[0131] Specifically, the storage medium can be a computer-readable storage medium, which can be an electronic storage device such as flash memory, EEPROM (Electrically Erasable Programmable Read-Only Memory), EPROM, hard disk, or ROM.
[0132] Optionally, the refined and extended functions of the program can be found in the description of the microservice scheduling method in the method embodiment.
[0133] Furthermore, the functional modules in the various embodiments of this disclosure can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part. If the function is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a live streaming device, or a network device, etc.) to execute all or part of the steps of the methods in the various embodiments of this disclosure.
[0134] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0135] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0136] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A microservice scheduling method, characterized in that, The method comprises: selecting a target computing node from each computing node in the service cluster in response to a request instruction for scheduling each microservice in the service cluster; deploying a target controller obtained in advance on the target computing node to obtain an independent computing node; The method comprises: The target controller is a MutatingAdmission webhook admission controller, the target controller is intercepted through the target controller to schedule a request instruction for a microservice, the target controller is enabled in an apiserver configuration file, the logic code of the target controller is packaged into a Docker image, and a Deployment is used to run, and then the target controller is containerized and deployed in a service cluster, and the microservice is registered in the mutate Webhook, wherein a Kubernetes resource object of a type of mutateWebhookConfiguration is created, the Webhook service is configured in the Kubernetes resource object, the Webhook is uniquely named, the conditions for using the configured Webhook are specified under the rules attribute, the Webhook is called when a Pod is created, and the way for the Kubernetes APIServer to find the Webhook service is specified under the ClientConfig attribute, and the Service service under the default namespace is used to provide services under the / validate path; each microservice is sent to the independent computing node to determine the category, the first service value and the second service value of each microservice; 2. The method of claim 1, wherein, based on the category, the first service value and the second service value of each microservice, each microservice is sent to each computing node except the independent computing node to complete the scheduling process of each microservice. The process of determining the category of each microservice by the independent computing node comprises: determining the call information between each two microservices and combining the call information into a call information set; dimension reduction is performed on the call information set to obtain a two-dimensional data set corresponding to the call information set; 3. The method of claim 1, wherein, the two-dimensional data set is clustered to obtain the category of each microservice. The process of determining the first service value of each microservice by the independent computing node comprises: for each microservice, obtaining each processor value corresponding to the microservice in a first preset time period; the mean value of each processor value is taken as the processor minimum value corresponding to the microservice; 4. The method of claim 1, wherein, the processor minimum value is taken as the first service value of the microservice. The process of determining the second service value of each microservice by the independent computing node comprises: for each microservice, obtaining each memory value corresponding to the microservice in a first preset time period; the mean value of each memory value is taken as the memory minimum value corresponding to the microservice; the memory minimum value is taken as the second service value of the microservice.
5. The method of claim 1, wherein, The sending of each microservice to each computing node other than the independent computing node based on the category, the first service value and the second service value of each microservice comprises: For each category, each microservice of the same category is taken as a soft affinity service corresponding to the category; Each soft affinity service corresponding to the category is combined into a microservice group corresponding to the category; The first service value and the second service value of each soft affinity service in the microservice group are used to determine a responding node corresponding to the microservice group from each computing node other than the independent computing node; The microservice group is sent to the responding node.
6. The method of claim 2, wherein, The determination of the calling information between each two microservices and the combination into a calling information set comprises: For each microservice, it is determined whether there is a first service corresponding to the microservice in the independent computing node; If there is a first service corresponding to the microservice in the independent computing node, the first calling information of the first service is obtained; Based on the first calling information, the mutual calling relationship between the microservice and other microservices is determined; The mutual calling relationship between each microservice and other microservices is integrated to obtain the calling information set.
7. A microservice scheduling apparatus, characterized by comprising: Comprise: A target computing node selection module is configured to select a target computing node from each computing node in a service cluster in response to a request instruction for scheduling each microservice in the service cluster; A deployment module is configured to deploy a target controller obtained in advance in the target computing node to obtain an independent computing node; Comprise: the target controller is a MutatingAdmission webhooks admission controller, the request instruction for scheduling the microservice is intercepted through the target controller, the target controller is enabled in an apiserver configuration file, the logic code of the target controller is packaged into a Docker image, and a Deployment is used to run, then the target controller is containerized and deployed in a service cluster, the microservice is registered in a mutate Webhook, wherein a Kubernetes resource object of a mutate WebhookConfiguration type is created, a Webhook service is configured in the Kubernetes resource object, and the Webhook is uniquely named, the condition of using the configured Webhook is specified under the rules attribute, the Webhook is called when a Pod is created; meanwhile, the way for the KubernetesAPIServer to find the Webhook service is specified under the ClientConfig attribute, a Service service named admission-registry in the default namespace provides services under the / validate path; A parameter determining module is configured to send each microservice to the independent computing node, so that the independent computing node determines the category, the first service value and the second service value of each microservice; A sending module is configured to send each microservice to each computing node other than the independent computing node based on the category, the first service value and the second service value of each microservice, so as to complete the scheduling process of each microservice. 8.A scheduling device of microservices, characterized in that, comprising a memory and a processor; The memory is configured to store a program; The processor is configured to execute the program, and realize each step of the microservice scheduling method according to any one of claims 1-6.
9. A storage medium having stored thereon a computer program, characterized in that The computer program, when executed by the processor, realizes each step of the microservice scheduling method according to any one of claims 1-6. The computer program, when executed by the processor, realizes each step of the microservice scheduling method according to any one of claims 1-6.
Citation Information
Patent Citations
Micro-service operation and maintenance management system and method
CN112148306A
Method and system for scheduling computing power network resources
CN115914392A