Method and apparatus for resource scheduling facing digital base

By prioritizing the control tasks of the digital base station according to their urgency and scheduling the server cluster load status, the problem of unreasonable resource allocation among multiple devices was solved, task execution efficiency was improved and latency was reduced.

CN122111660APending Publication Date: 2026-05-29GREE ELECTRIC APPLIANCE INC OF ZHUHAI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GREE ELECTRIC APPLIANCE INC OF ZHUHAI
Filing Date
2026-02-09
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, the multiple devices connected to the digital dock cannot achieve reasonable resource allocation, resulting in excessive server load and excessively long task processing delays.

Method used

By acquiring control tasks sent by multiple devices associated with the digital dock, prioritizing them based on their urgency, packaging the control logic program corresponding to each control task into an independent container, and placing it in the corresponding priority task queue based on the priority order, the target server is controlled to run the container corresponding to the target control task in combination with the load status of the server cluster to execute the target control task.

Benefits of technology

It enables stable and effective execution of emergency tasks, improves the efficiency of control task execution, reduces processing latency, and avoids situations where emergency tasks cannot be executed due to excessive server load.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122111660A_ABST
    Figure CN122111660A_ABST
Patent Text Reader

Abstract

The application relates to a resource scheduling method and device for a digital base, wherein the method comprises the following steps: acquiring control tasks sent by a plurality of devices associated with the digital base, and performing priority sorting on the plurality of control tasks based on emergency degrees; packing control logic programs corresponding to the control tasks into independent containers, and placing the control tasks in task queues corresponding to priorities based on the priority sorting; extracting corresponding target control tasks from the task queues according to a priority order and a time polling strategy, and combining a load state of a server cluster to control a target server to run a container corresponding to the target control task to execute the target control task. Through the application, the problem that a plurality of devices connected to a digital base cannot be reasonably allocated with resources in the prior art, resulting in that a server runs with excessive load and task processing is excessively delayed, is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of resource scheduling for digital infrastructure, and more particularly to a resource scheduling method and apparatus for digital infrastructure. Background Technology

[0002] With the rapid development of industrial digitalization, an increasing number of smart building projects require the integration of big data and cloud computing technologies to optimize complex tasks within complex building engineering. Digital infrastructure, as an infrastructure capable of integrating multiple smart building projects, connects multiple devices for unified management, enabling comprehensive intelligent lifecycle management from data acquisition, transmission, processing, storage, and analysis. In existing IoT system device access scenarios, the control logic program for each device needs to be pre-adapted on edge or terminal devices. However, facing multi-source, heterogeneous device access, unified resource management and reasonable allocation are impossible, leading to excessive server load and excessively long task processing delays. Summary of the Invention

[0003] This application provides a resource scheduling method and apparatus for digital docking stations to solve the problem in the prior art that the resources of multiple devices connected to a digital docking station cannot be reasonably allocated, resulting in excessive server load and excessive delay in task processing.

[0004] In a first aspect, this application provides a resource scheduling method for a digital docking station, comprising: acquiring control tasks sent by multiple devices associated with the digital docking station, and prioritizing the multiple control tasks based on their urgency; packaging the control logic program corresponding to the control task into an independent container, and placing the control task in a task queue of corresponding priority based on the priority order; wherein each task queue has a corresponding processing time, and the higher the priority of the task queue, the shorter the corresponding processing time; extracting the corresponding target control task from the task queue according to the priority order and time polling strategy, and controlling the target server to run the container corresponding to the target control task to execute the target control task in combination with the load status of the server cluster.

[0005] Optionally, prioritizing the multiple control tasks based on their urgency includes: determining the task type of each control task, determining the corresponding signal light flashing frequency based on the response speed of the task type, and determining the corresponding complexity based on the task type, wherein a higher flashing frequency corresponds to a shorter response speed; determining the urgency of each control task based on the signal light flashing frequency and the complexity, wherein the signal light flashing frequency is directly proportional to the urgency, and the complexity is inversely proportional to the urgency; and prioritizing the multiple control tasks based on their urgency.

[0006] Optionally, extracting the corresponding target control task from the task queue according to priority order and time polling strategy, and controlling the target server to run the container corresponding to the target control task to execute the target control task in combination with the load status of the server cluster, includes: extracting the target control task in the current queue in descending order of priority, starting from the task queue with the highest priority; wherein, the target control task is a control task in any task queue; selecting the target server corresponding to the target control task from the server cluster based on the load status of the server cluster; controlling the target server to run the container corresponding to the target control task to execute the target control task within the processing time corresponding to the current task queue; if the target control task has been completed within the processing time corresponding to the current task queue, extracting the target control task from the task queue with the next higher priority and repeating the above process; if the target control task has not been completed within the processing time corresponding to the current task queue, moving the unfinished target control task to the tail of the task queue with the next higher priority and repeating the above process.

