Component scheduling method, device, computing device and storage medium
By scheduling components based on slack in the microservice architecture, the response time extension caused by component scheduling is solved, and the effect of reducing resource costs and ensuring user experience is achieved.
Patent Information
- Application Number
- CN202310924151.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2043-07-25
AI Technical Summary
In microservice architecture, component scheduling is usually based on the amount of communication data, resulting in scheduling to long-distance computing nodes, increasing call time delay, thereby affecting service response time and user experience.
By obtaining request tracking data, the slack of each component is determined, that is, the maximum delay call time length without increasing the response time, and the components are scheduled based on the slack, reducing deployment costs and ensuring response time.
This method can reduce the resource cost and deployment cost of components, while avoiding the extended response time after scheduling, and ensuring the user's experience of using the service.
Smart Images

Figure CN117194063B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a component scheduling method, apparatus, computing device, and storage medium. Background Art
[0002] With the continuous development of cloud technology, the software architecture of cloud systems is usually a microservice architecture that connects multiple components through remote procedure calls (RPC) to form a service operation logic. In the microservice architecture, in order to complete the user's service request, it is necessary to respond to the service request sent by the user and call multiple components to implement the corresponding service functions. Among them, multiple components can be supported by network communication capabilities and independently deployed on the same or different computing nodes. Considering the load capacity of the computing node for the deployment cost of the component, it is usually necessary to schedule some deployed components between multiple computing nodes.
[0003] In the related art, the components that have been deployed and have a small amount of communication data with other components are usually scheduled. However, after the scheduling is completed, when responding to the service request sent by the user and calling multiple components deployed on different computing nodes through RPC, some components may be scheduled to computing nodes that are far away, so the time delay for calling these components may increase, thereby increasing the total time for the computing node to respond to the service request, affecting the service quality and thus affecting the user experience. Summary of the invention
[0004] The present application provides a component scheduling method, apparatus, computing device, and storage medium, which can schedule components based on the slack of each component in multiple components, thereby reducing the resource cost of each component, that is, reducing the deployment cost of each component. After the component scheduling is completed, the total time for the computing node to respond to the service request will not be increased, thereby ensuring the user experience of using the service.
[0005] In order to achieve the above-mentioned purpose, the embodiments of the present application adopt the following technical solutions.
[0006] In the first aspect, the present application provides a component scheduling method. The component scheduling method includes: a first node obtains a first instruction, and the first instruction is used to instruct: a target number of components among multiple components are scheduled to a second node. In response to the first instruction, request tracking data is obtained, and the request tracking data includes the call request initiation time, call request response time, and the upper and lower call relationship between the multiple components corresponding to the responded request of each component in the multiple components corresponding to the responded request of the first node. According to the request tracking data, the slack of each component in the multiple components is determined, and the slack is the maximum delayed call time length of the component without increasing the response time length of the responded request. According to the slack, a target number of components is determined from the multiple components, and the target number of components are deployed on the second node. The method provided by the present application determines the slack of each component in the multiple components according to the request tracking data, and then determines the scheduled component according to the slack. Because the slack reflects the delayed call time length of the scheduled component. Therefore, after the component scheduling is completed, when a service request input by the user is received to call the component, even if the calling time delay after the component is scheduled increases, since the slack can provide the scheduled component with the flexibility of delayed calling, the total time to respond to the user's service request will not be increased, thereby improving the service quality and thus improving the user experience.
[0007] In a possible implementation of the first aspect, the slack of each component in a plurality of components is determined according to request tracking data, including: determining at least one object group according to the request tracking data, the object group including a parent component and at least one child component, the child component being the next level component called by the parent component; determining the slack of each component in the object group to obtain the slack of each component in a plurality of components. The method provided in the present application divides a plurality of components into a plurality of object groups based on request tracking data, and then determines the slack of each component in each object group, and then schedules the components based on the slack of each component in a plurality of components, thereby reducing the resource cost of each component, that is, reducing the deployment cost of each component. And after the component scheduling is completed, the method provided in the present application will not increase the total time for the computing node to respond to the service request, thereby ensuring the user experience of using the service.
[0008] In a possible implementation of the first aspect, the component historical call information includes the call request initiation time, call request response time and the upper-lower calling relationship between the multiple components corresponding to the responded request for each component in the multiple components corresponding to the responded request; determining the slack of each component in the object group includes: determining the slack of the parent component in the object group according to the upper-lower calling relationship; determining the slack of each child component in the object group according to the call request initiation time and the call request response time. The method provided in the present application divides multiple components into multiple object groups based on request tracking data, determines the slack of each component in the object group in units of object groups, and then schedules the components based on the slack of each component in the multiple components, which can reduce the resource cost of each component, that is, reduce the deployment cost of each component. And after the component scheduling is completed, the method provided in the present application will not increase the total time for the computing node to respond to the service request, thereby ensuring the user experience of using the service.
[0009] In a possible implementation of the first aspect, the slack of the parent component in the object group is determined according to the upper-lower calling relationship, including: when the parent component in the object group does not have an upper-level component, the slack of the parent component is determined to be 0. When the parent component in the object group has an upper-level component, the slack of the parent component in the target object group is determined, and the slack of the parent component in the target object group is determined as the slack of the parent component, and the target object group also includes the parent component of the parent component. The method provided by the present application determines the slack of the parent component in each object group based on the component calling relationship between each component, and then the slack of each component can be obtained, and then the component with larger slack is determined as the scheduled component, and then the components are scheduled based on the slack of each component in multiple components, which can reduce the resource cost of each component, that is, reduce the deployment cost of each component. And after the component scheduling is completed, the method provided by the present application will not increase the total time for the computing node to respond to the service request, thereby ensuring the user's experience of using the service.
[0010] In a possible implementation of the first aspect, the slack of each subcomponent in the object group is determined according to the call request initiation time and the call request response time, including: determining at least one sub-object group from the object group, the sub-object group includes at least one sub-component, and the sub-components in each sub-object group are serially called in chronological order; determining the maximum value of the call request response times of the multiple sub-components included in the object group as the first time; determining the maximum value of the call request response times of the sub-components included in each sub-object group as the second time; determining the difference between the first time and the second time corresponding to each sub-object group, and summing the difference with the slack of the parent component of each sub-component in each sub-object group to determine the slack of each sub-component in each sub-object group. The method provided by the present application divides the sub-components in each object group in the multiple object groups into at least one sub-object group, and then determines the slack based on the call request initiation time of each component and the call request response time, and then can determine the scheduled component according to the slack of each component to complete the scheduling of the component. In this way, on the one hand, the method provided by the present application can reduce the resource cost of each component, that is, reduce the deployment cost of each component. On the other hand, after the component scheduling is completed, the method provided by the present application will not increase the total time for the computing node to respond to the service request, thereby ensuring the user experience of using the service.
[0011] In a possible implementation of the first aspect, a target number of components is determined from multiple components according to the slack, including: sorting the multiple components in descending order according to the slack of each component in the multiple components to obtain a slack sequence of the multiple components; and determining the target number of components in the front order from the slack sequence. The method provided by the present application sorts the multiple components according to the slack, and determines the components with large slack in the sort as the scheduled components. Since the slack of the scheduled components is large, it can also be understood that the maximum delayed call time length of the scheduled components without increasing the response time of the responded request is large. Therefore, the method provided by the present application reduces the deployment cost of the components by scheduling the components. After the component scheduling is completed, when the service request input by the user is received to call the component, even if the call time delay after the component is scheduled increases, the slack can provide the flexibility of delayed calling to the scheduled components, so the total time length of responding to the user's service request will not be increased, thereby ensuring the user's experience of using the service.
[0012] In a possible implementation of the first aspect, when the request tracking data includes component historical call information of multiple responded requests of the first node, the slack of each component in the multiple components is determined, including: based on the request tracking data, determining the slack of each responded request in the multiple responded requests corresponding to each component; and determining the average value of the slack of each responded request in the multiple responded requests corresponding to the component as the slack of the component. The method provided in the present application determines the slack of each component in the multiple components corresponding to the workflow of each service request in the multiple responded service requests respectively, and can obtain multiple slacks of each component, and determine the average value of the multiple slacks as the slack of the component. The slack obtained through multiple responded requests can better reflect the actual operation of the component, improve the accuracy of component scheduling, avoid the scheduled components affecting the user's service quality, and thus avoid affecting the user's usage experience.
[0013] In a possible implementation of the first aspect, the method further includes: obtaining a second instruction, the second instruction being used to instruct detection of abnormal components from multiple components; in response to the second instruction, determining the slack of each responded request in multiple responded requests corresponding to each component, and obtaining multiple slacks corresponding to each component; and determining a component having a slack greater than a preset threshold in the corresponding multiple slacks as an abnormal component. The method provided in the present application determines a slack greater than a preset threshold in multiple slacks of each component, and determines a component having a slack greater than the preset threshold as an abnormal component. In this way, the method provided in the present application can quickly determine abnormal components from multiple components according to multiple slacks of each component, thereby saving component maintenance time and reducing component maintenance costs.
[0014] In a second aspect, the present application provides a component scheduling device. The component scheduling device includes: an acquisition unit and a processing unit. The acquisition unit is used to acquire a first instruction, and the first instruction is used to indicate: scheduling a target number of components among multiple components to a second node; the acquisition unit is also used to respond to the first instruction to acquire request tracking data, and the request tracking data includes the call request initiation time, call request response time, and the upper and lower call relationship between the multiple components corresponding to the responded request of each component among the multiple components corresponding to the responded request of the first node; the processing unit is used to determine the slack of each component among the multiple components according to the request tracking data, and the slack of each component is used to indicate: the maximum delayed call time length of each component without increasing the response time of the responded request; the processing unit is also used to determine a target number of components from the multiple components according to the slack, and deploy the target number of components on the second node.
[0015] In a possible implementation of the second aspect, the processing unit is specifically used to determine at least one object group based on the request tracking data, the object group includes a parent component and at least one child component, and the child component is a next-level component called by the parent component; determine the slack of each component in the object group to obtain the slack of each component in the multiple components.
[0016] In a possible implementation of the second aspect, the processing unit is specifically used to determine the slack of the parent component in the object group according to the superior-subordinate calling relationship; and determine the slack of each child component in the object group according to the calling request initiation time and the calling request response time.
[0017] In a possible implementation manner of the second aspect, the processing unit is specifically configured to, when the parent component in the object group does not have an upper-level component, determine the slack of the parent component to be 0. When the parent component in the object group has an upper-level component, determine the slack of the parent component in the target object group, and determine the slack of the parent component in the target object group as the slack of the parent component, wherein the target object group also includes the parent component of the parent component.
[0018] In a possible implementation of the second aspect, the processing unit is specifically used to determine at least one sub-object group from the object group, the sub-object group including at least one sub-component, and the sub-components in each sub-object group are serially called in chronological order; determine the maximum value of the call request response times of the multiple sub-components included in the object group as the first time; determine the maximum value of the call request response times of the sub-components included in each sub-object group as the second time; determine the difference between the first time and the second time corresponding to each sub-object group, and determine the sum of the difference and the slack of the parent component of each sub-component in each sub-object group as the slack of each sub-component in each sub-object group.
[0019] In a possible implementation of the second aspect, the processing unit is specifically used to sort the multiple components in descending order according to the relaxation of each component in the multiple components to obtain a relaxation sequence of the multiple components; and determine a target number of components sorted first from the relaxation sequence.
[0020] In a possible implementation of the second aspect, when the request tracking data includes the call request initiation time, the call request response time and the superior-subordinate call relationship between the multiple components corresponding to the multiple responded requests of the first node, the processing unit is specifically used to determine the slack of each of the multiple responded requests corresponding to each component based on the request tracking data; and determine the average value of the slack of each of the multiple responded requests corresponding to the component as the slack of the component.
[0021] In a possible implementation of the second aspect, the acquisition unit is also used to acquire a second instruction, and the second instruction is used to instruct the detection of abnormal components from multiple components; the processing unit is also used to determine the slack of each responded request among the multiple responded requests corresponding to each component in response to the second instruction, and obtain multiple slacks corresponding to each component; and determine the component with a slack greater than a preset threshold among the corresponding multiple slacks as an abnormal component.
[0022] In a possible implementation of the second aspect, the processing unit is specifically used to determine at least one object group based on the request tracking data, the object group includes a parent component and at least one child component, and the child component is a next-level component called by the parent component; determine the slack of each component in the object group to obtain the slack of each component in the multiple components.
[0023] In a third aspect, the present application provides a computing device. The computing device includes: a processor and a memory, wherein the processor is connected to the memory. The memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, thereby implementing any one of the methods provided in the first aspect.
[0024] In a fourth aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, each computing device includes a processor and a memory; the processor of at least one computing device is used to execute instructions stored in the memory of at least one computing device, thereby implementing any one of the methods provided in the first aspect.
[0025] In a fifth aspect, the present application provides a chip. The chip includes: a processor and an interface circuit; the interface circuit is used to receive code instructions and transmit them to the processor; the processor is used to run the code instructions to execute any one of the methods provided in the first aspect above.
[0026] In a sixth aspect, the present application provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed on a computer, the computer executes any one of the methods provided in the first aspect above.
[0027] In a seventh aspect, the present application provides a computer program product, which includes computer execution instructions, and when the computer execution instructions are executed on a computer, the computer executes any one of the methods provided in the first aspect.
[0028] Among them, the technical effects brought about by any design method in the second to seventh aspects can refer to the technical effects brought about by different implementation methods in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1A schematic diagram of a process for determining a critical path shown in an embodiment of the present application;
[0030] Figure 2 A schematic diagram of the architecture of a component scheduling system shown in an embodiment of the present application;
[0031] Figure 3 A schematic diagram of the hardware structure of a computing device shown in an embodiment of the present application;
[0032] Figure 4 A schematic diagram of a flow chart of a component scheduling method shown in an embodiment of the present application;
[0033] Figure 5 A schematic diagram of requesting tracking data shown in an embodiment of the present application;
[0034] Figure 6 A historical execution diagram of a workflow of a service request shown in an embodiment of the present application;
[0035] Figure 7 A flowchart of another component scheduling method shown in an embodiment of the present application;
[0036] Figure 8 A historical execution diagram of another service request workflow shown in an embodiment of the present application;
[0037] Fig. 9 A flowchart of another component scheduling method shown in an embodiment of the present application;
[0038] Fig.10 A flowchart of another component scheduling method shown in an embodiment of the present application;
[0039] Fig.11 A flowchart of another component scheduling method shown in an embodiment of the present application;
[0040] Fig.12 A schematic diagram of the hardware structure of a component scheduling device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application. Among them, in the description of the present application, unless otherwise specified, " / " indicates that the objects associated before and after are in an "or" relationship, for example, A / B can represent A or B; "and / or" in the present application is only a kind of association relationship describing the associated objects, indicating that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. And, in the description of the present application, unless otherwise specified, "multiple" refers to two or more than two. "At least one of the following" or its similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple. In addition, in order to clearly describe the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as "first" and "second" are used to distinguish the same or similar items with basically the same functions and effects.
[0042] Those skilled in the art will appreciate that words such as "first" and "second" do not limit the quantity and execution order, and words such as "first" and "second" do not necessarily limit the difference. At the same time, in some embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a concrete way for easy understanding.
[0043] In addition, the network architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person of ordinary skill in the art can appreciate that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.
[0044] With the continuous development of cloud technology, the software architecture of cloud systems is usually a microservice architecture that connects multiple components through remote procedure calls (RPC) to form service operation logic. In the microservice architecture, in order to complete the service request of the user, it is necessary to respond to the service request sent by the user, and the workflow formed by calling multiple components can realize the corresponding service function. Among them, multiple components can be supported by network communication capabilities and independently deployed on the same or different computing nodes.
[0045] Considering the deployment cost of components, it is usually necessary to schedule some deployed components among multiple computing nodes. In related technologies, the critical path of the workflow of the currently deployed components is usually determined first, and then the components with smaller communication data volume with other components on the critical path are scheduled to avoid deploying two components with larger communication data volume on different computing nodes, thereby avoiding increasing the pressure on the communication network between computing nodes. Among them, all paths from the starting point to the end point in the workflow are simple paths of the workflow, the critical path is the path with the longest path length among the simple paths, and the path length is the sum of the execution time and call time of all components on the path. See Figure 1 , Figure 1 This is a schematic diagram of a process for determining a critical path. The critical path of each service request is determined based on the historical execution graphs of request 1 and request 2, where the critical path of request 1 consists of four components A, B, C, and D, and the critical path of request 2 consists of four components A, B, C, and M. Then, these two critical paths are aggregated to obtain the critical path of the computing node. As shown in the figure, components A, B, C, D, and M are critical components, and components X and Y are non-critical components. And the components on the critical path are determined as critical components. Then, among the multiple components on the critical path, the components with a smaller amount of communication data with other components are scheduled.
[0046] However, since this scheduling method usually only considers key components, it does not consider the impact of non-key components on the response time of service requests of computing nodes. Moreover, after the scheduling is completed, when responding to service requests sent by users and calling multiple components deployed on different computing nodes through RPC, the time delay for calling the component may increase because the component may be scheduled to a computing node that is farther away, thereby increasing the total time to respond to service requests, affecting the service quality and thus affecting the user experience.
[0047] In view of this, an embodiment of the present application provides a component scheduling method, which is applied to a computing node, and determines the slack of each component in multiple components by calling the historical information of the components that have responded to the request. Wherein, the slack is the maximum delayed call time length of the component without increasing the response time of the responded request. In other words, the workflow corresponding to each service request includes multiple parallel running components, that is, multiple called components form a parallel running structure. Since the running path lengths of each called component are different, the faster running component has a slack running time compared to the slower component, that is, delaying the call to run faster components will not affect the slower running components, thereby increasing the total response time of the service request. This slack running time is the slack of the component. Therefore, on the one hand, the method provided in the embodiment of the present application schedules the components based on slack, which can reduce the deployment cost of the components, and thus provide optimization space for saving resources. On the other hand, after the component scheduling is completed, the method provided in the embodiment of the present application will not increase the total time for the computing node to respond to the service request, thereby ensuring the user's experience of using the service.
[0048] See also Figure 2 , Figure 2 The present invention provides an architecture diagram of a component scheduling system provided in an embodiment of the present application, wherein the component scheduling system includes a first node 210, a second node 220, and a terminal device 230. The first node 210 and the second node 220 are deployed with multiple components, and the multiple components are used to respond to received service requests and implement corresponding service functions through remote procedure calls.
[0049] The component scheduling method provided in the embodiment of the present application may be applied to the first node 210 or the second node 220. The following is an exemplary description of the component scheduling method provided in the embodiment of the present application being applied to the first node 210.
[0050] When the first node 210 receives the first instruction for instructing to schedule the target number of components to the second node 220, the request tracking data is obtained. The request tracking data is generated when the first node 210 calls multiple components to implement the service function in response to the service request sent by the terminal device 230 before receiving the first instruction. The request tracking data includes the historical call information of the components to which the first node 210 has responded. The first node 210 determines the slack of each of the multiple components deployed according to the historical call information of the components, and then determines the scheduled components from the multiple components according to the slack, and deploys the scheduled components on the second node 220.
[0051] In some embodiments, a communication connection is established between the first node 210, the second node 220 and the terminal device 230. The communication connection may include a wired communication connection or a wireless communication connection. For example, the wireless communication connection may include a short-range wireless communication connection such as a Bluetooth communication connection, a near-field communication connection and a wireless local area network communication connection. Among them, the wireless communication technology for establishing a wireless communication connection between the first node 210, the second node 220 and the terminal device 230 includes but is not limited to at least one of the following: wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT) (for example, traditional Bluetooth or low energy (BLE) Bluetooth), near field communication (NFC), Zigbee, frequency modulation (FM) and infrared (IR), etc.
[0052] It is understandable that the first node 210 and the second node 220 in the embodiment of the present application may be settlement nodes of a computing device with any computing processing capability, or functional modules in the above computing device. As an example, the above computing device may be a general-purpose computer, a laptop, or a server, etc. The embodiment of the present application does not impose any special restrictions on the specific forms of the first node 210 and the second node 220.
[0053] In the embodiment of the present application, the terminal device 230 can be a mobile phone, a tablet computer, a personal computer (PC), a personal digital assistant (PDA), a smart watch, a netbook, a wearable device, an augmented reality (AR) device, a virtual reality (VR) device, a vehicle-mounted device, a smart screen, a smart car, a smart speaker, a robot, etc. The present application does not impose any special restrictions on the specific form of the terminal device 230.
[0054] Furthermore, the computing device deployed by the first node 210, the computing device deployed by the second node 220, and the operating system installed by the terminal device 230 include but are not limited to Or other operating systems. The present application does not limit the specific types of the first node 210, the second node 220 and the terminal device 230, and the type of the operating system when the operating system is installed.
[0055] For ease of understanding, the following embodiments are illustratively described by taking the first node 210 and the second node 220 as computing devices as an example.
[0056] Figure 3 The schematic diagram of the structure of the computing device provided in the embodiment of the present application is shown. The computing device 300 includes a processor 310, a memory 320 and at least one communication interface 330.
[0057] The processor 310 may include one or more processing cores. The processor 310 uses various interfaces and lines to connect various parts within the computing device 300, and executes various functions and processes data of the computing device 300 by running or executing instructions, programs, code sets or instruction sets stored in the memory 320, and calling data stored in the memory 320. Optionally, the processor 310 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 310 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. It is understandable that the above-mentioned modem may not be integrated into the processor 310, but may be implemented separately through a communication chip.
[0058] The memory 320 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 320 may include a program storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as an instruction receiving function, a component calling function, etc.), instructions for implementing various method embodiments described below, etc.
[0059] The communication interface 330 is used to communicate with a communication network or a device in a communication network, such as Ethernet, a radio access network (RAN), a wireless local area network (WLAN) or an AP in a WLAN network. For example, the communication interface 330 of the computing device 300 communicates with the terminal device 230 or a computing device deployed at another node.
[0060] In a specific implementation, in terms of physical implementation, the above-mentioned devices (such as processor 310, memory 320 and communication interface 330) can be devices in the same computing device; or, at least two of the devices can be set in the same computing device, that is, as different devices in a computing device, such as a deployment method similar to that of devices or devices in a distributed system.
[0061] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the computing device 300. In some embodiments, the computing device 300 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.
[0062] The component scheduling method provided in the embodiment of the present application is described below in conjunction with the drawings of the specification.
[0063] Figure 4 A method flow chart of a component scheduling method provided in an embodiment of the present application. Optionally, the method can be Figure 2 The first node 210 shown in FIG. 210 is executed, which can also be understood as being executed by a node having Figure 3 The method may include the following steps:
[0064] S11. The first node obtains a first instruction, where the first instruction is used to instruct: scheduling a target number of components from a plurality of components to a second node.
[0065] Specifically, the first node is deployed with multiple components. For the sake of ease of explanation, the target number of components to be scheduled will be referred to as the target number of target components, that is, it can be understood that the target component is one or more of the multiple components, and the first instruction is used to instruct the target component to be scheduled to the second node.
[0066] In some embodiments, the first instruction may specifically instruct to dispatch a preset number of target components among the multiple components deployed on the first node to the second component. For example, i components among the multiple components deployed on the first node are dispatched to the second node, where i is a positive integer. It may also specifically instruct to dispatch a preset proportion of target components among the multiple components deployed on the first node to the second node, for example, 20% of the components deployed on the first node are dispatched to the second node.
[0067] It should be understood that the above-mentioned first instruction can be input by the user in the interface displayed by the computing device 300 corresponding to the first node, to indicate that one or more components of the multiple components deployed by the first node are scheduled to other nodes (e.g., the second node). The above-mentioned first instruction can also be input by the user on a computing device deployed on other nodes (e.g., the second node) that communicates with the computing device 300, and sent to the computing device 300. To indicate that one or more components of the multiple components deployed by the first node are scheduled to other nodes. The embodiment of the present application does not place any particular restriction on the specific input method of the first instruction.
[0068] Specifically, when the first node determines that the scheduled target component is completed, it sends a component scheduling instruction to the second node, and the component scheduling instruction carries metadata corresponding to the scheduled target component. The second node responds to the component scheduling instruction and deploys the scheduled target component on the second node according to the metadata corresponding to the scheduled target component. It should be understood that the above scheduling process of the target component is only an exemplary description, and other methods can also be used to complete the scheduling of the target component, and the embodiments of the present application do not impose any special restrictions on this.
[0069] S12. The first node obtains request tracking data in response to the first instruction.
[0070] Specifically, when the first node calls multiple components corresponding to the service request to form a workflow, a component deployed by the first node may need to be an execution subject to call multiple other components running in parallel during operation, so as to receive data returned by each component and then implement the corresponding service function, that is, respond to the received service request. A component deployed by the first node may also need to be one of the multiple components running in parallel called by other components during operation, so as to return data to the component that calls this component, so as to implement the service function corresponding to the service request, that is, respond to the received service request.
[0071] The request tracking data includes the call request initiation time, call request response time and the superior-subordinate call relationship between the multiple components corresponding to the workflow included in the request that the first node has responded to. Before the first node receives the above-mentioned first instruction, the first node responds to the service request input by the user, and the first node calls the multiple components corresponding to the service request to form a workflow to implement the user's service function. The request tracking data is the call request initiation time, call request response time and the superior-subordinate call relationship between the multiple components corresponding to the request that the first node calls, which can also be understood as the request tracking data including the historical execution graph of each service request responded by the first node.
[0072] Specifically, the initiation time of the call request of each component is the time when the component that calls the component sends the call request to the component.
[0073] Each call request response time is the time it takes for the component to return data to the component that called the component in response to the call request.
[0074] The upper-lower calling relationship includes the upper-level component and the lower-level component of each component in the multiple components corresponding to each responded request of the first node. In other words, the upper-lower calling relationship is the information that represents which components call each component in the multiple components of the workflow corresponding to each service request, and which components are called by each component. For example, if component A is called by component B, then component B is the upper-level component of component A. Component A is the lower-level component of component B. Similarly, component C called by component A is the lower-level component of component A.
[0075] Combined with the above request tracking data, this embodiment provides a possible implementation method, see Figure 5 , Figure 5 A schematic diagram of request tracking data shown in an embodiment of the present application, the schematic diagram includes the call request initiation time, call request response time and the upper and lower call relationship between the multiple components corresponding to the responded requests of each service request corresponding to the multiple service requests responded by the first node. As shown on the right side of the figure, each component has a call request initiation time and call request response time corresponding to each service request. From the left side of the figure, it can also be seen that the upper and lower components of each component, that is, the upper and lower call relationship of each component.
[0076] In one possible implementation, the request tracing data is obtained based on the open source Jeager sampling tool. The Jeager sampling tool is a distributed tracing system for monitoring and diagnosing microservice architectures. It should be understood that the above Jeager sampling tool is only an example, and the request tracing data provided in the embodiment of the present application can also be obtained through other tools or implementation methods. The embodiment of the present application does not impose any special restrictions on the specific implementation method of obtaining the request tracing data.
[0077] S13. The first node determines the slack of each component in the multiple components according to the requested tracking data.
[0078] The slack is the maximum delay calling time of a component without increasing the response time of a responded request.
[0079] It should be understood that the main reason for the slackness of components is that when a remote service call is made, the workflow corresponding to each service request includes multiple components running in parallel, that is, multiple called components form a parallel running structure.
[0080] Since the running path length of each component is different, the faster running component (component with a shorter running path) has a slack running time compared to the slower component (component with a longer running path), that is, appropriately delaying the call of the faster running component will not affect the slower running component, nor will it increase the total time for the first node to respond to the service request. This slack running time is the slack of the component.
[0081] For example, see Figure 6 , Figure 6 A historical execution graph of a workflow of a service request shown in an embodiment of the present application, the workflow includes three called components, namely component A, component B and component C. It can be seen from the graph that component B and component C are components called by component A and run in parallel, and component C runs faster than component B. Delayed calling of the faster component C will not affect the slower component B. Therefore, there is a time difference between component C and component B, which is the slack of component C.
[0082] by Figure 6 The example provided is used to illustrate that when the delay in calling component C is less than the slack, it will not affect the normal operation of component B, and will not increase the running time of the workflow, that is, it will not increase the response time of the service request corresponding to the workflow.
[0083] In some embodiments, see Figure 7 The above S13 specifically includes the following steps:
[0084] S131. The first node determines at least one object group according to the requested tracking data. The object group includes a parent component and at least one child component. The child component is a next-level component called by the parent component.
[0085] Specifically, the next-level component of each component in the workflow of each service request can be determined based on the upper-lower calling relationship in the request tracking data. For multiple components included in the workflow corresponding to a service request, a component and the next-level component of the component are divided into an object group, the component is determined as a parent component, and the next-level component of the parent component is determined as a child component. Then, the multiple components included in the workflow corresponding to a service request are divided into multiple object groups. It should be understood that each object group includes only one parent component and at least one child component. In the case where a child component has a next-level component, the child component and the next-level component of the child component are divided into another object group. In other words, an object group only includes one parent component and all the next-level components of this parent component.
[0086] For example, see Figure 8 , Figure 8A schematic diagram of component historical call information of a service request shown in an embodiment of the present application. The workflow corresponding to the service request includes component a, component b, component c, component d, component e and component f. As can be seen from the figure, component a calls component b, component c, component d and component e respectively, then component a is the upper-level component of component b, component c, component d and component e. Component e calls component f, then component e is the upper-level component of component f. Therefore, two object groups are determined based on the component historical call information, namely object group x and object group y. Among them, object group x includes parent component a, subcomponent b, subcomponent c, subcomponent d and subcomponent e. Object group y includes parent component e and subcomponent f.
[0087] It should be understood that the same component may be called multiple times in a workflow of a service request. In this case, in the process of determining the object group, the component called each time is divided into the same or different object groups as a subcomponent. For example, in a workflow, component o needs to call component p twice, so the determined object group includes a parent component o and two subcomponents p. For example, in another workflow, component o and component q each call component p once, so there are two determined object groups, one object group includes a parent component o and subcomponent p, and the other object group includes a parent component q and subcomponent p.
[0088] S132. The first node determines the slack of each component in the object group to obtain the slack of each component in the multiple components.
[0089] Specifically, for an object group, first determine the slack of the parent component in the object group, then determine the slack of each child component in the object group based on the call request initiation time and the call request response time in the request tracking data, and obtain the slack of each component in the object group, thereby obtaining the slack of each component in the multiple components deployed on the first node.
[0090] In one possible implementation, see Fig. 9 The above S132 specifically includes the following steps:
[0091] S1321. The first node determines the slack of the parent component in the object group according to the superior-subordinate calling relationship.
[0092] Optionally, when there is no upper-level component for the parent component in the object group, the slack of the parent component is determined to be 0. When there is an upper-level component for the parent component in the object group, the slack of the parent component in the target object group is determined, and the slack of the parent component in the target object group is determined as the slack of the parent component, and the target object group also includes the parent component of the parent component.
[0093] Among them, in a workflow including multiple object groups, when a component has an upper-level component and a lower-level component, this component is a parent component in one object group and a child component in another object group. The slack of this component as a child component is determined as the slack of this component as a parent component, that is, the slack of this component.
[0094] It should be understood that, when there is no upper-level component for the parent component in the object group, it means that the parent component is called by the service request sent by the user, and the parent component cannot be delayed to be called, because once the parent component is delayed, it will increase the total time for the first node to respond to the service request, so the slack of the parent component without the upper-level component is determined to be 0. When there is an upper-level component for the parent component in the object group, it means that the parent component is a component called by other components, that is, it means that the parent component is a subcomponent in the target object group, and the parent component or subcomponent is only a conceptual division, so the slack of the component as a subcomponent is the same as the slack of the component as a parent component, so the slack of the component as a subcomponent is determined as the slack of the component.
[0095] Combined with the above Figure 8 , component a in object group x does not have an upper-level component, so the slack of component a is 0. If the parent component e in object group y has an upper-level component, then object group x is determined as the target object group of component e, and then the slack of component e in object group x is determined. Component e in object group x is a child component of component a, and the slack of component e in object group x is determined as the slack of component e in object group y.
[0096] S1322. The first node determines the slack of each subcomponent in the object group according to the call request initiation time and the call request response time.
[0097] In one possible implementation, see Fig.10 , S1322, specifically including the following steps:
[0098] S13221. The first node determines at least one sub-object group from the object group. The sub-object group includes at least one sub-component. The sub-components in each sub-object group are serially called in chronological order.
[0099] Specifically, being called serially in chronological order can be understood as multiple sub-components in each sub-object group running in sequence, and the next component is called and starts running after the current component finishes running.
[0100] In a possible implementation, at least one sub-object group is determined from an object group, specifically including the following steps: taking an object group corresponding to a workflow as an example, firstly, the maximum value among the call request response times of multiple sub-components included in the object group is determined as the marking time, and the component corresponding to the maximum value among the call request response times is determined as marking component 1. Then, the call request initiation time of marking component 1 is determined as the marking time, and then the component whose call request response time is closest to the marking time is determined as marking component 2, and then the call request initiation time of marking component 2 is determined as the marking time. In the case that there is no call request response time of the component before the marking time, marking component 1 and marking component 2 are determined as a sub-object group. Then, based on other components in the object group except marking component 1 and marking component 2, the above steps are repeated to obtain at least one sub-object group.
[0101] Combination Figure 8 , taking object group x as an example, object group x includes subcomponents b, component c, component d and component e. The call request response time of component b is the maximum value among the call request response times of multiple subcomponents, so the call request response time of component b is determined as the marking time, and component b is determined as marked component 1. Then the call request initiation time of component b is determined as the marking time. Then component c, whose call request response time is closest to the marking time, is determined as marked component 2. Then the call request initiation time of component c is determined as the marking time, and in the case that there is no call request response time of other components before the call request initiation time of component c, components b and component c are divided into a sub-object group m. Repeat the above steps to divide components d and component e into another sub-object group n.
[0102] Similarly, taking object group y as an example, object group y has only one subcomponent f. Divide component f into a sub-object group l.
[0103] In this way, Figure 8 The workflow corresponding to the service request shown in the figure includes multiple components divided into two object groups, namely object group x and object group y. Among them, object group x includes parent component a and subcomponents b, c, d and e. The subcomponents of object group x are divided into two sub-object groups, namely sub-object group m and sub-object group n. Sub-object group m includes sub-component b and sub-component c. Sub-object group n includes sub-component d and sub-component e. Object group y includes parent component e and sub-component f. The subcomponents of object group y are divided into sub-object group l, and sub-object group l includes sub-component f.
[0104] S13222. The first node determines the maximum value of the call request response times of the multiple subcomponents included in the object group as the first time.
[0105] Specifically, the maximum value of the call request response time of the multiple subcomponents included in the object group is the latest call request response time of the multiple subcomponents running in parallel. That is, the constraint time of the call request response time of the multiple subcomponents running in parallel. Once any subcomponent exceeds the above first time, the total time for responding to the service request will increase.
[0106] Exemplarily, taking the above-mentioned object group x as an example, the call request response time of component b is the maximum value of the call request response time of all subcomponents, so the first time is the call request response time of component b.
[0107] S13223. The first node determines a maximum value among the call request response times of the subcomponents included in each sub-object group as the second time of each sub-object group.
[0108] Specifically, the maximum value of the call request response times of the multiple sub-components included in the sub-object group is the latest call request response time of the multiple sub-components running in parallel in the sub-object group.
[0109] Exemplarily, taking the above sub-object group m as an example, the second time is the call request response time of component b. Taking the above sub-object group n as an example, the second time is the call request response time of component e.
[0110] S13224. The first node determines the difference between the first time and the second time corresponding to each sub-object group, and determines the slack of each sub-component in each sub-object group by adding the difference and the slack of the parent component of each sub-component in each sub-object group.
[0111] Exemplarily, for child object group m, the difference between the first time and the second time of object group m is 0, and the slack of the parent component a of child object group m is 0, so the slack of subcomponent b and subcomponent c in child object group m is determined to be 0. For child object group n, the difference between the first time and the second time corresponding to object group n is 2ms, and the slack of the parent component a of child object group n is 0, so the slack of subcomponent d and subcomponent e in child object group n is determined to be 2ms. For child object group l, the difference between the first time and the second time corresponding to object group l is 0, but the parent component of child object group l is component e. And the slack of component e in object group x is 2ms. Therefore, the slack of component f is the sum of the difference between the first time and the second time corresponding to object group l and the slack of component e, which is equal to 2ms.
[0112] In some embodiments, when the request tracking data includes component historical call information of multiple responded request workflows of a first node, determining the slack of each of the multiple components includes: determining the slack of each of the multiple responded requests corresponding to each component based on the component historical call information of the multiple responded request workflows; and determining the average value of the slack of each of the multiple responded requests corresponding to the component as the slack of the component.
[0113] Specifically, the slack of each responded request among the multiple responded requests corresponding to each component is the slack of each workflow corresponding to each component.
[0114] It should be understood that the request tracking data includes component historical call information of multiple responded requests. Among them, the multiple responded requests can be different service requests sent by the same user. The workflow of each service request calls different multiple components respectively. Multiple responded requests can be the same service request sent by the same user. The workflow of each service request calls the same multiple components respectively. The embodiment of the present application does not impose any special restrictions on the sending users of multiple responded requests and the specific components called by the corresponding workflows.
[0115] In the case where the request tracking data includes component historical call information of multiple responded requests of the first node, the computing device determines the slack of each component in the multiple components corresponding to the workflow of each responded request based on each responded request by executing the above S13. It can also be understood as obtaining the slack of each component corresponding to each responded request, that is, obtaining the slack sample distribution of each component. The slack sample distribution includes multiple slacks of each component corresponding to multiple workflows. Then the computing device determines the average value of the multiple slacks of the multiple workflows corresponding to each component, and determines the average value of the slack of each component as the slack of each component.
[0116] For example, the slack of component e in the workflow corresponding to request 1 is 2ms. The slack of component e in the workflow corresponding to request 2 is 6ms. Then the slack of component e is 4ms.
[0117] It should be understood that the same component may be called multiple times in a workflow of a service request. Then the computing device can obtain multiple slacks of the component by executing the above S13. When a component has multiple slacks, the slack of the component is equal to the average of all slacks of the component. In other words, the average of multiple slacks of a component in the workflows of multiple service requests and multiple slacks in the workflow of a service request is the slack of the component.
[0118] In a possible implementation, the above S13 can be implemented by the following code:
[0119] Input: request tracking data;
[0120] Output: Each component relaxation value CT = {C1: [T 11 ,T 12 ,…],C2:[T 21 ,…],…,}
[0121] Initialize the parent node set Parent to an empty set;
[0122] Entry node C requested by the user enter Add to the Parent collection and set the relaxation of this parent node to T parent =0;##Parent={C enter :0}
[0123] Initialize component slack CT = {C1:[],C2:[],…,}
[0124] while Parent not null:
[0125] C p ,T p =Parent.pop();
[0126] Children left =C p Directly call downstream nodes;
[0127] T end =Max(Children left The time when the node is completed during operation);
[0128] While Children left not null:
[0129] T least =Min(Children left The node operation start time);
[0130] T tag =Max(Children left The time when the node is completed during operation);
[0131] T sibling =T end -T tag ;
[0132] List selected =[];
[0133] While T tag >T least :
[0134] Setting C selected For Children left The latest running completion time is less than or equal to T tag Nodes;
[0135] List selected .add(C selected );
[0136] Setting T tag C selected The start time of the operation;
[0137] ##List selected The node relaxation in is set to T p +T sibling ;
[0138] For C i in List selected :
[0139] Update CT in C i The relaxation record.append(T p +T sibling ).
[0140] From Children left Remove C from the collection i ;
[0141] if C i There is a call downstream:
[0142] ((C i :T p +T sibling ))Add to Parent collection;
[0143] For example, Figure 8 The workflow shown corresponds to the request tracking data input above code.
[0144] The slack of each component is determined as follows:
[0145] Parent = {a:0}
[0146] Children_left={b,c,d,e}
[0147] CT={a:[0]}
[0148] Children_left not null
[0149] List_select = [b,c]
[0150] Children_left becomes {{d,e}
[0151] CT={a:[0],b:[0],c:[0]}
[0152] Children_left not null
[0153] List_select = [e, d]
[0154] Children_left becomes {{}
[0155] CT={a:[0],b:[0],c:[0],d:[2],e[2]}
[0156] Parent = {e:2}
[0157] Children_left={f}
[0158] CT={a:[0],b:[0],c:[0],d:[2],e[2],f[2]}
[0159] It can be seen that the relaxation of components a, b, and c is 0ms, and the relaxation of components d, e, and f is 2ms.
[0160] It should be understood that the above codes are only exemplary, and the method for determining the degree of slack in the embodiment of the present application may also be implemented by other codes or programs, and the embodiment of the present application does not impose any particular limitation on this.
[0161] S14. The first node determines a target number of components from multiple components according to the slack, and deploys the target number of components on the second node.
[0162] The above S14 specifically includes the following steps: sorting the multiple components in descending order according to the relaxation of each component in the multiple components to obtain a relaxation sequence of the multiple components; and determining a target number of components that are ranked first from the relaxation sequence.
[0163] Specifically, a target number of components with the largest slack among the multiple components are determined as components to be scheduled to the second node.
[0164] For example, in combination with the above Figure 8, the slack of components a, b, and c is 0ms, and the slack of components d, e, and f is 2ms. The resulting slack sequence is d, e, f, a, b, c. In the case of i=3, it is determined that the components to be scheduled to the second node are components d, e, and f. Therefore, Figure 8 Among the six components shown, the three components with the largest slack, namely component d, component e and component f, are scheduled to the second node.
[0165] In some other embodiments, the first instruction is specifically used to instruct to schedule a preset proportion of components to the second node.
[0166] The above S14 specifically includes the following steps: sorting the multiple components in descending order according to the relaxation of each component in the multiple components to obtain a relaxation sequence of the multiple components, and determining a preset proportion of components that are ranked first from the relaxation sequence.
[0167] For example, in combination with the above Figure 8 , the slack of component a, component b, and component c is 0ms, and the slack of component d, component e, and component f is 2ms. The resulting slack sequence is d, e, f, a, b, c. When the preset ratio is 50%, it is determined that the components to be scheduled to the second node are component d, component e, and component f. Therefore, component d, component e, and component f are scheduled to the second node.
[0168] As can be seen from the above S11-S14, the method provided in the embodiment of the present application determines the slack of each component in multiple components according to the request tracking data, and then determines the target component to be scheduled according to the slack. Since the slack reflects the length of the delayed call time of the scheduled component. Therefore, the method provided in the embodiment of the present application schedules the components based on the slack, which can reduce the deployment cost of the components, thereby providing optimization space for saving resources. Moreover, after the component scheduling is completed, when the method provided in the embodiment of the present application receives the service request input by the user to call the component, even if the call time delay after the component is scheduled increases, the slack can provide the flexibility of delayed calling to the scheduled component, so it will not increase the total time to respond to the user's service request, thereby improving the service quality, thereby improving the user's experience.
[0169] In the daily use of systems with microservice architecture as the software architecture, deployed components may become abnormal or require optimization due to failures. The relevant technology cannot accurately detect abnormal components in the system that have abnormalities or need to be optimized, resulting in long maintenance time and high maintenance costs, affecting the user experience.
[0170] In some embodiments, see Fig.11 , the method provided in the embodiment of the present application further includes the following steps:
[0171] S1101. A first node obtains a second instruction, where the second instruction is used to instruct detection of an abnormal component from multiple components.
[0172] Specifically, the second instruction may be input by the user in the interface displayed by the computing device 300 corresponding to the first node, or may be input by the user on a computing device deployed on another node (e.g., the second node) that communicates with the computing device 300 and is sent to the computing device 300. The embodiment of the present application does not particularly limit the specific input method of the second instruction.
[0173] S1102, the first node determines the slack of each responded request in multiple responded requests corresponding to each component in response to the second instruction, and obtains multiple slacks corresponding to each component;
[0174] Specifically, the slack of each of the multiple responded requests corresponding to each component is the slack sample distribution of each component. The determination method of the slack sample distribution of each component is described in the above embodiment, which will not be repeated here.
[0175] S1103. The first node determines a component having a slack greater than a preset threshold among the corresponding multiple slacks as an abnormal component.
[0176] Specifically, in a system, for service requests sent by different users, the slack of each component has a preset range. When the slack of a service request corresponding to a component exceeds the preset range, it indicates that the component is abnormal, and the component is determined to be an abnormal component.
[0177] From the above, it can be seen that the method provided in the embodiment of the present application determines the slack sample distribution of each component by requesting tracking data, and then detects abnormal components based on the slack sample distribution of each component, which can save maintenance time, reduce maintenance costs, and improve user experience.
[0178] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the method. It is understandable that, in order to realize the above functions, the computing device 300 includes at least one of the hardware structure and software modules corresponding to each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the embodiment of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiment of the present application.
[0179] The embodiment of the present application can divide the computing device 300 into functional units according to the above method example. For example, each functional unit can be divided corresponding to each function, or two or more functions can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.
[0180] For example, Fig.12 The structural block diagram of a component scheduling device provided by an embodiment of the present application is shown. The device includes an acquisition unit 1201 and a processing unit 1202. The acquisition unit 1201 is used to acquire a first instruction, and the first instruction is used to indicate: scheduling a target number of components among multiple components to a second node; the acquisition unit 1201 is also used to respond to the first instruction to acquire request tracking data, and the request tracking data includes the call request initiation time, call request response time, and the upper and lower call relationship between the multiple components corresponding to the responded request of each component among the multiple components corresponding to the responded request of the first node; the processing unit 1202 is used to determine the slack of each component among the multiple components according to the request tracking data, and the slack of each component is used to indicate: the maximum delayed call time length of each component without increasing the response time of the responded request; the processing unit 1202 is also used to determine a target number of components from the multiple components according to the slack, and deploy the target number of components on the second node.
[0181] Optionally, the processing unit 1202 is specifically used to determine at least one object group based on the requested tracking data, where the object group includes a parent component and at least one child component, and the child component is a next-level component called by the parent component; determine the slack of each component in the object group to obtain the slack of each component in the multiple components.
[0182] Optionally, the processing unit 1202 is specifically used to determine the slack of the parent component in the object group according to the superior-subordinate calling relationship; and determine the slack of each child component in the object group according to the calling request initiation time and the calling request response time.
[0183] Optionally, the processing unit 1202 is specifically configured to, when there is no upper-level component for the parent component in the object group, determine the slack of the parent component to be 0. When there is an upper-level component for the parent component in the object group, determine the slack of the parent component in the target object group, and determine the slack of the parent component in the target object group as the slack of the parent component, wherein the target object group also includes the parent component of the parent component.
[0184] Optionally, processing unit 1202 is specifically used to determine at least one sub-object group from the object group, the sub-object group including at least one sub-component, and the sub-components in each sub-object group are serially called in chronological order; determine the maximum value of the call request response times of the multiple sub-components included in the object group as the first time; determine the maximum value of the call request response times of the sub-components included in each sub-object group as the second time; determine the difference between the first time and the second time corresponding to each sub-object group, and determine the sum of the difference and the slack of the parent component of each sub-component in each sub-object group as the slack of each sub-component in each sub-object group.
[0185] Optionally, the processing unit 1202 is specifically configured to sort the multiple components in descending order according to the slack of each component in the multiple components to obtain a slack sequence of the multiple components; and determine a target number of components that are sorted first from the slack sequence.
[0186] Optionally, when the request tracking data includes the call request initiation time, call request response time and the superior-subordinate call relationship between the multiple components corresponding to the multiple responded requests of the first node, the processing unit 1202 is specifically used to determine the slack of each of the multiple responded requests corresponding to each component based on the request tracking data; and determine the average value of the slack of each of the multiple responded requests corresponding to the component as the slack of the component.
[0187] Optionally, the acquisition unit 1201 is also used to acquire a second instruction, where the second instruction is used to instruct detection of abnormal components from multiple components; the processing unit 1202 is also used to determine, in response to the second instruction, the slack of each responded request among multiple responded requests corresponding to each component, and obtain multiple slacks corresponding to each component; and determine a component having a slack greater than a preset threshold among the corresponding multiple slacks as an abnormal component.
[0188] For the detailed description of the above optional methods, please refer to the above method embodiments, which will not be repeated here. In addition, the explanation of any component scheduling device provided above and the description of the beneficial effects can refer to the above corresponding method embodiments, which will not be repeated here.
[0189] The embodiment of the present application also provides a computer-readable storage medium, in which at least one computer instruction is stored, and the at least one computer instruction is loaded and executed by a processor to implement the component scheduling method of each embodiment above. For the explanation of the relevant content and the description of the beneficial effects in any of the above-mentioned computer-readable storage media, reference can be made to the above-mentioned corresponding embodiments, which will not be repeated here.
[0190] The embodiment of the present application also provides a chip. The chip integrates a control circuit and one or more ports for realizing the functions of the above-mentioned component scheduling device. Optionally, the functions supported by the chip can refer to the above and will not be repeated here. A person of ordinary skill in the art can understand that all or part of the steps of the above-mentioned embodiment can be implemented by a program to instruct the relevant hardware to complete the program, which can be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a random access memory, etc. The above-mentioned unit or processor can be a central processing unit, a general-purpose processor, a specific circuit structure (application specific integrated circuit, ASIC), a microprocessor (digital signal processor, DSP), a field programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof.
[0191] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes a plurality of computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server or data center that includes multiple media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., an SSD), etc.
[0192] Memory, computer readable storage medium and communication chip, etc., all have non-transitory. Those skilled in the art should be aware that in the above multiple examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware or any combination thereof. When implemented using software, these functions can be stored in a computer readable storage medium or transmitted as multiple instructions or codes on a computer readable storage medium. Computer readable storage media include computer storage media and communication media, wherein the communication medium includes any medium that is convenient for transmitting a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0193] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A component scheduling method, characterized in that: Applied to a first node, where a plurality of components are deployed, the method includes: Obtain a first instruction, where the first instruction is used to instruct: scheduling a target number of components among the multiple components to a second node; In response to the first instruction, obtaining request tracking data, the request tracking data including the call request initiation time, the call request response time, and the upper-lower calling relationship between the multiple components corresponding to the request that has been responded to by the first node; Determine, according to the request tracking data, the slack of each component in the plurality of components, wherein the slack of each component is used to indicate: a maximum delayed call time length of each component without increasing a response time length of the responded request; Determining the slack of each component in the plurality of components according to the request tracking data includes: Determine at least one object group according to the request tracking data, the object group including a parent component and at least one child component, the child component being a next-level component called by the parent component; determining the slack of each component in the object group to obtain the slack of each component in the plurality of components; Determining the relaxation of each component in the object group includes: Determine the slack of the parent component in the object group according to the upper-lower calling relationship; Determine the slack of each subcomponent in the object group according to the call request initiation time and the call request response time; The target number of components is determined from the multiple components according to the slack, and the target number of components is deployed on the second node.
2. The method according to claim 1, characterized in that The determining the slack of the parent component in the object group according to the upper-lower calling relationship includes: In the case where the parent component in the object group does not have an upper-level component, the slack of the parent component is determined to be 0; When there is an upper-level component for the parent component in the object group, the slack of the parent component in the target object group is determined, and the slack of the parent component in the target object group is determined as the slack of the parent component, and the target object group also includes the parent component of the parent component.
3. The method according to claim 1 or 2, characterized in that: The determining the slack of each subcomponent in the object group according to the call request initiation time and the call request response time includes: Determine at least one sub-object group from the object group, the sub-object group includes at least one sub-component, and the sub-components in each of the sub-object groups are serially called in chronological order; Determine a maximum value among call request response times of a plurality of subcomponents included in the object group as a first time; Determine the maximum value of the call request response times of the subcomponents included in each of the sub-object groups as the second time; The difference between the first time and the second time corresponding to each sub-object group is determined, and the slack of each sub-component in each sub-object group is determined as the sum of the difference and the slack of the parent component of each sub-component in each sub-object group.
4. The method according to claim 1 or 2, characterized in that: The step of determining the target number of components from the plurality of components according to the slack comprises: Sorting the multiple components in descending order according to the relaxation of each component in the multiple components to obtain a relaxation sequence of the multiple components; A target number of components that are ordered first are determined from the slack sequence.
5. The method according to claim 1 or 2, characterized in that: In a case where the request tracking data includes a call request initiation time, a call request response time, and a superior-subordinate call relationship between the multiple components corresponding to the multiple responded requests of the first node, determining the slack of each component in the multiple components includes: Determine, based on the request tracking data, the slack of each of the multiple responded requests corresponding to each of the components; An average value of the slack of each responded request among the multiple responded requests corresponding to the component is determined as the slack of the component.
6. The method according to claim 5, characterized in that The method further comprises: Obtain a second instruction, where the second instruction is used to instruct to detect an abnormal component from the multiple components; In response to the second instruction, determining the slack of each of the multiple responded requests corresponding to each of the components to obtain multiple slacks corresponding to each component; A component having a slack greater than a preset threshold among the corresponding multiple slacks is determined as an abnormal component.
7. A component scheduling device, characterized in that: Applied to a first node, the first node is deployed with multiple components, and the device includes: An acquiring unit, configured to acquire a first instruction, wherein the first instruction is configured to instruct: scheduling a target number of components among the multiple components to a second node; The acquisition unit is further used to acquire request tracking data in response to the first instruction, wherein the request tracking data includes a call request initiation time, a call request response time, and a superior-subordinate call relationship between the multiple components corresponding to the request that has been responded to by the first node, for each component; A processing unit, configured to determine the slack of each of the multiple components according to the request tracking data, wherein the slack of each component is used to indicate: a maximum delayed call time length of each component without increasing a response time length of the responded request; The processing unit is specifically used to determine at least one object group according to the request tracking data, the object group includes a parent component and at least one child component, and the child component is a next-level component called by the parent component; determine the slack of each component in the object group to obtain the slack of each component in the multiple components; The processing unit is specifically used to determine the slack of the parent component in the object group according to the upper-lower calling relationship; determine the slack of each child component in the object group according to the calling request initiation time and the calling request response time; The processing unit is further used to determine the target number of components from the multiple components according to the slack, and deploy the target number of components on the second node.
8. A computing device, characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the component scheduling method according to any one of claims 1 to 6.
9. A computing device cluster, characterized in that: comprising at least one computing device, each computing device comprising a processor and a memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, so that the computing device cluster executes the component scheduling method according to any one of claims 1 to 6.
10. A computer program product comprising instructions, characterized in that When the instructions are executed by a computing device cluster, the computing device cluster executes the component scheduling method according to any one of claims 1 to 6.
11. A computer-readable storage medium, characterized in that: The method comprises computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the component scheduling method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Fine-grained cloud resource management and control system and method based on service component level
CN111625347A
Auto-recovery framework
US20220291960A1