Load balancing computing resource processing method and device based on soft bus large-scale networking
In a large-scale soft bus networking environment, the device sending list is dynamically adjusted using the load balancing algorithm and task allocation is performed according to the slave device registration ability, which solves the load imbalance problem of soft bus technology during data transmission, and achieves more efficient computing resource configuration and system stability.
Patent Information
- Application Number
- CN202411895568.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-22
- Publication Date
- 2025-03-28
AI Technical Summary
In a large-scale networking environment for multi-device, soft bus technology is prone to load imbalance during data transmission, resulting in network congestion, increased delay or data packet loss.
By establishing a star network between the master and the slave device, dynamically adjusting the device sending list using the load balancing algorithm, and task allocation is performed based on the slave device's registration capabilities (including weights, priority, system core, CPU utilization and other information), ensuring that the data sending task is assigned to the most suitable slave device.
It realizes more reasonable allocation of computing resources in a large-scale networking environment, avoids resource waste, improves data processing efficiency, and ensures the stability and reliability of the system.
Smart Images

Figure CN119728553A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and device for processing load-balanced computing resources based on large-scale soft bus networking. Background Art
[0002] Soft bus technology has emerged as a key technology for realizing communication and interaction between devices. It is similar to the hardware bus in a computer system, but provides a channel for data transmission and communication between devices at the software level. Through the soft bus, different devices can discover each other, establish connections, and exchange data. Based on the distributed soft bus, OpenHarmony can automatically identify nearby devices under the same account, providing a basis for communication between devices, allowing devices to share information and work together. The self-developed Hongmeng soft bus is a star-shaped network. Data interaction between multiple slave devices is carried out through a master device, and data exchange between multiple star-shaped networks is carried out through a logical center device.
[0003] At present, there are many different load balancing technologies to meet different application requirements. For example, the hardware load balancing solution is to install load balancing equipment between devices and use specialized equipment to complete specialized tasks to achieve the purpose of load balancing. This is expensive and cannot achieve the reasonable allocation of existing resources. Software load balancing solutions, such as cluster load balancing algorithms, have high algorithm complexity and occupy a high amount of system computing resources.
[0004] In the prior art, in a complex environment where multiple devices are interconnected in a large-scale network (more than 400 devices), the soft bus technology often suffers from load imbalance during data transmission. When multiple devices request services or perform large amounts of data transmission at the same time, the soft bus may distribute too much load to certain specific devices or communication links, resulting in network congestion, increased latency, or data packet loss. Summary of the invention
[0005] In view of the deficiencies in the prior art, the object of the present invention is to provide a method and device for processing load-balanced computing resources based on large-scale networking of soft buses.
[0006] Specifically, the above invention objectives are achieved through the following technical solutions:
[0007] In a first aspect, the present application provides a method for processing load-balanced computing resources based on large-scale networking of a soft bus, comprising:
[0008] Multiple slave devices are networked in star shape with the master device. The slave devices send their respective registration capabilities to the master device. The master device saves the names of slave devices with the same capabilities into the same device sending list according to the registration capabilities of the slave devices.
[0009] During networking, each slave device updates its registration capability to the master device, and the master device obtains the updated device sending list through the load balancing algorithm;
[0010] The master device sends data to slave devices with a certain capability in the order of the device sending list;
[0011] The master device receives the status, CPU utilization and response time of each slave device at set intervals, and then calculates and updates the device sending list;
[0012] When the destination slave device fails to time out, the master device will send it to other slave devices with the same capabilities for processing, or return an error.
[0013] By allowing the slave device to send the registered capabilities containing information such as weight, priority, system kernel, CPU utilization, etc. to the master device, and classifying and sorting these capabilities and saving them in the corresponding device sending list, the master device can clearly understand the performance characteristics and current status of each slave device. In this way, when allocating data transmission tasks, the tasks can be accurately directed to the slave device that is most suitable for processing, avoiding resource waste caused by blind allocation, making the computing resources in the entire networking system more reasonably configured, giving full play to the advantages of each slave device, and improving the overall data processing efficiency under large-scale networking.
[0014] As a further improvement of the above solution, the registration capability of the slave device includes information such as weight, priority, system kernel, CPU utilization, etc.
[0015] As a further improvement of the above solution, the master device receives the status, CPU utilization and response time of the slave device every 10 seconds to 2 minutes.
[0016] The master device receives the status, CPU utilization and response time of each slave device at regular intervals (preferably 30 seconds). This real-time monitoring mechanism enables the system to keep track of the operation of each slave device in a timely manner. Once a slave device is found to have abnormal conditions such as excessive CPU utilization or long response time, the master device can quickly calculate and update the device sending list, dynamically adjust the subsequent data sending task allocation, and promptly reduce the pressure on overloaded devices, avoiding network congestion, data packet loss or increased delay caused by overloading of individual devices, thereby ensuring the stability and reliability of the entire large-scale networking system.
[0017] As a further improvement of the above solution, the load balancing algorithm can select different algorithms according to the usage scenario, including any one of the minimum response time algorithm, weighted polling algorithm, weighted best performance algorithm, and minimum connection number algorithm.
[0018] It can flexibly respond to different network load conditions according to actual scenarios. For example, the weighted polling algorithm can reasonably allocate tasks according to the weight of the slave devices, ensuring that the devices with strong performance bear more loads and the devices with weak performance will not be overloaded, thereby effectively balancing the working pressure of each slave device, preventing some devices from being idle while others are too busy, further optimizing the resource utilization efficiency of the entire networking system, and ensuring that data transmission and processing can be carried out stably and efficiently.
[0019] The core of the weighted polling algorithm is to assign different weights to the backend servers (corresponding to the slave devices in the context of large-scale soft bus networking) according to their different performance, processing capabilities and other factors, and then allocate requests (or data sending tasks) to each backend resource in turn according to the weight ratio to ensure more reasonable and efficient resource utilization. The implementation method is as follows:
[0020] 1) Define parameters:
[0021] Assume there are n slave devices, and the weight of device i (1≤i≤n) is w i ;
[0022] Define a variable current_weight[i] to record the current weight value of each device. Initially, current_weight[i] = w i ;
[0023] 2) Select the formula derived from the device:
[0024] Each time a slave device is selected, first find the slave device k corresponding to the maximum value in current_weight[i], that is,
[0025]
[0026] Select slave device k to process this task, and then update the current weight values of all slave devices:
[0027]
[0028] In actual implementation, a sufficiently large positive number can be added to ensure that the weight value is positive and convenient for comparison. The updated formula is:
[0029]
[0030] The core of the above formula is to dynamically adjust the weight value of each slave device so that in each round of selection, devices with high weights have a greater probability of being selected, and after enough rounds of selection, the proportion of the number of times each device is selected is close to their weight proportion, thereby achieving a load balancing effect.
[0031] As a further improvement of the above solution, the transmission mode of the master device and the slave device adopts one or more of Ethernet, WIFI, Bluetooth and Star Flash.
[0032] The transmission mode of the master device and the slave device adopts one or more of Ethernet, WIFI, Bluetooth and Star Flash. This diversified transmission mode selection enables the networking system to adapt to different application scenarios and environmental requirements. For example, Bluetooth transmission can be selected in scenarios where the bandwidth requirement is not high and low power consumption is required at short distances; WIFI can be used in scenarios where indoor coverage is wide and the data transmission rate requirement is moderate; and for some special scenarios such as industrial control that require high speed, low latency and high reliability, Ethernet or Star Flash transmission methods can be used. By flexibly adapting to different transmission modes, the scope of application of the load balancing computing resource processing solution is greatly broadened, enabling it to meet the requirements of more complex and changeable large-scale networking application scenarios.
[0033] As a further improvement of the above scheme, when the master device sends data to a certain destination slave device, if a failure timeout occurs (for example, if the timeout is set to 3 seconds and there is no response for 3 consecutive transmissions, it is considered a failure timeout), the master device can intelligently send the task to other slave devices with the same capabilities for processing, or return an error message. This mechanism effectively responds to emergencies such as possible failures of slave devices, ensures that data will not be lost due to unexpected problems of a certain device, and maximizes the continuity of business processes, further enhancing the ability of the entire networking system to respond to abnormal situations and improving the fault tolerance and robustness of the system.
[0034] In a second aspect, the present application provides a load balancing computing resource processing device based on large-scale networking of a soft bus, comprising:
[0035] at least one processor; and a memory communicatively coupled to the at least one processor;
[0036] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned load balancing computing resource processing method.
[0037] From the above, it can be seen that this application has the following beneficial effects:
[0038] The present application discloses a method for processing load-balanced computing resources based on large-scale networking of a soft bus, which can enhance system stability. In large-scale networking, when a slave device or a star network is abnormal, intelligent task transfer and transmission switching can be performed to reduce the single-point failure rate.
[0039] The present application discloses a method for processing load-balanced computing resources based on large-scale networking of a soft bus, which optimizes resource utilization, dynamically monitors large-scale networking loads, prevents overload of equipment and star networking, and optimizes the overall processing and response speed of a self-developed soft bus.
[0040] The load-balancing computing resource processing device involved in the present application scheme cooperates with at least one processor and a memory, and the processor can execute instructions stored in the memory to implement the above-mentioned load-balancing computing resource processing method. This architectural design ensures that the entire method can be effectively implemented at the hardware level, and provides a solid hardware foundation support for the achievement of the above-mentioned series of technical effects, so that the entire scheme is transformed from a theoretical concept to an effective technical means that can be actually implemented, which helps to promote the load-balancing computing resource processing based on large-scale networking of soft buses to play a positive role in practical applications.
[0041] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 A flow chart of a method for processing load-balanced computing resources provided in an embodiment of the present application;
[0044] Figure 2 A structural diagram of a load balancing computing resource processing method provided in an embodiment of the present application;
[0045] Figure 3 A load balancing schematic diagram of the star network soft bus logical networking provided in an embodiment of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] Embodiment 1
[0048] like Figure 1 As shown, the embodiment of the present application provides a method for processing load-balanced computing resources based on large-scale networking of a soft bus, including:
[0049] S101, multiple slave devices are networked with a master device in a star shape, the master device and the slave device are connected by WIFI, the slave devices send their respective registration capabilities to the master device, and the master device saves the names of slave devices with the same capabilities into the same device sending list according to the registration capabilities of the slave devices; the registration capabilities of the slave devices include information such as weight, priority, system kernel, CPU utilization, etc.;
[0050] S102, during the networking process, each slave device updates its registration capability to the master device, and the master device obtains the updated device sending list through a weighted polling algorithm;
[0051] The core of the weighted polling algorithm is to assign different weights to the backend servers (corresponding to the slave devices in the context of large-scale soft bus networking) according to their different performance, processing capabilities and other factors, and then allocate requests (or data sending tasks) to each backend resource in turn according to the weight ratio to ensure more reasonable and efficient resource utilization. The implementation method is as follows:
[0052] 1) Define parameters:
[0053] Assume there are n slave devices, and the weight of device i (1≤i≤n) is w i ;
[0054] Define a variable current_weight[i] to record the current weight value of each device. Initially, current_weight[i] = w i ;
[0055] 2) Select the formula derived from the device:
[0056] Each time a slave device is selected, first find the slave device k corresponding to the maximum value in current_weight[i], that is,
[0057]
[0058] Select slave device k to process this task, and then update the current weight values of all slave devices:
[0059]
[0060] In actual implementation, a sufficiently large positive number can be added to ensure that the weight value is positive and convenient for comparison. The updated formula is:
[0061]
[0062] The core of the above formula is to dynamically adjust the weight value of each slave device so that in each round of selection, the device with a higher weight has a greater probability of being selected, and after enough rounds of selection, the number of times each device is selected is close to their weight ratio, thereby achieving the effect of load balancing;
[0063] S103, the master device sends data to the slave device with a certain capability according to the device sending list order;
[0064] S104, the master device receives the status, CPU utilization and response time of each slave device every 30 seconds, and then calculates and updates the device sending list;
[0065] S105. When the destination slave device fails to time out, the master device will send it to other slave devices with the same capabilities for processing, or return an error. Figure 2 A structural diagram of a load balancing computing resource processing method provided in an embodiment of the present application.
[0066] Embodiment 2
[0067] This embodiment provides a load balancing computing resource processing device based on large-scale networking of soft buses, including:
[0068] at least one processor; and a memory communicatively coupled to the at least one processor;
[0069] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned load balancing computing resource processing method.
[0070] Embodiment 3
[0071] like Figure 3 As shown, this embodiment provides a load balancing principle for star network soft bus logical networking, specifically:
[0072] a) When the soft bus logic networking is successful, the logic center device A saves the routing table of the master devices with capabilities in each trusted star network, and then updates the load balancing device sending list according to the capabilities according to the load status of each star network and device A itself (including the slave device a1 with the specified capability of device A itself and the master devices C and D of the star network with the specified capability);
[0073] b) When device E sends a request for capability 1 to the star network soft bus logic group;
[0074] If the request capability 1 is sent to the master device D, the master device D queries the load of each device in its own single star network and processes the request according to the load balancing logic of the single star network; if the single star network is fully loaded at this time, the request will be forwarded to the logic center device A, and the device A will update the device sending list through the load balancing algorithm according to the load of its own single star network and the load of other master devices; when the logic center device A receives the processing result from a1 or the result returned by the star network forwarded to the master device C, it will return the processing result to the master device D, and the master device D will return the processing result to the device E;
[0075] If the request capability 1 is sent to the master device B, and there is no device in the star network of device B that can execute the request capability 1, the request will be forwarded to the logical center device A, and then device A will forward the request to its own device that can execute the request capability 1 or other master devices C and D in the star network that can execute the request capability 1. After processing the received result, it will be forwarded to the master device B, and finally the result will be returned to device E.
[0076] The above description is only a preferred embodiment of the present invention and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present invention is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present invention (but not limited to) to form a technical solution.
Claims
1. A method for processing load-balanced computing resources based on large-scale soft bus networking, characterized in that: include: Multiple slave devices are networked in star shape with the master device. The slave devices send their respective registration capabilities to the master device. The master device saves the names of slave devices with the same capabilities into the same device sending list according to the registration capabilities of the slave devices. During networking, each slave device updates its registration capability to the master device, and the master device obtains the updated device sending list through the load balancing algorithm; The master device sends data to slave devices with a certain capability in the order of the device sending list; The master device receives the status, CPU utilization and response time of each slave device at set intervals, and then calculates and updates the device sending list; When the destination slave device fails to time out, the master device will send it to other slave devices with the same capabilities for processing, or return an error.
2. According to claim 1, a method for processing load-balanced computing resources based on large-scale soft bus networking, characterized in that: The registered capabilities of the slave device include information such as weight, priority, system kernel, and CPU utilization.
3. According to claim 1, a method for processing load-balanced computing resources based on large-scale soft bus networking, characterized in that: The master device receives the status, CPU utilization, and response time of the slave device every 10 seconds to 2 minutes.
4. According to claim 3, a method for processing load-balanced computing resources based on large-scale soft bus networking, characterized in that: The master device receives the status, CPU utilization, and response time of the slave device every 30 seconds.
5. The method for processing load-balanced computing resources based on large-scale soft bus networking according to claim 1, characterized in that: The load balancing algorithm can select different algorithms according to the usage scenario, including the minimum response time algorithm, weighted polling algorithm, weighted best performance algorithm, and minimum connection number algorithm.
6. The method for processing load-balanced computing resources based on large-scale soft bus networking according to claim 5, characterized in that: The core of the weighted polling algorithm is to assign different weights to the backend servers according to their different performance, processing power and other factors, and then allocate requests to each backend resource in turn according to the weight ratio to ensure more reasonable and efficient resource utilization. The implementation method is as follows: 1) Define parameters: Assume there are n slave devices, and the weight of device i (1≤i≤n) is w i ; Define a variable current_weight[i] to record the current weight value of each device. Initially, current_weight[i] = w i ; 2) Select the formula derived from the device: Each time a slave device is selected, first find the slave device k corresponding to the maximum value in current_weight[i], that is, Select slave device k to process this task, and then update the current weight values of all slave devices: In actual implementation, a sufficiently large positive number can be added to ensure that the weight value is positive and convenient for comparison. The updated formula is: The core of the above formula is to dynamically adjust the weight value of each slave device so that in each round of selection, devices with high weights have a greater probability of being selected, and after enough rounds of selection, the proportion of the number of times each device is selected is close to their weight proportion, thereby achieving a load balancing effect.
7. The method for processing load-balanced computing resources based on large-scale soft bus networking according to claim 1, characterized in that: The transmission mode of the master device and the slave device adopts one or more of Ethernet, WIFI, Bluetooth and Star Flash.
8. A load balancing computing resource processing device based on large-scale soft bus networking, characterized in that: include: at least one processor; and, a memory communicatively coupled to the at least one processor; The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned load balancing computing resource processing method.