[0007] Optionally, the method further includes: if, during the execution of a target control task in any task queue, a new control task enters the task queue and the priority of the new control task is higher than that of the task queue currently executing the control task, the currently executing target control task is terminated, and the control server runs a container corresponding to the new control task to execute the new control task.

[0008] Optionally, the method further includes: if the waiting time of an unexecuted control task exceeds a preset time, transferring the unexecuted control task from the current task queue to a task queue with a higher priority.

[0009] Optionally, the method further includes: if the target control task has been completed within the processing time corresponding to the current task queue and the processing time has not expired, deleting the currently executed control task from the current task queue and starting to execute the control task from the head of the current task queue.

[0010] Optionally, controlling the target server to run a container corresponding to the target control task to execute the target control task includes: defragmenting the memory resources in the target server, wherein defragmentation refers to moving the memory addresses of the containers running on the target server to merge idle memory resources.

[0011] Secondly, this application provides a resource scheduling device for a digital docking station, comprising: a first processing module, configured to acquire control tasks sent by multiple devices associated with the digital docking station, and prioritize the multiple control tasks based on their urgency; a second processing module, configured to package the control logic program corresponding to the control task into an independent container, and place the control task in a task queue of corresponding priority based on the priority ranking; wherein each task queue has a corresponding processing time, and the higher the priority of the task queue, the shorter the corresponding processing time; and a third processing module, configured to extract the corresponding target control task from the task queue according to the priority order and time polling strategy, and control the target server to run the container corresponding to the target control task to execute the target control task in combination with the load status of the server cluster.

[0012] Thirdly, this application provides an electronic device, comprising: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to execute the resource scheduling method for digital docking stations described in the first aspect of this application.

[0013] Fourthly, this application also provides a computer storage medium storing computer-executable instructions for executing the resource scheduling method for digital docking stations described in the first aspect of this application.

[0014] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application, after acquiring control tasks sent by multiple devices associated with the digital dock, can prioritize these control tasks based on their urgency. Then, the control logic program corresponding to each control task is packaged into an independent container, and the control tasks are placed in the corresponding priority task queue based on priority. Finally, the corresponding target control task is extracted from the task queue according to priority order and a time-based polling strategy. The target server is then controlled to run the container corresponding to the target control task to execute the target control task, taking into account the load status of the server cluster. Therefore, in this application embodiment, after prioritizing the control tasks according to their task type, higher-priority control tasks are executed first, i.e., control tasks corresponding to task types with higher urgency are executed first. Furthermore, the corresponding control tasks can be executed according to the load status of the server cluster, allowing servers with lighter loads to execute higher-urgency control tasks, ensuring that urgent tasks are executed stably and effectively, and avoiding situations where urgent tasks cannot be executed due to excessive server load. Thus, the method in this application embodiment not only improves the execution efficiency of control tasks but also reduces the processing latency of control tasks. Attached Figure Description

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

[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.

[0017] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0018] Figure 1 A flowchart illustrating a resource scheduling method for a digital platform, as provided in this application embodiment; Figure 2 This is a schematic diagram of the multi-container control strategy scheduling architecture provided in the embodiments of this application; Figure 3 A flowchart illustrating a multi-device control strategy scheduling method for digital docking stations provided in this application embodiment; Figure 4This is a schematic diagram of a multi-queue priority + round-robin task orchestration mechanism provided in an embodiment of this application; Figure 5 Flowchart of the multi-queue priority + polling method provided in the embodiments of this application; Figure 6 This is a schematic diagram of the container cluster resource scheduling mechanism provided in the embodiments of this application; Figure 7 A schematic diagram of a resource scheduling device for a digital base station provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0021] To address the problem in existing technologies where resources cannot be allocated effectively across multiple devices connected to a digital dock, leading to excessive server load and long task processing delays, this application provides a resource scheduling method for digital docks, such as... Figure 1 As shown, the steps of this method include: Step 101: Obtain control tasks sent by multiple devices associated with the digital dock, and prioritize the multiple control tasks based on their urgency. The digital infrastructure comprises three layers: a device access layer, a digital infrastructure layer, and a business application layer. The device access layer provides access for various terminals and can accept a large number of devices, including third-party devices, to collect various production data. The digital infrastructure layer is a multi-technology combination of building systems, providing infrastructure for the IoT system's device access, protocol processing, logic control, and cloud deployment needs. It can be uniformly managed through a cloud platform, including computing, storage, analysis, and intelligent decision-making. The digital infrastructure requires a cluster of servers for support. Multiple device access is handled through a central task processing device for resource scheduling and task allocation, distributing device processing tasks to different servers. The business application layer leverages the cloud computing, big data analytics, and AI decision-making interfaces provided by the digital infrastructure to empower upper-layer applications. The business application layer is closely aligned with various smart production scenarios, such as smart parks, smart factories, smart agriculture, smart buildings, and smart homes.

