Processor resource management method and apparatus, cloud computing device, and storage medium
By first starting computing tasks in the cloud computing system and binding them to the target processor, isolating and migrating other tasks, the problem of insufficient computing power guarantee for cloud computing tasks in the existing technology is solved, and the processor resource utilization efficiency and user experience are improved. .
Patent Information
- Application Number
- PCT/CN2024/071198
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-02-22
- Filing Date
- 2024-01-08
- Publication Date
- 2024-08-29
AI Technical Summary
Existing technology is difficult to guarantee the system computing power of cloud computing tasks. Especially when re-dividing isolated processors for resource preparation or task cleanup during the system boot stage, it is time-consuming and complex, resulting in tasks unable to successfully obtain processor resources.
By first starting the computing task to be executed, then binding it to the target processor and isolating it, migrating other tasks to the preset processor, ensuring that the target processor is dedicated to the computing task, and finally releasing the isolation to avoid rebooting the operating system to modify the processing Device mask.
It improves the fault tolerance and computing power service quality of computing tasks guaranteed by processor computing power, simplifies the task orchestration process, and improves user experience.
Smart Images

Figure CN2024071198_29082024_PF_FP_ABST
Abstract
Description
Processor resource management method, device, cloud computing equipment and storage medium
[0001] Related applications
[0002] This application claims priority to Chinese patent application No. 202310151942.9 filed on February 22, 2023, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the field of cloud computing technology, and in particular to a method and apparatus for managing processor resources, a cloud computing device, and a storage medium. Background Art
[0004] In the field of cloud computing and communications equipment systems, the demand for guaranteed computing power to handle cloud computing tasks has become increasingly high. However, existing technologies, such as repartitioning isolated processors to prepare resources during the system boot phase, or clearing tasks from processors that need to be bound to computing tasks, are time-consuming and complex, and can easily result in tasks failing to obtain processor resources. Consequently, these technologies struggle to guarantee system computing power for cloud computing tasks.
[0005] Summary of the Invention
[0006] The main purpose of this application is to provide a processor resource management method, cloud computing equipment and storage medium, aiming to solve the technical problem that related technologies are difficult to guarantee the system computing power of cloud computing tasks.
[0007] To achieve the above objectives, an embodiment of the present application provides a method for managing processor resources, the method comprising:
[0008] After starting a computing task to be executed, binding the computing task to a target processor and isolating the target processor;
[0009] Migrating tasks other than the computing task on the target processor to other preset processors, so as to run the computing task through the target processor;
[0010] After the computing task is completed, the isolation of the target processor is released.
[0011] In addition, an embodiment of the present application further provides a processor resource management device, the management device comprising a task management unit, a binding unit, an isolation unit, and an exclusion unit respectively connected to the task management unit;
[0012] The task management unit is configured to start a computing task to be executed and, after the computing task is completed, release the isolation of the target processor bound to the computing task;
[0013] The binding unit is configured to bind the computing task started by the task management unit to a target processor;
[0014] The isolation unit is configured to isolate the target processor bound to the computing task;
[0015] The exclusive unit is configured to migrate tasks other than the computing task on the isolated target processor to other preset processors.
[0016] Each functional unit of the management device implements the steps of the processor resource management method described above during operation.
[0017] In addition, an embodiment of the present application also provides a cloud computing device, which includes: a processor resource management device as described above, a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the computer program is configured to implement the steps of the processor resource management method as described above.
[0018] In addition, an embodiment of the present application further provides a storage medium, which is a computer-readable storage medium and stores a computer program. When the computer program is executed by a processor, the steps of the processor resource management method described above are implemented.
[0019] An embodiment of the present application discloses a method for managing processor resources, which first starts the computing task to be executed, then binds the computing task to a target processor that provides computing power services, and then isolates the target processor with the bound computing task. Then, all tasks on the target processor except the computing task are migrated to other preset processors. In this way, the computing task is run by the processor after completing the above settings. Finally, after the computing task is completed, the isolation unit is released from the isolation of the target processor.
[0020] Thus, the embodiment of the present application first initiates the computing task and then performs the binding isolation between the task and the target processor. In this way, there is no need to reboot the operating system to modify the processor mask of the target processor in the operating system scheduling component, and the target processor can be set as an isolated processor from the operating system's perspective. Therefore, compared with the relevant technology, the embodiment of the present application effectively improves the fault tolerance of the computing task to obtain processor computing power guarantee, thereby solving the technical problem that the relevant technology is difficult to guarantee the system computing power of cloud computing tasks, while providing a better user experience.
[0021] In addition, the embodiment of the present application also performs dynamic migration processing on other tasks on the target processor that are not related to the task. In this way, the target processor can provide sufficient computing power resources for the operation of the computing task, further ensuring the computing power service quality of the processor for the computing task. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] FIG1 is a schematic diagram of the structure of the operating equipment of the hardware operating environment involved in the embodiment of the present application;
[0023] FIG2 is a flow chart of a first embodiment of a method for managing processor resources according to an embodiment of the present application;
[0024] FIG3 is a flow chart of a feasible embodiment of a method for managing processor resources according to an embodiment of the present application;
[0025] FIG4 is a flowchart illustrating the execution steps of a method for managing processor resources according to an embodiment of the present application;
[0026] FIG5 is a flow chart of a second embodiment of a method for managing processor resources according to an embodiment of the present application;
[0027] FIG6 is a flow chart of another feasible embodiment of a method for managing processor resources according to an embodiment of the present application;
[0028] FIG7 is a flow chart of a third embodiment of a method for managing processor resources according to an embodiment of the present application;
[0029] FIG8 is a flow chart of another feasible embodiment of the method for managing processor resources involved in the embodiment of the present application;
[0030] FIG9 is a schematic diagram of the structure of a processor resource management device according to an embodiment of the present application.
[0031] The realization of the objectives, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0032] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0033] Currently, in the field of cloud computing and communication equipment systems, when operating systems schedule and bind processors to perform computing tasks, they can choose to set some processors on the server or the processors of the virtual machine to be in an isolated state during the boot phase. Then, the cloud computing tasks to be calculated are started and bound to the isolated processors. However, this method requires pre-dividing a separate isolated processor resource pool during the boot phase, which results in a long time to set up the processor resources; and the quota management of the entire processor resource pool is also relatively rigid. More importantly, processors that enter the isolated processor resource pool after being set by the operating system but have not yet been assigned computing tasks will be idle and cannot be used by the operating system for other purposes. In addition, the task scheduling system connected to the operating system also needs to use whether the processor is in an isolated state as a key parameter for scheduling, which makes the overall scheduling process of computing tasks very complicated.
[0034] Alternatively, there is currently another way to process cloud computing tasks, that is, all processors on the server managed by the operating system or all processors of the virtual machine are uniformly initialized to create a shared processor resource pool. Then, before the computing task starts, some processors on the server or some processors of the virtual machine are first set to isolated processors, and then all tasks on the target processor (including physical processors and / or processors of the virtual machine) are cleared. Then, the task is started and bound to the target processor in the isolated state. Moreover, after the task is executed, the isolated processor is recovered and reset to a shared processor and returned to the processor resource pool. However, even if this method can achieve the goal of not restarting the operating system, since clearing the tasks on the target processor is a time-consuming process, the subsequent binding and running of tasks cannot provide users with a good experience. Moreover, this method still has poor fault tolerance for computing tasks to obtain server computing power guarantee.
[0035] In light of the above, in the field of cloud computing and communications equipment systems, the demand for guaranteed computing power to process cloud computing tasks has become increasingly high. However, related technologies, such as repartitioning isolated processors to prepare resources during the system boot phase, or clearing tasks from processors that need to be bound to computing tasks, are time-consuming and complex, and can easily result in tasks failing to obtain processor resources. In other words, these technologies struggle to guarantee the system computing power required for cloud computing tasks.
[0036] To solve the above technical problems, the embodiment of the present application provides a method for managing processor resources, which first starts the current computing task to be executed, then binds the computing task to the target processor that provides computing power services, and isolates the target processor with the bound computing task. Then, all tasks on the target processor except the computing task are migrated to other preset processors. In this way, the computing task is run by the processor after completing the above settings. Finally, after the computing task is completed, the isolation unit is released from the isolation of the target processor.
[0037] Thus, the embodiment of the present application first initiates the computing task and then performs the binding isolation between the task and the target processor. This allows the target processor to be set as an isolated processor from the operating system's perspective without having to reboot the operating system to modify the processor mask of the target processor within the operating system's scheduling component. Thus, compared to related technologies, the embodiment of the present application effectively improves the fault tolerance of computing tasks in obtaining processor computing power guarantees, thereby resolving the technical problem that related technologies have difficulty in guaranteeing system computing power for cloud computing tasks.
[0038] In addition, the embodiment of the present application also performs dynamic migration processing on other tasks on the target processor that are not related to the task. In this way, the target processor can provide sufficient computing power resources for the operation of the computing task, further ensuring the computing power service quality of the processor for the computing task.
[0039] For example, please refer to Figure 1, which is a schematic diagram of the operating device structure of the hardware operating environment involved in the embodiment of the present application.
[0040] As shown in Figure 1, the operating device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may include a standard wired interface and a wireless interface (such as a wireless fidelity (WI-FI) interface). The memory 1005 may be a high-speed random access memory (RAM) or a stable non-volatile memory (NVM), such as a disk storage. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0041] Those skilled in the art will understand that the structure shown in FIG1 does not constitute a limitation on the operating device. FIG1 is an embodiment of the operating device involved in the present application, which may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0042] As shown in FIG. 1 , the memory 1005 as a storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and a computer program.
[0043] In the operating device shown in FIG1 , the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with the user; the processor 1001 and the memory 1005 in the operating device of the present application can be set in the operating device, and the operating device calls the computer program stored in the memory 1005 through the processor 1001 and performs the following operations:
[0044] After starting a computing task to be executed, binding the computing task to a target processor and isolating the target processor;
[0045] Migrating tasks other than the computing task on the target processor to other preset processors, so as to run the computing task through the target processor;
[0046] After the computing task is completed, the isolation of the target processor is released.
[0047] Exemplarily, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0048] After the computing task is finished, the target processor is set to a preset manageable state for scheduling and running a new task, wherein the manageable state includes: an isolated state and a shared state.
[0049] Exemplarily, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0050] The target processor is set to the isolated state or the shared state according to task scheduling requirements.
[0051] Exemplarily, the processor 1001 may call a computer program stored in the memory 1005 and, before executing the operation of isolating the target processor, further perform the following operations:
[0052] detecting a manageability state of the target processor;
[0053] When it is detected that the manageable state is the isolated state, performing the step of migrating tasks other than the computing task on the target processor to other preset processors;
[0054] When it is detected that the manageable state is the shared state, the steps of isolating the target processor and migrating tasks other than the computing task on the target processor to other preset processors are performed.
[0055] Exemplarily, the processor 1001 may call a computer program stored in the memory 1005, and after starting the computing task to be executed and before binding the computing task to the target processor, further perform the following operations:
[0056] Parse the received task request;
[0057] When it is confirmed through analysis that the task request carries a computing power guarantee requirement, the task request is treated as a computing task to be executed and started.
[0058] Exemplarily, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0059] After the computing task is started, an execution termination event of the computing task is monitored, so as to determine that the execution of the computing task is completed when the execution termination event is detected.
[0060] Exemplarily, the processor 1001 may call a computer program stored in the memory 1005 and further perform the following operations:
[0061] In a case where an exclusive completion notification is detected, the target processor is controlled to execute the computing task, wherein the exclusive completion notification is generated after tasks other than the computing task on the target processor are migrated to the other processors.
[0062] Based on the overall concept of the processor resource management method provided by the embodiment of the present application, various embodiments of the processor resource management method are proposed. The processor resource management method provided in this application is applied to a cloud computing device having the same or similar structural design as the above-mentioned operating device. Based on the different design needs of actual applications, in different feasible implementation plans, the processor resource management method can of course also be applied to other terminal devices. In order to facilitate understanding and explanation of the technical solution, the following text will use the cloud computing device as the executive body of the solution implementation to illustrate the processor resource management method provided by this application.
[0063] Please refer to Figure 2, which is a flowchart illustrating the steps of an embodiment of a method for managing processor resources provided by the present application. Although the flowchart shows a logical order, in some cases, the method for managing processor resources provided by the present application can also perform the steps in a different order than that shown or described here.
[0064] As shown in FIG2 , the processor resource management method provided in this application may include the following steps:
[0065] Step S10: After starting the computing task to be executed, the computing task is bound to a target processor and the target processor is isolated.
[0066] In this embodiment, after receiving a task request and determining the computing task that needs to be executed by cloud computing processing by parsing the task request, the cloud computing device can first start the computing task to bind the computing task to the currently available target processor, and after the binding is completed, isolate the target processor bound to the current computing task.
[0067] In this embodiment, the above-mentioned computing tasks are units of computing power orchestration in the operating system of the cloud computing device, including processes, threads, containers, virtual machines, etc. Based on the different design needs of actual applications, in different feasible implementation schemes, computing tasks can of course be of different types, but no matter what type of computing task, it can be run according to the processor resource management method provided in this application. Therefore, the processor resource management method provided in the embodiment of this application is not limited to the specific type of computing task.
[0068] The target processor can be any processor object in the operating system of the cloud computing device that supports processor scheduling. For example, the target processor can be a physical CPU (central processing unit), a physical CPU core, a physical CPU hyperthread, a virtual machine CPU, a virtual machine CPU core, or a virtual machine CPU hyperthread.
[0069] Step S20: Migrate tasks other than the computing task on the target processor to other preset processors, so as to run the computing task through the target processor.
[0070] In this embodiment, after the cloud computing device starts the computing task to be executed, binds it to the target processor and performs isolation processing on the target processor, the cloud computing device further performs dynamic task migration processing on the target processor to migrate all or part of the tasks other than the computing task on the target processor to other preset processors, thereby providing sufficient computing power through the target processor to run the computing task.
[0071] In this embodiment, tasks other than the currently executed computing task on the target processor refer to unrelated tasks that have no impact on the computing execution of the computing task. The aforementioned other processors are other processors managed by the task orchestration system interfaced with the operating system of the cloud computing device. The other processors may also be one or more of the aforementioned physical CPU, physical CPU core, physical CPU hyperthread, virtual machine CPU, virtual machine CPU core, and virtual machine CPU hyperthread.
[0072] Step S30: After the computing task is completed, the isolation of the target processor is released.
[0073] In this embodiment, after the cloud computing device performs dynamic task migration on the target processor so that the target processor can run the bound computing task, if the cloud computing device detects that the target processor has completed processing the computing task, that is, the running of the computing task on the current cloud computing device has ended, the cloud computing device can lift the isolation of the target processor, thereby reclaiming the resources of the target processor for subsequent task scheduling.
[0074] For example, as shown in FIG3 , in a feasible embodiment, in the above-mentioned step S10, after starting the computing task to be executed and before binding the computing task to the target processor, the processor resource management method provided by the present application may further include:
[0075] Step A: Parse the received task request;
[0076] In this embodiment, the cloud computing device may receive a task request initiated by a task scheduling system connected to the operating system, and then parse the task request.
[0077] In this embodiment, the task orchestration system refers to the scheduling component of the operating system in the cloud computing device, Kubenetes (abbreviated as K8s, which is an abbreviation formed by replacing the eight characters "ubernete" in the middle of the name with 8. It is an open source and is used to manage containerized applications on multiple hosts in the cloud platform), Openstack (OpenStack is an open source cloud computing management platform project, a combination of a series of software open source projects), and other third-party orchestration systems that support computing power guarantee features.
[0078] Step B: When it is confirmed that the task request carries a computing power guarantee requirement, the task request is treated as a computing task to be executed and started.
[0079] In this embodiment, after the cloud computing device parses the task request initiated by the task orchestration system, if it finds that the task request carries a computing power guarantee service requirement, it determines that the task request is a computing task requiring sufficient computing power and immediately initiates the computing task. The cloud computing device then executes the processes shown in steps S10, S20, and S30 to process the computing task and manage processing resources.
[0080] For example, as shown in FIG4 , after receiving a task request initiated by the task orchestration system and parsing the task request as a task request with computing power guarantee requirements defined by the task orchestration system, the cloud computing device immediately initiates the computing task corresponding to the task request. The cloud computing device then binds the computing task to the target physical CPU or virtual machine vCPU. Furthermore, the cloud computing device performs an isolation operation on the target physical CPU or virtual machine vCPU, setting the target physical CPU or virtual machine vCPU to which the computing task is bound as an isolated CPU from the perspective of the operating system. Finally, the cloud computing device performs a dynamic task migration process on the target physical CPU or virtual machine vCPU where the computing task is located, thereby migrating all other tasks on the target physical CPU or virtual machine vCPU that are not related to the computing task to one or more other CPUs managed by the task orchestration system. This allows the computing task to be run using the computing power provided by the target physical CPU or virtual machine vCPU, ensuring sufficient computing power for the computing task. Moreover, the cloud computing device can start monitoring whether the computing task has been completed at any time point after starting the above-mentioned computing task. After monitoring and confirming that the computing task has been completed, the cloud computing device can reset the target physical CPU or target virtual machine vCPU bound to run the computing task to the manageable state defined by the above-mentioned task orchestration system to facilitate subsequent task orchestration processing.
[0081] In this embodiment, the aforementioned computing power guarantee service demand may also be referred to as a computing power guarantee service requirement. Furthermore, the aforementioned task scheduling system may also typically include, in the initiated task request, a list of identifiers of target processors to which the task needs to be bound for execution. The identifier of each processor in the list typically uses the CPU ID identified by the operating system as an instance. Thus, upon receiving the task request and parsing the list of identifiers of target processors to which the task needs to be bound for execution, the cloud computing device may then call the corresponding target processor to perform task binding.
[0082] In this embodiment, after receiving a task request and determining the computing task that needs to be executed by cloud computing processing by parsing the task request, the cloud computing device can first start the computing task to bind the computing task to the currently available target processor, and then, after the binding is completed, isolate the target processor bound to the current computing task. After that, the cloud computing device further performs task dynamic migration on the target processor to migrate all or part of the tasks on the target processor except the computing task to other preset processors, so that the target processor provides sufficient computing power to run the computing task. Finally, if the cloud computing device detects that the target processor has completed processing the computing task, that is, the operation of the computing task on the current cloud computing device has ended, the cloud computing device can release the isolation made for the target processor, thereby recovering the resources of the target processor for subsequent task scheduling.
[0083] Therefore, this embodiment starts the computing task first and then performs the binding isolation between the task and the target processor. In this way, there is no need to reboot the operating system to modify the processor mask of the target processor in the operating system scheduling component, and the target processor can be set as an isolated processor from the operating system's perspective. Therefore, compared with related technologies, the embodiment of the present application effectively improves the fault tolerance of computing tasks to obtain processor computing power guarantees, thereby solving the technical problem that related technologies are difficult to guarantee the system computing power of cloud computing tasks, while also improving the user experience.
[0084] In addition, the embodiment of the present application also performs dynamic migration processing on other tasks on the target processor that are not related to the task. In this way, the target processor can provide sufficient computing power resources for the operation of the computing task, further ensuring the computing power service quality of the processor for the computing task.
[0085] In addition, based on the first embodiment of the method for managing processor resources provided by the present application, a second embodiment of the method for managing processor resources is proposed.
[0086] As shown in FIG5 , in the second embodiment of the method for managing processor resources provided by the present application, the method for managing processor resources may further include:
[0087] Step S40: After the computing task is finished, the target processor is set to a preset manageable state for scheduling a new task, wherein the manageable state includes an isolated state and a shared state.
[0088] In this embodiment, if the cloud computing device detects that the above-mentioned target processor has completed processing the bound computing task, that is, the execution of the computing task on the current cloud computing device has ended, the cloud computing device can also set the target processor to the isolation state or shared state required by the above-mentioned task orchestration system when recycling the resources of the target processor, so that the task orchestration system can perform the orchestration processing of new tasks.
[0089] For example, in a feasible embodiment, the step of “setting the target processor to a preset manageable state” may include:
[0090] Step S401: setting the target processor to the isolated state or the shared state according to task scheduling requirements.
[0091] In this embodiment, the task orchestration requirement is: the task orchestration system connected to the operating system of the cloud computing device defines the processor resources based on user needs. The operating system receives the task orchestration requirements transmitted in real time by the task orchestration system, and parses the task orchestration requirements to determine whether the recovered target processor needs to be set to an isolated state or a shared state.
[0092] For example, in this embodiment, if the target processor that the cloud computing device currently needs to recycle is already in an isolated state, and the task scheduling requirements currently received and parsed from the task scheduling system also determine that the target processor needs to be set to an isolated state, the cloud computing device will directly recycle the processor without resetting its state. However, if the target processor that the cloud computing device currently needs to recycle is already in an isolated state, but the task scheduling requirements currently received and parsed determine that the target processor needs to be set to a shared state, the cloud computing device will first set the target processor to a shared state before reclaiming its resources.
[0093] For example, as shown in FIG6 , in a feasible embodiment, before the cloud computing device performs isolation processing on the target processor bound to the computing task, the processor resource management method provided by the present application may further include:
[0094] Step a, detecting the manageability state of the target processor;
[0095] In this embodiment, since the cloud computing device may have set the target processor running the previous computing task to an isolated state based on the task scheduling requirements defined by the above-mentioned task scheduling system, after the cloud computing device starts the current computing task to be executed and binds the computing task to the same target processor, before further isolating the target processor bound to the computing task, it is also necessary to detect whether the target processor itself is already in an isolated state.
[0096] Step b, when it is detected that the manageable state is the isolated state, executing the step of migrating tasks other than the computing task on the target processor to other preset processors;
[0097] In this embodiment, when the cloud computing device is detecting the state of the target processor bound to the computing task, if it is detected that the target processor itself is in an isolated state, the cloud computing device can directly execute the above-mentioned step of "migrating tasks other than the computing task on the target processor to other preset processors" for the target processor, thereby migrating all or part of the tasks other than the computing task on the target processor to other preset processors, thereby providing sufficient computing power through the target processor to run the computing task.
[0098] Step c: when it is detected that the manageable state is the shared state, executing the steps of isolating the target processor and migrating tasks other than the computing task on the target processor to other preset processors.
[0099] In this embodiment, when the cloud computing device detects the state of the target processor itself, if it is detected that the target processor itself is in a shared state, the cloud computing device first performs the above-mentioned step of "isolating the target processor" for the target processor to isolate the target processor bound to the current computing task, and then performs the above-mentioned step of "migrating tasks other than the computing task on the target processor to other preset processors" for the target processor to migrate all or part of the tasks other than the computing task on the target processor to other preset processors, thereby providing sufficient computing power through the target processor to run the computing task.
[0100] For example, as shown in FIG4 , when the cloud computing device binds a computing task to a target CPU and begins to set the target physical CPU or virtual machine vCPU to which the computing task is bound to an isolated state from the perspective of the operating system, it first detects whether the target physical CPU or target virtual machine vCPU is currently an isolated CPU. If it is detected that the target physical CPU or target virtual machine vCPU is not currently an isolated CPU, the target physical CPU or target virtual machine vCPU is set to an isolated state. If the target physical CPU or target virtual machine vCPU is currently an isolated CPU, all or part of the tasks on the target physical CPU or virtual machine vCPU that are not related to the computing task to be executed are directly migrated to other CPUs.
[0101] In this embodiment, if the cloud computing device detects that the above-mentioned target processor has completed processing the bound computing task, that is, the execution of the computing task on the current cloud computing device has ended, the cloud computing device can also set the target processor to the isolation state or shared state required by the above-mentioned task orchestration system when recycling the resources of the target processor, so that the task orchestration system can perform the orchestration processing of new tasks.
[0102] However, since the cloud computing device may have set the target processor to an isolated state based on task scheduling requirements, the cloud computing device needs to detect whether the target processor is already in an isolated state before isolating the target processor bound to the current computing task. In this way, if the cloud computing device detects that the target processor itself is in an isolated state, the cloud computing device can directly migrate all or part of the tasks on the target processor except the computing task to other preset processors, thereby providing sufficient computing power to run the computing task through the target processor. If the cloud computing device detects that the target processor itself is in a shared state, it will first isolate the target processor bound to the current computing task, and then migrate all or part of the tasks on the target processor except the computing task to other preset processors, thereby providing sufficient computing power to run the computing task through the target processor.
[0103] Therefore, the processor resource management method provided in this application effectively simplifies the complexity of the task scheduling system. The task scheduling system can call the processor resources on the cloud computing device through a simple scheduling algorithm, and the installation and upgrade links of the physical server and virtual machine operating system of the cloud computing device can also be simplified accordingly.
[0104] In addition, based on the first embodiment and / or second embodiment of the method for managing processor resources provided by the present application, a third embodiment of the method for managing processor resources is proposed.
[0105] As shown in FIG7 , in the third embodiment of the method for managing processor resources provided by the present application, the method for managing processor resources may further include:
[0106] Step I: After starting the computing task, monitoring the running termination event of the computing task, so as to determine that the running of the computing task is completed when the running termination event is detected.
[0107] In this embodiment, after starting the computing task to be executed, the cloud computing device can monitor the operation termination event / operation exit event of the computing task as needed. In this way, after monitoring the operation termination event / operation exit event, the cloud computing device can determine that the operation of the computing task currently being executed by the target processor has ended.
[0108] For example, the cloud computing device may monitor the computing task for a termination event or exit event at any point after the computing task is started, depending on specific scenario requirements. Thus, upon detecting the termination event or exit event, the computing task is determined to have completed execution, and the aforementioned resource recovery operation for the target processor is then performed.
[0109] In this embodiment, the processor resource management method provided by this application monitors and manages computing tasks, thereby ensuring that the target processor used in the running process of the computing task can remain in a manageable state.
[0110] For example, referring to FIG. 8 , in a feasible embodiment, the step of “running the computing task by the target processor” may include:
[0111] Step II: controlling the target processor to execute the computing task when an exclusive completion notification is detected, wherein the exclusive completion notification is generated after migrating tasks other than the computing task on the target processor to the other processors.
[0112] In this embodiment, after the cloud computing device confirms that the target processor bound to the currently executed computing task is in an isolated state and performs task dynamic migration processing on the target processor to migrate other tasks on the target processor that are not related to the computing task to other processors, the cloud computing device can generate an exclusive completion notification. In this way, when the cloud computing device detects the exclusive completion notification during real-time monitoring, it can control the target processor to use all of its own computing power to run the computing task.
[0113] In this embodiment, the cloud computing device controls the target processor to start running the computing task only after it determines that there are no tasks unrelated to the computing task on the target processor bound to the computing task. In this way, it ensures that the target processor uses all of its own computing power to run the computing task, thereby providing sufficient computing power guarantee for the computing task.
[0114] In addition, referring to FIG9 , an embodiment of the present application further provides a processor resource management device, the processor resource management device comprising: a task management unit, a binding unit, an isolation unit, and an exclusion unit respectively connected to the task management unit;
[0115] The task management unit is configured to start a computing task to be executed and, after the computing task is completed, release the isolation of the target processor bound to the computing task;
[0116] The binding unit is configured to bind the computing task started by the task management unit to a target processor;
[0117] The isolation unit is configured to isolate the target processor bound to the computing task;
[0118] The exclusive unit is configured to migrate tasks other than the computing task on the isolated target processor to other preset processors.
[0119] In this embodiment, the processor resource management device can also be referred to as a device for ensuring the quality of service of task computing power. The task management unit (also referred to as the task lifecycle management unit) is mainly responsible for completing lifecycle operations such as task running and stopping, and managing the task running status based on the request of the external task scheduling system. The binding unit is mainly used to provide binding operations between computing tasks and target CPUs for running tasks from the perspective of operating system scheduling. The computing power required for computing tasks is provided by the target CPUs to which they are bound. In addition, the binding unit supports binding a computing task to one or more target physical CPUs, and also supports binding a task to one or more target virtual machine vCPUs.
[0120] In addition, the isolation unit of the management device mainly provides dynamic isolation of the target physical CPU or virtual machine vCPU bound to the computing task, that is, without rebooting the operating system, the CPU mask of the target physical CPU or virtual machine vCPU in the operating system scheduling component is modified, so that it is no longer accepted by the operating system as an optional CPU for running scheduling of new tasks. The isolation unit supports setting one or more target physical CPUs as isolated CPUs from the perspective of the operating system scheduling, and also supports setting one or more target virtual machine vCPUs as isolated CPUs from the perspective of the operating system scheduling.
[0121] The exclusive unit of the management device mainly provides dynamic exclusive migration of irrelevant tasks to the target physical CPU or virtual machine vCPU bound to the computing task (migrating all tasks unrelated to the currently executed computing task to other processors), so that only the currently executed computing task runs on the target physical CPU or virtual machine vCPU. Similarly, the exclusive unit also supports dynamic exclusive migration of irrelevant tasks on one or more target physical CPUs, and supports dynamic exclusive migration of irrelevant tasks on one or more target virtual machine vCPUs.
[0122] Exemplarily, the task management unit is further configured to set the target processor to a preset manageable state for scheduling and running new tasks after the computing task is completed, wherein the manageable state includes: an isolated state and a shared state.
[0123] Exemplarily, the task management unit is further configured to set the target processor to the isolated state or the shared state according to a preset task scheduling requirement.
[0124] Exemplarily, the isolation unit is further configured to detect a manageability state of the target processor; and isolate the target processor when it is detected that the manageability state is the shared state.
[0125] Exemplarily, the task management unit is further configured to parse a preset task request; when the analysis confirms that the task request carries a computing power guarantee requirement, the task request is treated as a computing task to be executed and started.
[0126] Exemplarily, the task management unit is further configured to monitor an operation termination event of the computing task after starting the computing task, so as to determine that the operation of the computing task is terminated when the operation termination event is detected.
[0127] Exemplarily, the task management unit is further configured to control the target processor to run the computing task when an exclusive completion notification is detected, wherein the exclusive completion notification is generated after migrating tasks other than the computing task on the target processor to the other processors.
[0128] For example, as shown in Figure 4, when the processor resource management device provided by the embodiment of the present application is running, the task management unit first receives and parses the task request with computing power guarantee service requirements, and then the task management unit determines the task request as a computing task that is currently to be executed and requires computing power guarantee, and starts the computing task.
[0129] Then, the task management unit requests the binding unit to bind the computing task to the target physical CPU or virtual machine vCPU. The binding unit binds the computing task to the target physical CPU or virtual machine vCPU according to the received request.
[0130] Afterwards, the task management unit further requests the isolation unit to set the target physical CPU or virtual machine vCPU where the computing task is located as the isolated CPU from the perspective of the operating system. The isolation unit first analyzes and determines whether the target physical CPU or target virtual machine vCPU bound to the computing task is already an isolated CPU at the current moment. If the target physical CPU or target virtual machine vCPU is not currently an isolated CPU, the isolation unit will set the target physical CPU or target virtual machine vCPU status to an isolated CPU and inform the task life unit that the binding has been completed. If the target physical CPU or target virtual machine vCPU is currently an isolated CPU, the isolation unit will directly inform the task management unit that the binding has been completed.
[0131] The task management unit then requests the exclusive unit to migrate unrelated tasks from the target physical CPU or virtual machine vCPU where the task is located to other CPUs. The exclusive unit then migrates unrelated tasks from the target physical CPU or virtual machine vCPU where the computing task is located to other CPUs and notifies the task life unit that the exclusive request has been completed. Furthermore, upon receiving the exclusive completion notification from the exclusive unit, the task management unit controls the target physical CPU or virtual machine vCPU to begin executing the computing task using its full computing power.
[0132] Furthermore, the task management unit can monitor termination / exit events of a computing task at any point after it is started, depending on the specific scenario requirements. Based on the received task termination / exit events, the target physical CPU or target virtual machine vCPU of the computing task can be set to the isolated or shared state defined by the task orchestration system.
[0133] The processor resource management device provided in this application utilizes the processor resource management method described in the aforementioned embodiments to address the technical issue in related technologies of difficulty in ensuring system computing power for cloud computing tasks. Compared to related technologies, the beneficial effects of the processor resource management device provided in this application embodiment are the same as those of the processor resource management method described in the aforementioned embodiments. Other technical features of the processor resource management device are the same as those disclosed in the aforementioned embodiments and are not further elaborated here.
[0134] In addition, an embodiment of the present application also provides a cloud computing device, which includes: a processor resource management device as described above, a memory, a processor, and a computer program stored on the memory and runnable on the processor, wherein the computer program is configured to implement the processor resource management method as described above or the steps of the processor resource management method as described above.
[0135] In addition, an embodiment of the present application also provides a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, it implements the processor resource management method described above or the steps of the processor resource management method described above.
[0136] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or system comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or system. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or system comprising the element.
[0137] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0138] The above are merely optional embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for managing processor resources, wherein: The method comprises: After starting the computing task to be executed, binding the computing task to a target processor and isolating the target processor; Migrating tasks other than the computing task on the target processor to other preset processors, so as to run the computing task through the target processor; After the computing task is finished running, the isolation of the target processor is released.
2. The method for managing processor resources according to claim 1, wherein: The method further comprises: After the computing task is finished, the target processor is set to a preset manageable state for scheduling and running new tasks, wherein the manageable state includes: an isolated state and a shared state.
3. The method for managing processor resources according to claim 2, wherein: The step of setting the target processor to a preset manageable state includes: The target processor is set to the isolated state or the shared state according to task scheduling requirements.
4. The method for managing processor resources according to claim 2, wherein: Before isolating the target processor, the method further includes: detecting a manageability state of the target processor; When it is detected that the manageable state is the isolated state, performing the step of migrating tasks other than the computing task on the target processor to other preset processors; In the case where it is detected that the manageable state is the shared state, the steps of isolating the target processor and migrating tasks other than the computing task on the target processor to other preset processors are performed.
5. The method for managing processor resources according to claim 1, wherein: After starting the computing task to be executed and before binding the computing task to the target processor, the method further includes: Parse the received task request; When it is confirmed through analysis that the task request carries a computing power guarantee requirement, the task request is taken as a computing task to be executed and started.
6. The method for managing processor resources according to any one of claims 1 to 5, wherein: The method further comprises: After the computing task is started, an operation termination event of the computing task is monitored, so as to determine that the operation of the computing task is completed when the operation termination event is detected.
7. The method for managing processor resources according to any one of claims 1 to 5, wherein: The step of running the computing task by the target processor includes: In the case of detecting an exclusive completion notification, controlling the target processor to execute the computing task, wherein the exclusive completion notification is a process of migrating tasks other than the computing task on the target processor to the other processor. Generated after the processor.
8. A processor resource management device, wherein: The management device comprises a task management unit, a binding unit, an isolation unit and an exclusive unit respectively connected to the task management unit; The task management unit is configured to start the computing task to be executed, and after the computing task is finished running, release the isolation of the target processor bound to the computing task; The binding unit is configured to bind the computing task started by the task management unit to a target processor; The isolation unit is configured to isolate the target processor bound to the computing task; The exclusive unit is configured to migrate tasks other than the computing task on the isolated target processor to other preset processors.
9. A cloud computing device, wherein: The cloud computing device comprises: a processor resource management device as described in claim 8, a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the processor resource management method as described in any one of claims 1 to 7.
10. A storage medium, wherein: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for managing processor resources according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Processor isolating method and device based on KVM (K virtual machine) virtualization technology
CN106775927A
Data processing method and device and storage medium
CN110333899A
Task isolation method and device, operating system, equipment and storage medium
CN113296938A
Method and apparatus for dynamically allocating and deallocating processors in a logical partitioned data processing system
CN1653425A
Partitioned Shared Processor Interrupt-intensive Task Segregator
US20130179616A1
Cited By
CPU dynamic isolation method based on lightweight cloud native operating system
CN120029738A
Decoding resource inter-domain circulation control method, device and equipment and readable storage medium
CN121940540A
