CN-121979689-A - Controller slicing method, electronic device, computer storage medium and program product
Abstract
The application provides a controller slicing method, electronic equipment, a computer storage medium and a program product, wherein the method comprises the steps that a master controller monitors the running states of a plurality of slave controllers, each slave controller is provided with a corresponding slicing label, a master controller obtains a user-defined resource object to be scheduled, the user-defined resource object is used for describing a user task, the master controller determines a target slave controller from the plurality of slave controllers based on the running state of each slave controller and the attribute of the user-defined resource object to be scheduled, the master controller distributes the slicing labels of the target slave controllers to the user-defined resource object to obtain the user-defined resource object carrying the slicing labels, and the master controller dispatches the user-defined resource object carrying the slicing labels to the target slave controllers to enable the target slave controllers to carry out tuning processing on the user-defined resource object, so that the usability of a system is improved.
Inventors
- WU ZHONGJIAN
- LI LI
- WU YINGJUN
- WANG ZHUANG
Assignees
- 中移(苏州)软件技术有限公司
- 中国移动通信集团有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260407
Claims (10)
- 1. A controller slicing method, the method comprising: The method comprises the steps that a master controller monitors the running states of a plurality of slave controllers, wherein each slave controller is provided with a corresponding fragment tag; the main controller acquires a user-defined resource object to be scheduled, wherein the user-defined resource object is used for describing a user task; the master controller determines a target slave controller from the plurality of slave controllers based on the running state of each slave controller and the attribute of the to-be-scheduled custom resource object; The master controller distributes the slicing labels of the target slave controllers for the self-defined resource objects to obtain the self-defined resource objects carrying the slicing labels; And the master controller dispatches the self-defined resource object carrying the fragment tag to the target slave controller so that the target slave controller carries out tuning processing on the self-defined resource object.
- 2. The method of claim 1, wherein the master controller comprises a processing unit, an allocation unit, and a scheduling unit, wherein, Tuning the user-defined resource object carrying the main controller tag through the processing unit; The partitioning label is distributed for the user-defined resource object to be scheduled through the distribution unit; Scheduling the user-defined resource object carrying the slicing label to a slave controller corresponding to the slicing label through the scheduling unit; The slave controller comprises a tuning unit, wherein the tuning unit is used for performing tuning processing on the custom resource object carrying the corresponding fragment tag.
- 3. The method of claim 2, wherein the scheduling unit comprises a first scheduler, the method further comprising: The main controller starts the first scheduler; acquiring an available slicing list through the first scheduler, wherein the available slicing list is used for storing a slave controller in a health state and a slicing label corresponding to the slave controller; judging whether the self-defined resource object to be scheduled is allocated with a fragment tag or not through the first scheduler, and selecting a target slave controller from the available fragment list if the self-defined resource object to be scheduled is not allocated with the fragment tag; distributing the target slave control fragment tag for the user-defined resource object to be scheduled through the first scheduler; and dispatching the customized resource object carrying the fragment tag to the target slave controller through the first dispatcher.
- 4. The method of claim 2, wherein the scheduling unit comprises a second scheduler, the method further comprising: the main controller starts the second scheduler, and the second scheduler comprises a scheduling policy configuration field; acquiring an available slicing list through the second scheduler, wherein the available slicing list is used for storing a slave controller in a health state and a slicing label corresponding to the slave controller; selecting, by the second scheduler, a target slave controller from the list of available shards based on a polling policy; distributing the target slave control fragment tag for the user-defined resource object to be scheduled through the second scheduler; And scheduling the custom resource object carrying the fragment tag to the target slave controller through the second scheduler.
- 5. The method of claim 4, wherein the scheduling policy configuration field comprises one or more of: a first field, configured to represent a read-write lock, where the read-write lock is configured to protect concurrent access to the available shard list; A second field for identifying the second scheduler; A third field for indicating a resynchronization period indicating a time interval for periodically refreshing the list of available slices; a fourth field, configured to indicate the available shard list, where the available shard list is used to store a mapping relationship between an available slave controller and a health status of the available slave controller; A fifth field for representing an atomic counter for implementing the polling policy; A sixth field for listening and buffering resource states of the plurality of slave controllers, the resource states being used to reflect tuning pressures of the corresponding slave controllers; A seventh field for creating a new slave controller in response to the fragmented capacity expansion instruction, and deleting the specified slave controller in response to the fragmented capacity contraction instruction; an eighth field for recording its shard label and health status to the available shard list when a new slave controller is added or updated, and removing it from the available shard list when a specified slave controller is deleted; and a ninth field for clearing and reconstructing the available shard list according to the resynchronization period.
- 6. The method according to any one of claims 1 to 5, further comprising: The master controller acquires index data of each slave controller, wherein the index data comprises one or more of central processing unit utilization rate, memory utilization rate, request processing delay, throughput, error rate, concurrent request number and task queue length; The master controller judges whether to execute the slicing management operation based on the index data and/or the running state of each slave controller, wherein the slicing management operation comprises one or more of task migration, slicing capacity expansion and slicing capacity reduction.
- 7. The method according to any one of claims 1 to 5, further comprising: the master controller calculates a tuning pressure value of each slave controller; The main controller judges whether the number of slave controllers needs to be adjusted or not based on the tuning pressure value; if the tuning pressure value exceeds a preset capacity expansion threshold value, the main controller sends out a fragmentation capacity expansion instruction, and calls a creating unit to execute the fragmentation capacity expansion instruction; And if the tuning pressure value is lower than a preset capacity reduction threshold value, the main controller sends out a fragmentation capacity reduction instruction and calls a deleting unit to execute the fragmentation capacity reduction instruction.
- 8. An electronic device, the electronic device comprising: a memory for storing computer executable instructions or computer programs; a processor for implementing the method of any of claims 1 to 7 when executing computer executable instructions or computer programs stored in the memory.
- 9. A computer readable storage medium storing a computer program for causing a computer to perform the method of any one of claims 1 to 7.
- 10. A computer program product comprising computer program instructions for causing a computer to perform the method of any one of claims 1 to 7.
Description
Controller slicing method, electronic device, computer storage medium and program product Technical Field The present application relates to the field of cloud native technologies, and in particular, to a controller slicing method, an electronic device, a computer storage medium, and a program product. Background In the Kubernetes (K8 s) system, the controller is the core component that enables automated management and state tuning. It ensures that the actual state is consistent with the desired state by continually monitoring and adjusting the resource objects in the cluster. With the expansion of the application scale of K8s, particularly in large-scale clusters and complex business scenarios, the management requirements for custom resources are significantly increased, and the traditional controller architecture faces higher performance and stability challenges. The prior art generally depends on a fixed slicing or static allocation strategy, lacks dynamic adaptation capability to the running state and task attribute of a controller, easily causes the problems of overload of part of controllers and low utilization rate of other controllers when facing high load, heterogeneous tasks and uneven resource distribution, influences the overall scheduling efficiency and the system response capability, and is difficult to meet flexible scheduling requirements in a large-scale and high concurrency scene. Disclosure of Invention To solve the above technical problems, embodiments of the present application provide a controller slicing method, an electronic device, a computer readable storage medium, and a computer program product. The controller slicing method provided by the embodiment of the application comprises the following steps: The method comprises the steps that a master controller monitors the running states of a plurality of slave controllers, wherein each slave controller is provided with a corresponding fragment tag; the main controller acquires a user-defined resource object to be scheduled, wherein the user-defined resource object is used for describing a user task; the master controller determines a target slave controller from the plurality of slave controllers based on the running state of each slave controller and the attribute of the to-be-scheduled custom resource object; The master controller distributes the slicing labels of the target slave controllers for the self-defined resource objects to obtain the self-defined resource objects carrying the slicing labels; And the master controller dispatches the self-defined resource object carrying the fragment tag to the target slave controller so that the target slave controller carries out tuning processing on the self-defined resource object. The electronic equipment provided by the embodiment of the application comprises a processor and a memory, wherein the memory is used for storing a computer program, and the processor is used for calling and running the computer program stored in the memory to execute any controller slicing method. The computer readable storage medium provided by the embodiment of the application is used for storing a computer program, and the computer program enables a computer to execute any controller slicing method. The computer program product provided by the embodiment of the application comprises computer program instructions, wherein the computer program instructions enable a computer to execute any one of the controller slicing methods. According to the technical scheme, a master controller monitors the running states of a plurality of slave controllers, each slave controller is provided with a corresponding slicing label, the master controller obtains a self-defined resource object to be scheduled, the self-defined resource object is used for describing a user task, the master controller determines a target slave controller from the plurality of slave controllers based on the running state of each slave controller and the attribute of the self-defined resource object to be scheduled, allocates the slicing label of the target slave controller to the self-defined resource object to obtain the self-defined resource object carrying the slicing label, and schedules the self-defined resource object carrying the slicing label to the target slave controller to enable the target slave controller to tune the self-defined resource object, so that the self-defined resource object in the user task is combined with the self-defined resource object attribute in the user task, the proper slave controller is selected, the corresponding slicing label is allocated to the target slave controller, and the task is scheduled to the slave controller. The mechanism can dynamically match tasks with controllers, avoid overload of a single controller and improve load balancing capability and high availability of the whole system. Meanwhile, as the tasks are only processed by the slave controllers with the corresponding slicing labels, task iso