[0022] In specific examples, the task type of the control task in this application embodiment may include: 1) Real-time data acquisition tasks: These require rapid response, such as sensor data acquisition in IoT devices. They require RS485, Modbus, and CAN interfaces, and involve multiple devices acquiring and controlling data in real time. Therefore, any task with RS485, Modbus, or CAN interfaces falls into this category.

[0023] 2) Interactive tasks for device control: These require rapid response to user requests, such as querying and updating the database. An Ethernet interface is required.

[0024] 3) Data analysis batch processing tasks: Tasks that do not have high time requirements but consume a lot of resources, such as large-scale computing and data analysis.

[0025] Specifically, the urgency of these three task types is as follows: real-time tasks are more urgent than interactive tasks, and interactive tasks are more urgent than batch processing tasks. Therefore, the corresponding priority order from highest to lowest is real-time tasks, interactive tasks, and batch processing tasks.

[0026] Step 102: Package the control logic program corresponding to the control task into an independent container, and place the control task in the corresponding priority task queue based on priority sorting; wherein, each task queue has a corresponding processing time, and the higher the priority of the task queue, the shorter the corresponding processing time. It's important to note that the server is the resource provider, and a single server can run multiple containers simultaneously. Containers are the resource consumers; each container is allocated a certain amount of resources, such as CPU and memory, when it is created to execute the control logic program for control tasks.

[0027] Furthermore, the priority of task queues is matched with the priority of control tasks. Higher-priority control tasks must be placed in higher-priority task queues. Different priority task queues have different processing times; the higher the priority, the shorter the processing time. This is because higher priority indicates a more urgent control task within that queue, thus requiring faster processing. Processing time can be divided into units of time. For example, if there are three task queues with decreasing priorities: Queue 1, Queue 2, and Queue 3, Queue 1 corresponds to 1 unit of time, Queue 2 to 2 units of time, and Queue 3 to 3 units of time. By setting the priority and processing time of task queues, it is ensured that high-priority control tasks are processed first and completed in a shorter time, matching the urgency of the control tasks.

[0028] Step 103: Extract the corresponding target control task from the task queue according to priority order and time polling strategy, and control the target server to run the container corresponding to the target control task to execute the target control task in combination with the load status of the server cluster.

[0029] In this embodiment of the application, the time polling strategy refers to selecting the highest priority task in the corresponding task queue to execute the control task, and running the control task according to the set processing time. If the task is not completed within the running time, the control task will be moved to the next lower priority task queue and the above process will be repeated.

[0030] Through steps 101 to 103 above, after obtaining control tasks sent by multiple devices associated with the digital dock, the multiple control tasks can be prioritized based on their urgency. Then, the control logic programs corresponding to the control tasks are packaged into independent containers, and the control tasks are placed in task queues of corresponding priorities based on their priority. Finally, the corresponding target control task is extracted from the task queue according to priority order and a time-based polling strategy. The target server is then controlled to run the container corresponding to the target control task to execute the target control task, taking into account the load status of the server cluster. Therefore, in this embodiment, after prioritizing the control tasks according to their task types, the priority can be optimized. Prioritizing control tasks, especially those with higher urgency, allows for their execution first. Furthermore, control tasks can be tailored to the server cluster's load status. This ensures that servers with lighter loads can execute higher-urgency control tasks, guaranteeing the stable and effective execution of urgent tasks. It also prevents situations where excessive server load prevents the execution of urgent tasks. Therefore, this embodiment intelligently directs traffic to higher-performance containers, optimizing overall throughput, reducing latency, and improving system stability. This not only improves the execution efficiency of control tasks but also reduces their processing latency.

[0031] In an optional embodiment of this application, the method of prioritizing multiple control tasks based on urgency in step 101 above may further include: Step 11: Determine the task type of the control task, and determine the corresponding signal light flashing frequency based on the response speed of the task type, and determine the corresponding complexity based on the task type. The higher the flashing frequency, the shorter the response speed. Step 12: Determine the urgency of the control task based on the flashing frequency and complexity of the traffic lights, where the flashing frequency of the traffic lights is directly proportional to the urgency and the complexity is inversely proportional to the urgency. Step 13: Prioritize multiple control tasks based on their urgency.

[0032] In specific examples, control tasks can be categorized into the following types: 1) Real-time task data acquisition by the device: requires a rapid response, such as sensor data acquisition in IoT devices, and is displayed by flashing red indicator lights.

[0033] 2) Interactive tasks for device control: These require rapid response to user requests, such as querying and updating the database. An Ethernet interface is required, and a flashing green indicator light must be configured.

[0034] 3) Data analysis batch processing tasks: Tasks that do not have high time requirements but consume a lot of resources, such as large-scale computing and data analysis, and are set to flash yellow indicator lights.

[0035] Therefore, the priority ranking based on response speed and complexity, from highest to lowest, is: real-time tasks, interactive tasks, and batch processing tasks. Using different semaphore colors to represent different priorities allows for quick identification of the current control task's priority. Furthermore, the flashing frequency of the semaphore is proportional to the urgency level. Thus, semaphores not only quickly identify the priority of the current control task but also its urgency, facilitating subsequent processing of control tasks with different priorities and urgency levels.

