Load balancing control method, device and electronic equipment
By allocating tasks according to the relationship between processing capabilities and node equipment in construction machinery equipment, the problem of load allocation strategy dependence on the operating system is solved, load balancing and cross-platform adaptability are achieved, and the computing efficiency and stability of the equipment are improved.
Patent Information
- Application Number
- CN202210209502.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-04
- Publication Date
- 2024-11-01
- Estimated Expiration
- 2042-03-04
AI Technical Summary
The load distribution strategy of existing engineering machinery equipment strongly depends on the scheduling strategy of the platform's own operating system, and is not convenient to adjust and generalize to other computing unit architectures.
By obtaining the target task, decompose it into subtasks, and assigning the subtasks to the node equipment connected to the bus based on the corresponding relationship between the preset processing capabilities and the node equipment, which is independent of the scheduling strategy of the platform operating system.
It realizes flexible adjustment of load balancing and cross-platform adaptability, improving the computing efficiency and stability of engineering machinery equipment.
Smart Images

Figure CN114708480B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of engineering machinery equipment, and in particular to a load balancing control method, device and electronic equipment. Background Art
[0002] The computing platform carried by construction machinery is the brain and soul of construction machinery vehicles. It is mainly responsible for the perception fusion, comprehensive decision-making, planning and control of construction machinery equipment during unmanned operation and operation, including sensor signal processing, perception data fusion, high-precision positioning map modeling, operation path planning, action execution mechanism decision-making and control. In order for construction machinery equipment to achieve unmanned operation, the computing platform needs to process massive amounts of data and perform a large number of parallel calculations. The computing platform is usually designed to integrate computing units with different architectural characteristics, such as the CPU responsible for system scheduling, the MCU responsible for control signal processing, the professional chip DSP responsible for digital image processing, the acceleration chip GPU or NPU responsible for deep learning model reasoning, etc. The main control chip CPU is usually used as a manager to schedule different computing units to perform functions with different characteristics to achieve the goals of optimizing performance, improving efficiency, reducing costs and stabilizing operation.
[0003] Although there are load distribution strategies for parallel computing, they are fixed and inflexible. Most of them are based on fixed CPU+GPU, CPU+NPU, CPU+DSP and other architectures, and are highly dependent on the preset scheduling strategies of the platform's own operating system. This makes it inconvenient to adjust the scheduling strategies later, and it is also inconvenient to generalize and migrate them to other platforms with different computing unit architectures. Summary of the invention
[0004] In view of this, an embodiment of the present invention provides a load balancing control method, device and electronic device to solve the problem that the current load distribution strategy is strongly dependent on the scheduling strategy of the platform's own operating system, which is neither convenient for adjusting the scheduling strategy nor for generalization and migration to other platforms.
[0005] According to the first aspect, an embodiment of the present invention provides a load balancing control method, comprising the following steps: obtaining a target task; decomposing the target task to obtain multiple subtasks; allocating the multiple subtasks to node devices connected to a bus according to a preset correspondence between processing capabilities and node devices; wherein the correspondence between processing capabilities and node devices includes identification information of each node device connected to the bus and the processing capabilities of each node device.
[0006] The load balancing control method provided by the embodiment of the present invention obtains a target task, decomposes the target task into multiple subtasks, and further distributes the multiple subtasks to the node devices connected to the bus according to the preset correspondence between the processing capacity and the node devices. That is to say, the correspondence between the processing capacity and the node devices can be used to distribute the target task to the multiple node devices connected to the bus. It does not rely on the scheduling strategy of the platform's own operating system, and solves the problem that the current load distribution strategy is strongly dependent on the scheduling strategy of the platform's own operating system, which is neither convenient for adjusting the strategy nor for generalization and migration to other platforms.
[0007] In combination with the first aspect, in the first implementation of the first aspect, the method for constructing the correspondence between the processing capability and the node device includes: issuing a search command; obtaining a capability set reported by each node device connected to the bus, wherein the capability set includes the processing capability possessed by the node device; and obtaining the correspondence between the processing capability and the node device based on the capability set reported by each node device.
[0008] In combination with the first aspect, in the second implementation of the first aspect, the allocation of the multiple subtasks to the node devices connected to the bus according to the preset correspondence between processing capabilities and node devices includes: for any subtask, searching the correspondence between processing capabilities and node devices for a processing capability that can complete the subtask, and allocating the subtask to the node device corresponding to the processing capability that can complete the subtask; traversing all subtasks of the target task, and allocating the multiple subtasks to the node devices connected to the bus.
[0009] In combination with the first aspect, in the third implementation of the first aspect, the load balancing control method also includes: obtaining load statistical information of all active node devices, wherein the active node devices are node devices in an active state; determining whether there are active node devices that need to perform load migration based on the load statistical information of all active node devices; when there are active node devices that need to perform load migration, determining the node devices to be migrated; obtaining the subtasks to be migrated based on the subtasks being processed by the node devices to be migrated; searching for a set of alternative devices that can process the subtasks to be migrated according to the correspondence between the processing capabilities and the node devices, wherein the correspondence between the processing capabilities and the node devices is obtained based on the correspondence between the processing capabilities and the node devices; selecting a target node device from the set of alternative devices; and migrating the subtasks to be migrated to the target node device.
[0010] In combination with the third implementation manner of the first aspect, in the fourth implementation manner of the first aspect, determining whether there is an active node device that needs to perform load migration based on the load statistical information of all the active node devices includes: determining the load level of each active node device based on the load statistical information of each active node device respectively; when there is a load level greater than or equal to a preset first threshold among the load levels of all the active node devices, determining that there is an active node device that needs to perform load migration among all the active node devices.
[0011] In combination with the fourth implementation manner of the first aspect, in the fifth implementation manner of the first aspect, determining the load level of each active node device according to the load statistical information of each active node device includes: for any active node device, determining whether there are unstable factors in the operation of the active node device according to the load statistical information of the active node device; when the task execution result of the active node device is completely in line with expectations and there are no unstable factors, determining the load level of the active node device to be level one; when the task execution result of the active node device is completely in line with expectations but there are unstable factors, determining the load level of the active node device to be level two; when the task execution result of the active node device is not completely in line with expectations and there are unstable factors, determining the load level of the active node device to be level three; when the active node device cannot execute the task, determining the load level of the active node device to be level four.
[0012] In combination with the third implementation manner of the first aspect, in the sixth implementation manner of the first aspect, when there is an active node device that needs to perform load migration, determining the node device to be migrated that currently needs to be migrated includes: arranging the active node devices that need to perform load migration in order of health status from bad to good, obtaining a sorting table, and taking the active node device with the worst health status in the sorting table as the node device to be migrated that currently needs to be migrated.
[0013] In combination with the third implementation manner of the first aspect, in the seventh implementation manner of the first aspect, obtaining the subtask to be migrated based on the subtask being processed by the node device to be migrated includes: decomposing the subtask being processed by the node device to be migrated to obtain the minimum processing unit; and using the minimum processing unit as the subtask to be migrated.
[0014] In combination with the third implementation manner of the first aspect, in the eighth implementation manner of the first aspect, the selection of alternative node devices from the alternative device set includes: obtaining the load level of each alternative node device in the alternative device set to obtain a second load level set; wherein the second load level set includes the load level of each alternative node device; screening out the load level that is smaller than the load level of the node device to be migrated from the second load level; and using the alternative node device corresponding to the screened load level as the target node device.
[0015] In combination with the fifth implementation of the first aspect, in the ninth implementation of the first aspect, before migrating the subtask to be migrated to the target node device, it also includes: determining the load migration strategy of the node device to be migrated when performing load migration according to the load level of the node device to be migrated.
[0016] In combination with the ninth implementation manner of the first aspect, in the tenth implementation manner of the first aspect, the migration strategy for load migration of the node device to be migrated determined according to the load level of the node device to be migrated includes: when the load level of the node device to be migrated is level two or level three, the load migration strategy is: load migration is performed without causing the load of the target node device to exceed the standard; when the load level of the node device to be migrated is level four, the load migration strategy is: regardless of whether the load of the target node device exceeds the standard, the subtask to be migrated is directly migrated to the target node device.
[0017] In combination with the fifth implementation of the first aspect, in the eleventh implementation of the first aspect, the load balancing method also includes: when the load level of the node device to be migrated is level four and the target node device cannot be selected from the set of alternative devices, an alarm is issued; when the load level of the node device to be migrated is level two or level three and the target node device cannot be selected from the set of alternative devices, the task in the node device to be migrated is kept executing.
[0018] In combination with the third implementation manner of the first aspect, in the twelfth implementation manner of the first aspect, when there are multiple active node devices that need to perform load migration, after migrating the subtask to be migrated to the target node device, it also includes: after the migration of the subtask to be migrated in the active node device that currently needs to be migrated is completed, the next node device to be migrated in the sorting list is used as the node device to be migrated that currently needs to be migrated.
[0019] According to the second aspect, an embodiment of the present invention also provides a load balancing control device, including an acquisition module, a decomposition module and an allocation module; the acquisition module is used to acquire a target task; the decomposition module is used to decompose the target task to obtain multiple subtasks; the allocation module is used to allocate the multiple subtasks to the node devices connected to the bus according to the preset correspondence between the processing capacity and the node devices; wherein the correspondence between the processing capacity and the node devices includes the identification information of each node device connected to the bus and the processing capacity of each node device.
[0020] In combination with the second aspect, in the first embodiment of the second aspect, the load balancing control device also includes a second acquisition module and a balancing module, wherein the second acquisition module is used to obtain load statistical information of all active node devices, wherein the active node device is a node device in an active state; the balancing module is used to determine whether there is an active node device that needs to perform load migration based on the load statistical information of all active node devices; when there is an active node device that needs to perform load migration, determine the node device to be migrated; obtain the subtask to be migrated based on the subtask being processed by the node device to be migrated; search for a set of alternative devices that can process the subtask to be migrated according to the correspondence between the processing capacity and the node device, wherein the correspondence between the processing capacity and the node device is obtained based on the correspondence between the processing capacity and the node device; select a target node device from the set of alternative devices; and migrate the subtask to be migrated to the target node device.
[0021] According to the third aspect, an embodiment of the present invention further provides an electronic device, comprising a memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the load balancing control method described in the first aspect or any one of the embodiments of the first aspect by executing the computer instructions.
[0022] According to a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the load balancing control method described in the first aspect or any one of the embodiments of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0024] Figure 1 This is a schematic diagram of the application scenario of the engineering machinery equipment computing platform;
[0025] Figure 2 This is a schematic diagram of an application example of the engineering machinery equipment computing platform;
[0026] Figure 3 This is a schematic diagram of the composition of the engineering machinery equipment computing platform;
[0027] Figure 4 It is a schematic diagram of the capability set of each module in the engineering machinery equipment computing platform;
[0028] Figure 5 This is a flow chart of a load balancing control method in Embodiment 1 of the present invention;
[0029] Figure 6 This is a schematic diagram of an example of a load balancing control method in Embodiment 1 of the present invention;
[0030] Figure 7 A schematic diagram of another example of the load balancing control method in Embodiment 1 of the present invention;
[0031] Figure 8 This is a schematic diagram of another example of the load balancing control method in Embodiment 1 of the present invention;
[0032] Fig. 9 This is a schematic diagram of the structure of a load balancing control device in Embodiment 2 of the present invention;
[0033] Among them, 1. Cloud; 2. LiDAR; 3. Main camera; 4. Fisheye camera; 5. Millimeter-wave radar. DETAILED DESCRIPTION
[0034] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0035] Example 1
[0036] Embodiment 1 of the present invention provides a load balancing control method, which is applied to a computing platform of an engineering machinery equipment. The computing platform of an engineering machinery equipment is connected to an external device in order to realize a generalized unmanned operation function including unmanned driving. Figure 1As shown, the connected input devices include sensors such as cameras, lidars, and ultrasonic radars; the output devices include action execution devices such as mechanical equipment line control modules; in addition, expansion interfaces such as high-speed serial computer expansion bus standard (peripheral component interconnect express, PCIE) interface, network port, etc. are also provided, and display devices, the cloud is both the input device and the output device of the computing platform.
[0037] Excavator is one of many engineering machinery equipment. For excavators, its broad unmanned operation mainly includes unmanned driving and unmanned excavation. Now, taking the excavator as an example, it is explained how the computing platform enables engineering machinery equipment to realize the unmanned operation function. Figure 2 The following is a schematic diagram of an application example of a computing platform for construction machinery equipment. Figure 2 As shown in the figure, the installation and use of each module in the actual use scenario of the excavator is as follows: a laser radar (Lidar) 2 is installed on the top of the machine to scan the targets around the fuselage at 360°; the main camera (Main cam) 3 is located in front of the fuselage, which is responsible for the main visual input of the road ahead during unmanned operation. It has high resolution and a large field of view. Its functions include lane line detection, road sign detection, traffic light detection, obstacle detection, and operation object detection. Four fisheye cameras (Fisheye) 4 are located around the fuselage for automatic parking. One fisheye in front and the fisheyes on both sides can increase the visible area, reduce the blind area, and ensure the safety of the operation. The tail fisheye is mainly used for auxiliary visual detection during reversing and parking. There is a millimeter-wave radar (Radar) 5 at each of the four corners of the fuselage, which plays an auxiliary role in functions such as collision avoidance. The steering, braking, and excavation execution devices cooperate with each other to complete the execution actions required for unmanned operation. The display screen displays the status information, system prompt information, alarm information, etc. of the excavator, and can also be used as an input device to complete the setting of relevant parameters. The 5G communication module connects the excavator to the cloud1, providing remote call and management functions. The computing platform needs to receive these data with different characteristics, perform corresponding calculations and send them to different receiving modules. In different application scenarios, the computing tasks performed by the computing platform are completely different, and the load inside the computing platform is also different.
[0038] The components of each processor core module in the engineering machinery equipment computing platform are shown in the attached figure. Figure 3 As shown in the figure, it includes the main controller, computing power card 1, computing power card 2 and more extended computing power cards. The main controller is the basic module, responsible for system initialization, system scheduling, load distribution of each computing unit, creation of monitoring program, management of computing power card 1 to computing power card N, and load distribution of extended computing power cards.
[0039] Figure 4This is a schematic diagram of the capability set of each module in the engineering machinery equipment computing platform. Figure 4 The CPU, DSP, MCU, GPU and BPU are described in detail respectively.
[0040] CPU: Generally, it is a multi-core CPU that runs advanced operating systems such as Linux or Qnx. It has basic system scheduling capabilities and is responsible for system initialization, memory management, thread management, message communication, etc. It also has basic computing capabilities and can perform point cloud data processing of lidar, pre-processing and post-processing of AI model reasoning, and perception fusion processing. In addition, it also has basic neural network reasoning capabilities, but the efficiency is relatively low. It is also an optional alternative in the absence of a dedicated neural network processor.
[0041] DSP: A professional digital signal processing chip that generally runs its own BIOS system and can quickly process data and perform mathematical calculations. It performs well in the pre-processing and post-processing of AI model reasoning.
[0042] MCU: Microcontroller, which can be connected to a variety of sensors and peripherals, and generally runs some real-time operating systems (RTOS). It can connect to camera input, obtain image data and perform image processing; it can connect to radar equipment such as Lidar, millimeter-wave radar (Radar), ultrasonic radar, etc., and perform basic radar data processing; it can provide display device driving capabilities and provide developers and users with an interactive interface; it can connect to the wire control module of engineering machinery equipment to perform unmanned operation control execution.
[0043] NPU: Neural network processing unit, which has basic matrix computing capabilities and rich neural network operators, can accelerate the operation of neural network models; it can complete functions such as image classification, target detection, image semantic segmentation, and speech recognition.
[0044] GPU: Image processing unit, whose basic functions are image processing, image rendering, graphics acceleration, etc. It also has strong matrix computing and parallel processing capabilities, and excels in AI model acceleration; it can complete image classification, target detection, image semantic segmentation, speech recognition, etc.
[0045] BPU: Brain Processing Unit, which has rich capabilities. It can process images and perform pre- and post-processing of model inference. It also has functions similar to NPU to accelerate the operation of neural network models. It can complete image classification, target detection, image semantic segmentation, speech recognition and other functions.
[0046] Figure 5 FIG. 1 is a flow chart of a load balancing control method in Embodiment 1 of the present invention. Figure 5As shown, the load balancing control method of embodiment 1 of the present invention includes the following steps:
[0047] S101: Obtain target tasks.
[0048] S102: Decompose the target task into multiple subtasks.
[0049] Example 1: The main controller decomposes the target task into multiple subtasks based on the unmanned operation task in the current specific scenario. This unmanned operation task generally comes from external input or is determined by the main controller based on established rules and other conditions: 1 camera input subtask, 1 Lidar point cloud data input subtask, 1 image target detection subtask, 1 image semantic segmentation subtask, 1 point cloud target detection subtask, 1 point cloud semantic segmentation subtask, 1 image and point cloud fusion calculation subtask, 1 data pre- and post-processing subtask, and 1 wire control subtask.
[0050] S103: Allocate the plurality of subtasks to node devices connected to the bus according to a preset correspondence between processing capabilities and node devices.
[0051] The correspondence between the processing capability and the node device includes identification information of each node device connected to the bus and the processing capability of each node device.
[0052] As a specific implementation method, the method for constructing the correspondence between the processing capability and the node device includes the following steps: issuing a search command; obtaining a capability set reported by each node device connected to the bus, wherein the capability set includes the processing capability possessed by the node device; and obtaining the correspondence between the processing capability and the node device based on the capability set reported by each node device.
[0053] Specifically, the correspondence between the processing capability and the node device may be in the form of a device capability list or in the form of a candidate device lookup table.
[0054] Example 2: Figure 5 As shown, the method for constructing the corresponding relationship between processing capabilities and node devices is as follows:
[0055] Step 1: The host controller (Host) starts a management thread to complete the bus (Bus) initialization operation.
[0056] Step 2: The bus sends a Discover command to search for node devices on the bus.
[0057] Step 3: Node devices 1 to 5 are started and the initialization operation of the node devices is completed.
[0058] Step 4: The node device reports the device capability set, registers and mounts it on the bus, forming a device capability list, as shown in Table 1, which can also be called a device tree, which is registered and managed uniformly by the bus. At the same time, the main control will also generate an alternative device lookup table, as shown in Table 2.
[0059] The information reported by node device 1 includes: the device type and capability set of node device 1, where the device type of node device 1 is CPU, and the capability set of node device 1 includes system control, fusion calculation (including image and point cloud fusion calculation), pre- and post-processing, target detection, semantic segmentation (including image semantic segmentation and point cloud semantic segmentation), image processing, point cloud processing, and image classification.
[0060] The information reported by node device 2 includes: the device type and capability set of node device 2, where the device type of node device 2 is MCU, and the capability set of node device 2 includes camera input, display output, Lidar input, Radar input, wire control module, positioning module, and image processing.
[0061] The information reported by the node device 3 includes: the device type and capability set of the node device 3, wherein the device type of the node device 3 is DSP, and the capability set of the node device 3 includes pre- and post-processing, mathematical calculation, and point cloud processing.
[0062] The information reported by node device 4 includes: the device type and capability set of node device 4, where the device type of node device 4 is NPU, and the capability set of node device 4 includes target detection (including image target detection and point cloud target detection), image classification, semantic segmentation (including image semantic segmentation and point cloud semantic segmentation), matrix calculation, and computing power 8T INT8.
[0063] The information reported by node device 5 includes: the device type and capability set of node device 5, where the device type of node device 5 is BPU, and the capability set of node device 5 includes camera input, image processing, front and back processing, target detection (including image target detection and point cloud target detection), semantic segmentation (including image semantic segmentation and point cloud semantic segmentation), fusion computing (including image and point cloud fusion computing), and computing power 5T INT8.
[0064] Table 1 Equipment capability list
[0065]
[0066] Table 2 Alternative equipment search table
[0067]
[0068]
[0069] As a specific implementation, the allocation of the multiple subtasks to the node devices connected to the bus according to the preset correspondence between processing capabilities and node devices includes the following steps: for any subtask, searching for the processing capability that has the ability to complete the subtask in the correspondence between the processing capabilities and node devices, and allocating the subtask to the node device corresponding to the processing capability that has the ability to complete the subtask; traversing all subtasks of the target task, and allocating the multiple subtasks to the node devices connected to the bus.
[0070] Based on the above examples 1 and 2, Figure 6 As shown, Example 3 is given of allocating the multiple subtasks to the node devices connected to the bus according to the corresponding relationship between the preset processing capabilities and the node devices: 1 camera input subtask, 1 Lidar point cloud data input subtask and 1 line control subtask are allocated to the MCU; 1 image target detection and 1 image semantic segmentation subtask are allocated to the NPU; 1 point cloud target detection and 1 point cloud semantic segmentation subtask are allocated to the BPU; 1 data pre- and post-processing subtask is allocated to the DSP; the main controller Host is the CPU that starts the total thread by default, which is responsible for device tree management, thread scheduling, data stream concatenation, etc., and is also responsible for image and point cloud fusion perception computing tasks.
[0071] It should be noted that when the target task changes, the allocation result of the subtask in step S103 may also change. The main controller Host decomposes the target task into multiple subtasks to obtain: 3 camera input subtasks, 1 Lidar point cloud data input subtask, 3 image target detection subtasks, 3 image semantic segmentation subtasks, 1 point cloud target detection subtask, 1 point cloud semantic segmentation subtask, 1 image and point cloud fusion calculation subtask, 1 data pre- and post-processing subtask, and 1 line control subtask.
[0072] like Figure 7As shown in Figure 1, the target task is assigned (appoint) according to Table 1, and the following assignment results are obtained: 3 camera input subtasks, 1 Lidar input subtask and wire control subtask are assigned to MCU; 2 image target detection subtasks (i.e., image target detection subtask 1 and image target detection subtask 2) and 2 image semantic segmentation subtasks (i.e., image semantic segmentation subtask 1 and image semantic segmentation subtask 2) are assigned to NPU; 1 image target detection subtask (i.e., image target detection subtask 3), 1 image semantic segmentation subtask (i.e., image speech segmentation subtask 3), 1 point cloud target detection subtask and 1 point cloud semantic segmentation subtask are assigned to BPU; 1 data pre- and post-processing subtask is assigned to DSP; the main controller Host is the CPU that starts the bus thread by default, which is responsible for device tree management, thread scheduling, data stream concatenation, etc., and is also responsible for the fusion processing of image and point cloud data.
[0073] The load balancing control method provided in Example 1 of the present invention obtains a target task, decomposes the target task into multiple subtasks, and further allocates the multiple subtasks to the node devices connected to the bus according to the preset correspondence between the processing capacity and the node devices. In other words, the correspondence between the processing capacity and the node devices can be used to allocate the target task to the multiple node devices connected to the bus. It does not depend on the scheduling strategy of the platform's own operating system, which solves the problem that the current load distribution strategy is strongly dependent on the scheduling strategy of the platform's own operating system, which is neither convenient for adjusting the strategy nor for generalization and migration to other platforms.
[0074] As a further implementation method, the load balancing control method also includes: obtaining load statistical information of all active node devices, wherein the active node devices are node devices in an active state; determining whether there are active node devices that need to perform load migration based on the load statistical information of all active node devices; when there are active node devices that need to perform load migration, determining the node devices to be migrated; obtaining the subtasks to be migrated based on the subtasks being processed by the node devices to be migrated; searching for a set of alternative devices that can process the subtasks to be migrated according to the correspondence between the processing capabilities and the node devices, wherein the correspondence between the processing capabilities and the node devices is obtained based on the correspondence between the processing capabilities and the node devices; selecting a target node device from the set of alternative devices; and migrating the subtasks to be migrated to the target node device.
[0075] Specifically, the following technical solution can be adopted to determine whether there is an active node device that needs to be loaded migrated based on the load statistics information of all active node devices: determine the load level of each active node device based on the load statistics information of each active node device; when there is a load level greater than or equal to a preset first threshold among the load levels of all active node devices, determine that there is an active node device that needs to be loaded migrated among all active node devices. It should be noted that the first threshold here can be level two.
[0076] More specifically, the load level of each active node device can be determined according to the load statistical information of each active node device as follows: for any active node device, determine whether there are unstable factors in the operation of the active node device according to the load statistical information of the active node device; when the task execution result of the active node device is completely in line with expectations and there are no unstable factors, the load level of the active node device is determined to be level one; when the task execution result of the active node device is completely in line with expectations but there are unstable factors, the load level of the active node device is determined to be level two; when the task execution result of the active node device is not completely in line with expectations and there are unstable factors, the load level of the active node device is determined to be level three; when the active node device cannot execute the task, the load level of the active node device is determined to be level four.
[0077] For example, the load statistics of each active node device include one or more of the following: current load value, historical maximum load value, and historical load average value. Among them, the current load value belongs to the load statistics of the current cycle; the historical maximum load value and the historical load average value belong to the load statistics from power-on to the previous cycle. When the current load value and the historical maximum load value are both less than the preset second threshold value (for example, 80%), it is determined that there are no unstable factors in the operation of the active node device; or, when the current load value and the historical load average value are both less than the preset second threshold value (for example, 80%), it is determined that there are no unstable factors in the operation of the active node device.
[0078] That is to say, the load health status includes idle (Idle); healthy (Healthy), which is equivalent to load level 1; warning (Warn), which is equivalent to load level 2; error (Error), which is equivalent to load level 3; and failure (Fatal), which is equivalent to load level 4.
[0079] Among them, Idle is an idle state where no tasks are assigned temporarily, that is, an idle node device.
[0080] The Healthy state means that the node device has run the task, and the historical maximum load value and the current load value are both lower than 80%. This indicates that the load distribution is reasonable and the task execution is smooth and orderly.
[0081] The Warn state is when the node device is running a task and the historical value or current value of the load is greater than the 80% threshold (that is, the historical highest load value and the current load value are greater than or equal to the second threshold). In this state, the task on the device still outputs the predetermined result normally, but there are unstable factors in the task execution process and there are certain risks. The load distribution can be adjusted appropriately, provided that it does not affect the load exceeding the standard of other node devices.
[0082] The Error state means that the system often has a load occupancy rate greater than 80% (that is, the historical load average and the current load value are greater than or equal to the second threshold). In this state, the task execution result is not completely in line with expectations. At this time, if there is a suitable alternative device and it is in a healthy state, the load can be migrated to a low-load device for execution. If there is no alternative node device, the current load distribution can only be maintained for execution.
[0083] Fatal status: This is when a system error occurs on the device and the task cannot be executed at all. In this case, the task of the fatal device must be moved to other devices. If there is no backup load, the device must report an error warning to the user so that the user can intervene and handle the problem.
[0084] More specifically, when there are active node devices that need to be load migrated, the following technical solution can be used to determine the node device to be migrated that currently needs to be migrated: the active node devices that need to be load migrated are arranged in order of health status from bad to good to obtain a sorting table, and the active node device with the worst health status in the sorting table is used as the node device to be migrated that currently needs to be migrated. In other words, the active node device with the worst health status is used as the current (i.e., first) active node device that needs to be migrated. Furthermore, if there are multiple active node devices that need to be load migrated, after the migration of the subtask to be migrated in the active node device that currently needs to be migrated is completed, the next node device to be migrated in the sorting table is used as the node device to be migrated that currently needs to be migrated.
[0085] It should be noted that the health status of the active node device can be reflected by the load level. The higher the load level, the worse the health status. In addition, the health status of each active node device belonging to the same load level can be compared based on the current load value, the historical maximum load value and the historical load average value.
[0086] Specifically, the following technical solution can be adopted to obtain the subtasks to be migrated according to the subtasks being processed by the node device to be migrated that currently needs to be migrated: decompose the subtasks being processed by the node device to be migrated to obtain task processing units; and use several task processing units as the subtasks to be migrated. In this way, some tasks in the node device to be migrated that currently needs to be migrated can be migrated.
[0087] Specifically, the selection of alternative node devices from the alternative device set may adopt the following scheme: obtaining the load level of each alternative node device in the alternative device set to obtain a second load level set; wherein the second load level set includes the load level of each alternative node device; screening out load levels that are smaller than the load level of the node device to be migrated from the second load levels; and using the alternative node device corresponding to the screened load level as the target node device.
[0088] As a further implementation manner, before migrating the subtask to be migrated to the target node device, it also includes: determining a load migration strategy for the node device to be migrated when performing load migration according to the load level of the node device to be migrated.
[0089] Specifically, the migration strategy for load migration of the node device to be migrated according to the load level of the node device to be migrated can adopt the following technical solution: when the load level of the node device to be migrated is level 2 or level 3, the load migration strategy is: load migration is performed without causing the target node device to exceed the load standard; when the load level of the node device to be migrated is level 4, the load migration strategy is: regardless of whether the target node device load exceeds the load standard, the subtask to be migrated is directly migrated to the target node device. The load migration here can be understood as a pre-migration, that is, trying to migrate, and if the migration fails, it will be returned.
[0090] Furthermore, the load balancing control method also includes: when the load level of the node device to be migrated is level four and the target node device cannot be selected from the set of alternative devices, an alarm is issued; when the load level of the node device to be migrated is level two or level three and the target node device cannot be selected from the set of alternative devices, the task in the node device to be migrated is kept executing.
[0091] Furthermore, when there are multiple active node devices that need to perform load migration, after migrating the subtask to be migrated to the target node device, the method further includes: after the migration of the subtask to be migrated in the active node device that currently needs to be migrated is completed, the next node device to be migrated in the sorting list is used as the node device to be migrated that currently needs to be migrated. In other words, the active node device in the sorting list that is in a better health state than the node device to be migrated that currently needs to be migrated is used as the next node device to be migrated.
[0092] In addition, it should be noted that 10 relative time units (tick) can be set as one locking period. If tick=2s, then the locking period is 20s. When a load migration occurs, no new load migration will be performed within a locking period.
[0093] like Figure 8 As shown, in order to explain in more detail the further implementation method of Example 1 of the present invention (i.e., load balancing control during operation), Example 4 is given:
[0094] Step 1: The main controller starts a heartbeat monitoring program.
[0095] Step 2: The node device sends a heartbeat packet to the monitoring program at an interval of Tick = 2 seconds. The content of the heartbeat packet contains the unique number of the current node device, the device capability set, the current health status of the load, the task list executed in the device, and the load statistics.
[0096] Load statistics include two main parts: the total load of the device and the load of each task. The time period includes the time from power-on to the present and the time of the most recent tick cycle. Load data includes the highest, lowest, and average values of the load in each time period.
[0097] Step 3: If a node device (such as Figure 8 The state of the NPU corresponding to the node NODE_4 in the figure is Error state, indicating that the current node device is overloaded, the efficiency will be reduced, or the output will be wrong (as shown in the figure, the frame rate of the NPU may not meet expectations, and the target detection and semantic segmentation tasks of cameras 1 and 2 may not be executed in time). At this time, through the alternative device lookup table in Appendix 2, find a suitable alternative device to perform the task of the Error device (find the devices that can perform target detection and image segmentation, including the CPU of NODE_1, the NPU of NODE_4, and the BPU of NODE_5. It is also known that the health status of NODE_5 is healthy, and the computing power of 5T is relatively surplus, so it can be decided to assign a target detection and semantic segmentation task to NODE_5 for execution).
[0098] Step 4: If the node device is in Warn state, the processing method is the same as that in Error state, but the priority is lower than that in Error state. That is, first ensure the load transfer in Error state, and then transfer the tasks of Warn node devices to suitable candidate node devices for execution after there is no Error. NODE_1's CPU load is in Warn state, and the candidate nodes for CPU task point cloud processing are NODE_1 and NODE_3, and NODE_3's DSP load is low at this time, so NODE_1's point cloud processing is transferred to NODE_3's DSP for execution.
[0099] Step 5: If there is a Fatal node device, the processing method is the same as the Error state, which is the highest level. The difference is that if there is no alternative device, load control fails, a warning message will be issued, and human intervention is required.
[0100] After the above load balancing control steps, the health status of each node device reaches Healthy or below, indicating that the load balancing control method is effective.
[0101] In the above control process, if the error or warning state exists after load balancing control, the system will continue to execute in the way with the least error.
[0102] It can be seen that the load balancing method provided in Example 1 of the present invention has the following advantages:
[0103] 1. Basic load distribution and control capabilities
[0104] (1) Depending on the scenario selected by the user or the number of devices, the load distribution of each processor in heterogeneous computing is different.
[0105] (2) During initialization, each processor is encapsulated into a node device and reports its own capability set. The bus collects and connects them in series to form a device tree, which will initially assign the desired tasks to each processor for execution. Processors with the same capabilities will become alternative solutions (redundant design), becoming a key factor in load balancing.
[0106] 2. Runtime Load Balancing Control
[0107] (1) Create a real-time monitoring program to monitor the running status of each processor in real time. When the load of a processor reaches the warning level (exceeding 80% of the total load), dynamically switch the tasks of each processor and switch a task of the high-load processor to the low-load processor for execution until the load status of each processor is healthy.
[0108] (2) Task switching is based on the capability set reported by each device during initialization. For example, both CPU1 and CPU2 have AI reasoning capabilities. When CPU1 is overloaded and CPU2 is underloaded, the monitoring program may move the AI reasoning task from CPU1 to CPU2 without any noticeable change.
[0109] Example 2
[0110] Corresponding to the first embodiment of the present invention, the second embodiment of the present invention provides a load balancing control device, Fig. 9 FIG. 2 is a schematic diagram of the structure of a load balancing control device in Embodiment 2 of the present invention. Fig. 9 As shown, the load balancing control device of embodiment 2 of the present invention includes a first acquisition module 20 , a decomposition module 21 and an allocation module 22 .
[0111] Specifically, the first acquisition module 20 is used to acquire the target task;
[0112] A decomposition module 21, used for decomposing the target task into multiple subtasks;
[0113] The allocation module 22 is used to allocate the plurality of subtasks to the node devices connected to the bus according to the correspondence between the preset processing capabilities and the node devices;
[0114] The correspondence between the processing capability and the node device includes identification information of each node device connected to the bus and the processing capability of each node device.
[0115] Furthermore, the load balancing control device also includes a second processing module 23 and a balancing module 24 .
[0116] Specifically, the second acquisition module 23 is used to acquire load statistics information of all active node devices, wherein the active node devices are node devices in an active state;
[0117] The balancing module 24 is used to determine whether there is an active node device that needs to perform load migration based on the load statistics information of all the active node devices; when there is an active node device that needs to perform load migration, determine the node device to be migrated; obtain the subtask to be migrated based on the subtask being processed by the node device to be migrated; search for a set of alternative devices that can process the subtask to be migrated according to the preset correspondence between processing capacity and node devices, wherein the correspondence between processing capacity and node devices is obtained based on the correspondence between processing capacity and node devices; select a target node device from the set of alternative devices; and migrate the subtask to be migrated to the target node device.
[0118] For details of the above load balancing control device, please refer to Figures 1 to 8The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.
[0119] Example 3
[0120] An embodiment of the present invention further provides an electronic device, which may include a processor and a memory, wherein the processor and the memory may be connected via a bus or in other ways.
[0121] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0122] The memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs and modules, such as program instructions / modules corresponding to the load balancing control method in the embodiment of the present invention (for example, Fig. 9 The processor executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory, that is, the load balancing control method in the above method embodiment is implemented.
[0123] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0124] The one or more modules are stored in the memory and when executed by the processor, perform the following steps: Figures 1 to 8 The load balancing control method in the illustrated embodiment.
[0125] For details of the above electronic equipment, please refer to Figures 1 to 9 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.
[0126] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.
[0127] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A load balancing control method, characterized in that: include: Get the target task; Decomposing the target task into a plurality of subtasks; Allocating the plurality of subtasks to node devices connected to the bus according to a preset correspondence between processing capabilities and node devices; The corresponding relationship between the processing capability and the node device includes identification information of each node device connected to the bus and the processing capability of each node device; Also includes: Obtaining load statistics information of all active node devices, wherein the active node devices are node devices in an active state; Determine whether there is an active node device that needs to perform load migration according to the load statistics information of all active node devices; When there is an active node device that needs to be migrated, determine the node device to be migrated that currently needs to be migrated; Obtaining the subtask to be migrated according to the subtask being processed by the node device to be migrated that currently needs to be migrated; Searching for a set of candidate devices capable of processing the subtask to be migrated according to the correspondence between the processing capacity and the node device; Selecting a target node device from the candidate device set; Migrating the subtask to be migrated to the target node device; The determining whether there is an active node device that needs to perform load migration according to the load statistics information of all active node devices includes: Determine the load level of each active node device according to the load statistical information of each active node device; When there is a load level greater than or equal to a preset first threshold among the load levels of all the active node devices, determining that there is an active node device that needs to perform load migration among all the active node devices; Determining the load level of each active node device according to the load statistical information of each active node device includes: For any active node device, determine whether there are unstable factors in the operation of the active node device according to the load statistics information of the active node device; When the task execution result of the active node device is completely in line with expectations and there are no unstable factors, the load level of the active node device is determined to be level one; When the task execution result of the active node device is completely in line with expectations but there are unstable factors, the load level of the active node device is determined to be level 2; When the task execution result of the active node device does not fully meet expectations and there are unstable factors, the load level of the active node device is determined to be level three; When the active node device cannot execute the task, it is determined that the load level of the active node device is level four.
2. The method according to claim 1, characterized in that The method for constructing the correspondence between the processing capability and the node device includes: Issue a search command; Acquire a capability set reported by each node device connected to the bus, wherein the capability set includes a processing capability possessed by the node device; The corresponding relationship between the processing capability and the node device is obtained according to the capability set reported by each node device.
3. The method according to claim 1, characterized in that The step of allocating the plurality of subtasks to the node devices connected to the bus according to the correspondence between the preset processing capabilities and the node devices comprises: For any subtask, searching for a processing capability capable of completing the subtask in the correspondence between the processing capability and the node device, and allocating the subtask to a node device corresponding to the processing capability capable of completing the subtask; All subtasks of the target task are traversed, and the multiple subtasks are allocated to node devices connected to the bus.
4. The method according to claim 1, characterized in that When there is an active node device that needs to perform load migration, determining the node device to be migrated that currently needs to be migrated includes: The active node devices that need to be load migrated are arranged in order of health status from bad to good to obtain a sorting table, and the active node device with the worst health status in the sorting table is used as the node device to be migrated that currently needs to be migrated.
5. The method according to claim 1, characterized in that The subtasks to be migrated obtained according to the subtasks being processed by the node device to be migrated that currently needs to be migrated include: Decomposing the subtasks being processed by the node device to be migrated to obtain task processing units; A plurality of task processing units are used as the subtasks to be migrated.
6. The method according to claim 1, characterized in that The selecting a candidate node device from the candidate device set comprises: Obtain the load level of each candidate node device in the candidate device set to obtain a second load level set; wherein the second load level set includes the load level of each candidate node device; Screening out a load level that is smaller than the load level of the node device to be migrated from the second load levels; The candidate node device corresponding to the screened load level is used as the target node device.
7. The method according to claim 1, characterized in that Before migrating the subtask to be migrated to the target node device, the method further includes: A load migration strategy for the node device to be migrated when performing load migration is determined according to the load level of the node device to be migrated.
8. The method according to claim 7, characterized in that The step of determining the migration strategy of the node device to be migrated when performing load migration according to the load level of the node device to be migrated includes: When the load level of the node device to be migrated is level 2 or level 3, the load migration strategy is: perform load migration without causing the load of the target node device to exceed the standard; When the load level of the node device to be migrated is level 4, the load migration strategy is: regardless of whether the load of the target node device exceeds the standard, directly migrate the subtask to be migrated to the target node device.
9. The method according to claim 1, characterized in that: Also includes: When the load level of the node device to be migrated is level 4 and the target node device cannot be selected from the candidate device set, an alarm is issued; When the load level of the node device to be migrated is level 2 or level 3 and a target node device cannot be selected from the candidate device set, the tasks in the node device to be migrated are kept to be executed.
10. The method according to claim 4, characterized in that When there are multiple active node devices that need to perform load migration, after migrating the subtask to be migrated to the target node device, the method further includes: After the migration of the subtask to be migrated in the active node device that currently needs to be migrated is completed, the next node device to be migrated in the sorting table is used as the node device to be migrated that currently needs to be migrated.
11. A load balancing control device, characterized in that: include: A first acquisition module is used to acquire a target task; A decomposition module, used to decompose the target task into multiple subtasks; An allocation module, used for allocating the plurality of subtasks to node devices connected to the bus according to a preset correspondence between processing capabilities and node devices; The corresponding relationship between the processing capability and the node device includes identification information of each node device connected to the bus and the processing capability of each node device; Also includes: A second acquisition module is used to acquire load statistics information of all active node devices, wherein the active node devices are node devices in an active state; A balancing module is used to determine whether there is an active node device that needs to be loaded migrated according to the load statistics of all active node devices; when there is an active node device that needs to be loaded migrated, determine the node device to be migrated; obtain the subtask to be migrated according to the subtask being processed by the node device to be migrated; search for a set of candidate devices that can process the subtask to be migrated according to the correspondence between the processing capacity and the node device, wherein the correspondence between the processing capacity and the node device is obtained according to the correspondence between the processing capacity and the node device; select a target node device from the set of candidate devices; and migrate the subtask to be migrated to the target node device; The determining whether there is an active node device that needs to perform load migration according to the load statistics information of all active node devices includes: Determine the load level of each active node device according to the load statistical information of each active node device; When there is a load level greater than or equal to a preset first threshold among the load levels of all the active node devices, determining that there is an active node device that needs to perform load migration among all the active node devices; Determining the load level of each active node device according to the load statistical information of each active node device includes: For any active node device, determine whether there are unstable factors in the operation of the active node device according to the load statistics information of the active node device; When the task execution result of the active node device is completely in line with expectations and there are no unstable factors, the load level of the active node device is determined to be level one; When the task execution result of the active node device is completely in line with expectations but there are unstable factors, the load level of the active node device is determined to be level 2; When the task execution result of the active node device does not fully meet expectations and there are unstable factors, the load level of the active node device is determined to be level three; When the active node device cannot execute the task, it is determined that the load level of the active node device is level four.
12. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the load balancing control method according to any one of claims 1 to 10 by executing the computer instructions.
13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the load balancing control method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Load balancing processing method and equipment
CN104935523A
A storage capacity adjustment method and device
CN109002263A
Task allocation method and device based on load allocation and terminal equipment
CN109783224A
Load balancing control method and device, storage medium and electronic equipment
CN111666159A
Load balancing method and related device
CN111930516A