[0036] Based on this, in the specific example, there are three task queues corresponding to the three task types mentioned above, with priority from high to low as Q1, Q2, and Q3: Q1: Real-time task, high priority, assuming a processing time of 1 unit of time (applicable to I / O intensive tasks), with the indicator light set to red and flashing at a frequency of 1 unit of time. In this application, the unit of time can be set according to actual needs, such as 20ms, 30ms, etc.

[0037] Q2: Medium priority, assuming a processing time of 2 units of time (suitable for lightweight control tasks), and setting the semaphore to green with a flashing frequency of 2 units of time.

[0038] Q3: Low priority, assuming a processing time of 4 units of time (suitable for computationally intensive tasks), and setting the semaphore to yellow with a flashing frequency of 4 units of time.

[0039] In this embodiment of the application, the method of extracting the corresponding target control task from the task queue according to priority order and time polling strategy in step 103 above, and controlling the target server to run the container corresponding to the target control task to execute the target control task in combination with the load status of the server cluster, may further include: Step 21: Extract the target control tasks from the current queue in descending order of priority, starting with the highest priority task queue; where the target control task is any control task in any task queue. Step 22: Select the target server corresponding to the target control task from the server cluster based on the load status of the server cluster; Step 23: Within the processing time corresponding to the current task queue, control the target server to run the container corresponding to the target control task in order to execute the target control task; Step 24: If the target control task has been completed within the processing time corresponding to the current task queue, extract the target control task from the next priority task queue and repeat the above process; if the target control task has not been completed within the processing time corresponding to the current task queue, move the unfinished target control task to the tail of the next priority task queue and repeat the above process.

[0040] For the target control task in steps 21 to 24 above, it refers to the control task currently being executed. For example, if control task 1 in the highest priority task queue is currently being executed, then the target control task is control task 1. If control task 2 in the second highest priority task queue is currently being executed, then the target control task is control task 2, and so on. Processing time refers to the total time that the task queue can take to execute the target control task. The processing time of task queues with different priorities is different. For example, if there are 3 task queues, task queue 1 has the shortest processing time (1 unit of time) and the highest priority; task queue 2 has the next shortest processing time (2 units of time) and the second highest priority; and task queue 3 has the shortest processing time (3 units of time) and the lowest priority.

[0041] In a specific example, this could be as follows: There are currently three control tasks T1, T2, and T3. T1 enters the high-priority queue Q1 (red semaphore, 1 unit of time), T2 enters the medium-priority queue Q2 (green semaphore, 2 units of time), and T3 enters the low-priority queue Q3 (yellow semaphore, 4 units of time). Based on this, T1 is first retrieved from Q1 and executed for 1 unit of time. If T1 is not completed (still needs 1 unit of time), it is demoted to Q2. After Q1 is empty, tasks (currently T1 and T2) are retrieved from Q2. Following the FIFO principle, T1 is executed first (completed within 1 unit of time, released), then T2 is executed for 1 unit of time. After a total of 2 units of time are executed in Q2, the corresponding processing time limit is reached. If T2 is still not completed at this point, it is demoted to Q3. When Q1 and Q2 are empty, tasks (currently T2 and T3) are retrieved from Q3. First, execute T2 (3 units of time remaining), which completes within the Q3 time slice (4 units of time). Then execute T3, which does not complete after 4 units of time, and remains in Q3 waiting for the next round.

[0042] As can be seen, in this embodiment, the priority and time-based polling strategy ensures that higher-priority control tasks are always processed first and that processing response speed is guaranteed. Furthermore, in this embodiment, the server handling the control task is determined by the load status of the server cluster; that is, a server with a lighter load is selected from the server cluster to process the control task. This not only avoids creating additional load on other servers but also improves processing efficiency by using a lighter-loaded server.

[0043] Based on steps 21 to 24 above, the method in this application embodiment may further include: Step 31: If, during the execution of a target control task in any task queue, a new control task enters the task queue and has a higher priority than the task queue currently executing the control task, the currently executing target control task is aborted, and the control server runs the container corresponding to the new control task to execute the new control task.

[0044] As can be seen from step 31 above, if a new control task is added to the task queue during the execution of a control task, and the priority of the new control task is higher than that of the currently executing control task, then the currently executing target control task is aborted, and the control server runs the container corresponding to the new control task to execute the new control task. In other words, in this embodiment, not only is task execution based on priority at the beginning, but also newly added control tasks during the execution of a control task follow the principle of prioritizing higher-priority tasks. That is, it always ensures that high-priority control tasks are executed first, and that control tasks with high urgency are executed first.

[0045] Based on steps 21 to 24 above, the method in this application embodiment may further include: Step 41: If the waiting time for an unexecuted control task exceeds a preset time, the unexecuted control task is moved from the current task queue to the task queue of the next higher priority.

[0046] As can be seen, in this embodiment, each control task has a set waiting time. If this waiting time is exceeded, the control task is moved to the next higher priority task queue to prevent long-term task starvation. That is, although control tasks are initially prioritized and placed in task queues according to their priority, if long-term starvation occurs, the control task is moved to the next higher priority task queue. At this point, the priority of the control task depends only on the priority of its current task queue. If, after exceeding the waiting time and being moved to the next higher priority task queue, it still waits for a preset time without being executed, it is moved to the next higher priority task queue again, and the above process is repeated until the control task is executed, thus preventing long-term task starvation and inability to be executed.

[0047] Based on steps 21 to 24 above, the method in this application embodiment may further include: Step 41: If the target control task has been completed and the processing time has not expired within the processing time corresponding to the current task queue, delete the currently executed control task from the current task queue and start executing the control task from the head of the current task queue.

[0048] As can be seen, in this embodiment of the application, if the processing time of the task queue has not yet expired and there are other control tasks in the task queue after the current control task is completed, the execution will start from the head of the task queue to ensure that the execution of tasks in the task queue always starts from the head of the queue.

[0049] In an optional implementation of this application, the method of controlling the target server to run the container corresponding to the target control task in step 23 above to execute the target control task may further include: defragmenting the memory resources in the target server, wherein defragmentation refers to moving the memory addresses of the containers running on the target server to merge the idle memory resources.

[0050] For example, the memory allocation of the server currently executing the control task is as follows: memory block addresses 0-4 correspond to a memory size of 4, and the memory corresponding to these 0-4 memory block addresses has been allocated to container A (T1 completed); memory block addresses 4-7 correspond to a memory size of 3, and the memory corresponding to these addresses is free; memory block addresses 7-9 correspond to a memory size of 2, and the memory corresponding to these 7-9 memory block addresses has been allocated to container B (T2 in progress); memory block addresses 9-10 correspond to a memory size of 1, and the memory corresponding to these addresses is free; memory block addresses 10-16 correspond to a memory size of 6, and the memory corresponding to these 10-16 memory block addresses has been allocated to container C (T3 in progress). It can be seen that the free memory: 4-7 (3GB) and 9-10 (1GB) are both non-contiguous fragments. At this time, the new control task T4 requires 4GB of contiguous memory, which cannot be allocated. Therefore, container B (2GB) is moved to a lower address to merge the free areas. The reorganized memory layout is as follows: 0-4: Container A; 4-6: Container B (moved here); 6-9: Free (3GB); 9-10: Free (1GB); 10-16: Container C; Further merging of adjacent free blocks: The memory at memory addresses 6-9 and 9-10 is merged into a 4GB contiguous free block corresponding to memory address 6-10. By merging free memory resources in this way, free memory resources can be effectively utilized, preventing them from becoming unusable due to insufficient memory.

[0051] The present application will now be explained and described in conjunction with specific embodiments of the present application. These specific embodiments provide a multi-device control strategy scheduling method for digital docking stations. Figure 2 This application presents a schematic diagram of a multi-container control strategy scheduling architecture. The scheduling method in this specific embodiment is as follows: Figure 3 As shown, it includes the following steps: Step 301: Determine the digital docking station container cluster; like Figure 2 As shown, multiple devices are connected to the digital dock, and then unified resource deployment is performed from the first node to the Nth node. The unified task classification and orchestration are handled by the controller task processor devices in the control strategy architecture, and finally, server resources are allocated uniformly. The processing devices have signal control for task identification and use semaphores to express control tasks. After the control tasks are processed and prioritized, the frequency of service resource access is determined by the flashing frequency of the semaphores, and then the server on which the task is deployed and executed is determined based on the load status of the server cluster.

[0052] Step 302: The controller orchestrates the control tasks; The task types on the device controller are prioritized and time-slice sizes are set. Specifically, high-priority tasks are indicated by red indicator lights, which flash more frequently and receive more server resources; medium-priority tasks are indicated by green indicator lights, which flash at a moderate frequency and receive moderate server resources; and low-priority tasks are indicated by yellow indicator lights, which flash less frequently and receive the lowest level of server resources. This signal control display and task classification and arrangement are uniformly handled by the task processor device, aiming to improve the responsiveness of I / O-intensive tasks and ensure a more equitable distribution of resources for compute-intensive tasks.

[0053] Specifically, as follows Figure 4 As shown, for the access of the control task processing device, specifically, before the virtualization device management from the first device node, the second device node to the Nth device node, it is necessary to access a controller task processing device to classify, orchestrate and schedule the control tasks. The classification and orchestration need to be controlled and identified by the color and flashing frequency of the signal lights.

[0054] For controller task classification, specifically: device virtualization is deployed to servers via containers, and the complexity of the controller's program logic varies greatly in terms of server resource requirements. Therefore, the complexity of tasks in device virtualization scenarios can be classified as follows: 1) Real-time data acquisition tasks: These require rapid response, such as sensor data acquisition in IoT devices. They require RS485, Modbus, and CAN interfaces, and involve multiple devices acquiring and controlling data in real time. Therefore, any task with RS485, Modbus, or CAN interfaces falls under this category and is indicated by a flashing red indicator light.

[0055] 2) Interactive tasks for device control: These require rapid response to user requests, such as querying and updating the database. An Ethernet interface is required, and a flashing green indicator light must be configured.

[0056] 3) Data analysis batch processing tasks: These are tasks with low time requirements but high resource consumption, such as large-scale computing and data analysis. An Ethernet interface is required, and a flashing yellow indicator light must be set.

[0057] For the task priority queue: In order to improve the overall resource utilization and task response rate of the server cluster, the tasks are prioritized according to their complexity. 1) High-priority queue: Runs short tasks (such as lightweight computing tasks, I / O tasks), with faster response times and shorter time slices. The semaphore controls the flashing frequency most frequently; therefore, it is categorized as a real-time data acquisition task.

[0058] 2) Medium-priority queue: Used for tasks of medium complexity (such as medium-scale data processing or short-duration control logic tasks) with moderate time slices. For example, the flashing frequency of semaphore lights is moderate, and it is categorized as an interactive device control task.

[0059] 3) Low-priority queue: Runs computationally intensive tasks (such as data analysis, model training, etc.) with longer time slices. The semaphore controls the flashing frequency the lowest, indicating that it is classified as a data analysis and processing task.

[0060] The task queue scheduling employs a preemptive strategy, where tasks in the high-priority queue are always executed first. When the high-priority queue is empty, a medium- or low-priority task will be selected.

[0061] In a specific example, if there are 3 queues with priorities from highest to lowest, they would be Q1, Q2, and Q3: Q1: Real-time task, high priority, assuming a time slice of 1 unit of time (suitable for I / O intensive tasks), and the indicator light is set to red with a flashing frequency of 1 unit of time.

[0062] Q2: Medium priority, assuming a time slice of 2 units (suitable for lightweight control tasks), and setting the semaphore to green with a flashing frequency of 2 units.

[0063] Q3: Low priority, assuming a time slice of 4 units (suitable for computationally intensive tasks), and setting the semaphore to yellow with a flashing frequency of 4 units.

[0064] like Figure 5 As shown, for the time-slice polling strategy: all new tasks are initially placed into the corresponding task queue according to the priority of the control tasks, and run according to the set time slice. If a task is not completed within the time slice, it will be moved to a lower-priority queue. The processing time needs to be set according to the priority of the task; generally, the higher the priority, the shorter the processing time. Specifically, the time-slice polling strategy is as follows: Since Q1 has a processing time of 1 unit of time, if a task is not completed within 1 unit of time, it is moved to Q2. Since Q2 has a processing time of 2 units of time, if a task is not completed within 2 units of time, it is moved to Q3. Since Q3 has a processing time of 4 units of time, tasks in Q3 run on a first-come, first-served basis until they are completed.

[0065] It's important to note that if a new task arrives in Q1, it will preempt any currently executing task in Q2 or Q3, prioritizing the execution of the Q1 task. Furthermore, if a task in a queue has been waiting for too long without being scheduled, the algorithm can elevate its priority. For example, if a task in Q3 has been waiting for more than a certain threshold, it can be moved to Q2 for execution to prevent long-term task starvation.

[0066] Furthermore, in the time-round polling algorithm, all ready tasks are arranged into a ready queue according to a first-come, first-served (FFS) strategy. The system generates an interrupt at regular intervals, activating the task scheduler to allocate cluster resources to the task at the head of the queue and allow it to execute for a time slice. Once that task completes, the processor is allocated to the new task at the head of the queue, which also executes for a time slice. In this way, all tasks in the ready queue receive a time slice of processor time within a defined time period. Task switching in the scheduling algorithm falls into two categories: 1) If a task is completed before a time unit is used up, the scheduler is immediately activated, the task is removed from the ready queue, the next task at the head of the queue is scheduled to run, and a new time unit is started.

[0067] 2) If a time unit is used up before the task is completed, the scheduler moves it to the end of the ready queue and continues to wait for the next scheduling.

[0068] Step 303, Server Load Resource Scheduling. Based on real-time collection and analysis of server cluster load information, the controller container program is deployed through load balancing and load migration, combined with a resource fragmentation handling mechanism to greatly improve resource utilization.

[0069] Specifically, such as Figure 6 As shown, for server load classification: after multiple devices are deployed on the digital dock using containers, the digital dock will orchestrate tasks according to the task type of the device controller, and then schedule the resources of the server cluster to serve the task according to the resource requirements of the task.

[0070] For the load balancing strategy: First, the scheduled program periodically monitors the load of each server in the cluster and stores the data in the log system, using local data to predict future load conditions. Combining past, current, and future load information, load scheduling is performed, distributing a large number of control tasks to servers with lower loads. If a task cannot be completed in time, it is dynamically migrated to other servers with lower loads to share the workload.

[0071] As can be seen, this load balancing strategy utilizes a dynamic load balancing algorithm based on historical data. By statistically analyzing the operational data of each container in all currently executing containers, it analyzes the historical performance of containers in real time (response time, error rate, and resource utilization), and dynamically adjusts request allocation weights. This allows traffic to flow more intelligently to containers with better performance, thereby optimizing overall throughput, reducing latency, and improving system stability. It does not simply rely on static weights or simple round-robin; instead, it calculates dynamic weights based on the performance metrics of containers over a period of time (such as average response time and error rate). It prioritizes allocating requests to containers with the best historical performance (short response time, low error rate), avoiding uneven distribution of load across containers.

[0072] To enable the digital platform to execute more control logic (application software) or handle more complex control logic within limited resources, a dynamic resource scheduling mechanism and technology are introduced. This mechanism monitors the memory usage of each container in real time and releases idle resources from low-load containers to high-load containers, effectively handling resource fragmentation. Specifically, the resource fragmentation handling strategy involves deploying tasks in containers to the server for execution. The complexity of the controller task determines the container size (resource requirement), and inconsistent sizes lead to massive fragmentation on the server, hindering resource utilization. By combining fragmentation retrieval, statistics, and merging with the resource fragmentation handling method, and then re-allocating resources for the next new controller container task, the utilization rate of cluster resources can be significantly improved. Furthermore, the resource fragmentation handling in this embodiment is based on a memory replacement algorithm, which is the algorithm that reclaims the longest-unused memory. Generally, memory allocation algorithms used by multiple applications in a computer are greedy algorithms, aiming to maximize memory usage. Memory allocation is based on existing contiguous space, resulting in discontinuous memory space (fragmentation) after allocation. This replacement algorithm identifies the application that has not been used for the longest time among all memory blocks and releases it (i.e., the application that was accessed first has the highest priority). It then assigns the application to the first application waiting in the current resource waiting queue. This algorithm improves resource utilization more than the first-come, first-served replacement algorithm.

[0073] Corresponding to the above Figure 1 This application provides a resource scheduling device for digital infrastructure, such as... Figure 7 As shown, the device includes: The first processing module 702 is used to acquire control tasks sent by multiple devices associated with the digital dock and prioritize the multiple control tasks based on their urgency. The second processing module 704 is used to package the control logic program corresponding to the control task into an independent container, and place the control task in the corresponding priority task queue based on priority sorting; wherein, each task queue has a corresponding processing time, and the higher the priority of the task queue, the shorter the corresponding processing time. The third processing module 706 is used to extract the corresponding target control task from the task queue according to the priority order and time polling strategy, and control the target server to run the container corresponding to the target control task to execute the target control task in combination with the load status of the server cluster.

[0074] In an optional embodiment of this application, the first processing module includes: a first processing unit, configured to determine the task type of the control task, determine the corresponding signal light flashing frequency based on the response speed of the task type, and determine the corresponding complexity based on the task type, wherein a higher flashing frequency corresponds to a shorter response speed; a second processing unit, configured to determine the urgency of the control task based on the signal light flashing frequency and complexity, wherein the signal light flashing frequency is directly proportional to the urgency, and the complexity is inversely proportional to the urgency; and a third processing unit, configured to prioritize multiple control tasks based on their urgency.

[0075] In an optional embodiment of this application, the third processing module includes: The fourth processing unit is used to extract the target control tasks in the current queue in descending order of priority, starting from the task queue with the highest priority; wherein, the target control task is the control task in any task queue. The selection unit is used to select the target server corresponding to the target control task from the server cluster based on the load status of the server cluster. The fifth processing unit is used to control the target server to run the container corresponding to the target control task within the processing time corresponding to the current task queue, so as to execute the target control task; The sixth processing unit is used to extract the target control task from the next priority task queue and repeat the above process if the target control task has been completed within the processing time corresponding to the current task queue; if the target control task has not been completed within the processing time corresponding to the current task queue, the unfinished target control task is moved to the tail of the next priority task queue and the above process is repeated.

[0076] In optional embodiments of this application, the apparatus further includes: The fourth processing module is used to terminate the currently executing target control task when a new control task enters the task queue during the execution of a target control task in any task queue, and the priority of the new control task is higher than that of the task queue currently executing the control task. The control server then runs the container corresponding to the new control task to execute the new control task.

[0077] In optional embodiments of this application, the apparatus further includes: The fifth processing module is used to transfer unexecuted control tasks from the current task queue to the task queue of the next higher priority if the waiting time for an unexecuted control task exceeds a preset time.

[0078] In optional embodiments of this application, the apparatus further includes: The sixth processing module is used to delete the currently executed control task from the current task queue if the target control task has been completed and the processing time has not expired within the processing time corresponding to the current task queue, and to start executing the control task from the head of the current task queue.

[0079] In an optional embodiment of this application, the fifth processing unit in this application includes: The processing subunit is used to defragment the memory resources in the target server. Defragmentation refers to moving memory addresses of the containers running on the target server to merge idle memory resources.

[0080] like Figure 8 As shown in the figure, this application provides an electronic device, including a processor 811, a communication interface 812, a memory 813, and a communication bus 814, wherein the processor 811, the communication interface 812, and the memory 813 communicate with each other through the communication bus 814. Memory 813 is used to store computer programs; In one embodiment of this application, when the processor 811 executes the program stored in the memory 813, it implements the resource scheduling method for digital docking provided in any of the aforementioned method embodiments, and its function is similar, so it will not be described again here.

[0081] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the resource scheduling method for digital docking stations provided in any of the foregoing method embodiments.

[0082] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0084] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.

[0085] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A resource scheduling method for digital infrastructure, characterized in that, include: Acquire control tasks sent by multiple devices associated with the digital dock, and prioritize the multiple control tasks based on their urgency. The control logic program corresponding to the control task is packaged into an independent container, and the control task is placed in the task queue of the corresponding priority based on the priority sorting; wherein, each task queue has a corresponding processing time, and the higher the priority of the task queue, the shorter the corresponding processing time. The corresponding target control task is extracted from the task queue according to priority order and time polling strategy, and the target server is controlled to run the container corresponding to the target control task to execute the target control task in combination with the load status of the server cluster.

2. The method according to claim 1, characterized in that, The multiple control tasks are prioritized based on their urgency, including: The task type of the control task is determined, and the corresponding signal light flashing frequency is determined based on the response speed of the task type, and the corresponding complexity is determined based on the task type, wherein the higher the flashing frequency, the shorter the response speed; The urgency of the control task is determined based on the flashing frequency of the traffic lights and the complexity, wherein the flashing frequency of the traffic lights is directly proportional to the urgency, and the complexity is inversely proportional to the urgency. The multiple control tasks are prioritized based on their urgency.

3. The method according to claim 1, characterized in that, The system extracts corresponding target control tasks from the task queue according to priority order and time polling strategy, and controls the target server to run the container corresponding to the target control task to execute the target control task based on the load status of the server cluster, including: The target control tasks are extracted sequentially from the task queue with the highest priority, starting from the task queue with the highest priority. The target control task can be any control task in any task queue. Select the target server corresponding to the target control task from the server cluster based on the load status of the server cluster; Within the processing time corresponding to the current task queue, control the target server to run the container corresponding to the target control task to execute the target control task; If the target control task is completed within the processing time corresponding to the current task queue, the target control task is extracted from the task queue of the next priority and the above process is repeated; if the target control task is not completed within the processing time corresponding to the current task queue, the uncompleted target control task is moved to the tail of the task queue of the next priority and the above process is repeated.

4. The method according to claim 3, characterized in that, The method further includes: If, during the execution of a target control task in any task queue, a new control task enters the task queue with a higher priority than the currently executing control task, the currently executing target control task is aborted, and the control server runs the container corresponding to the new control task to execute the new control task.

5. The method according to claim 3, characterized in that, The method further includes: If the waiting time for an unexecuted control task exceeds a preset time, the unexecuted control task will be moved from the current task queue to the task queue of the next higher priority.

6. The method according to claim 3, characterized in that, The method further includes: If the target control task has been completed within the processing time corresponding to the current task queue and the processing time has not expired, the currently executed control task will be deleted from the current task queue, and the control task will be executed starting from the head of the current task queue.

7. The method according to claim 3, characterized in that, Controlling the target server to run a container corresponding to the target control task to execute the target control task includes: The memory resources in the target server are fragmented and defragmented. The fragmentation and defragmentation refers to moving the memory addresses of the containers running on the target server in order to merge the idle memory resources.

8. A resource scheduling device for a digital platform, characterized in that, include: The first processing module is used to acquire control tasks sent by multiple devices associated with the digital base and prioritize the multiple control tasks based on their urgency. The second processing module is used to package the control logic program corresponding to the control task into an independent container, and place the control task in a task queue with the corresponding priority based on the priority sorting; wherein, each task queue has a corresponding processing time, and the higher the priority of the task queue, the shorter the corresponding processing time. The third processing module is used to extract the corresponding target control task from the task queue according to the priority order and time polling strategy, and control the target server to run the container corresponding to the target control task to execute the target control task in combination with the load status of the server cluster.

9. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are connected, with the processor, communication interface, and memory communicating with each other via the communication bus. The memory is used to store computer programs; the processor is used to implement the resource scheduling method for digital docking stations as described in any one of claims 1-7 when executing the computer programs.

10. A storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the resource scheduling method for digital docking stations as described in any one of claims 1-7.