A network load balancing method, product, device and medium
By obtaining the historical operation data of the equipment and predicting future data volume changes, dynamically adjusting the equipment access strategy, the problem that the equipment access strategy in the existing technology cannot respond to changes in network status in a timely manner, and improving data processing efficiency and load balancing.
Patent Information
- Application Number
- CN202410456659.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-16
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2044-04-16
AI Technical Summary
In the prior art, the method of determining the number of equipment access based on historical traffic data cannot respond to changes in network status in a timely manner, resulting in low data processing efficiency and inability to fully utilize system performance.
By obtaining the historical operation data of the device, determining the target data volume, predicting future data volume changes, and dynamically adjusting the device access strategy to achieve load balancing.
It improves data processing efficiency, avoids equipment overload or resource waste, ensures the continuity and stability of data processing tasks, and achieves load balancing.
Smart Images

Figure CN118158224B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of load balancing, and in particular to a network load balancing method, product, device and medium. Background Art
[0002] With the rapid development and popularization of the Internet, the complexity and data volume of network applications are showing explosive growth, which undoubtedly puts higher requirements on the processing power and response speed of devices. By distributing network traffic to multiple devices, efficient use of network resources and flexible expansion of the system can be achieved, thus ensuring the stability and efficiency of network services.
[0003] Related technologies rely on historical traffic data to determine the number of devices connected. However, the network traffic in the system changes in real time, and this static device access strategy based on historical data often cannot respond to changes in network status in a timely manner, resulting in data processing efficiency being affected and the system's performance advantages being unable to be fully utilized. Summary of the invention
[0004] In order to solve the problem of low data processing efficiency in the prior art, the present application provides a network load balancing method, product, device and medium.
[0005] In the first aspect, the present application provides a network load balancing method, which adopts the following technical solution:
[0006] A network load balancing method, comprising:
[0007] Acquire historical operation data within a first preset time, wherein the historical operation data includes historical data volume and historical performance information of each device in the plurality of devices;
[0008] Determine a target data volume of the target device according to the historical data volume and historical performance information of the target device, wherein the target data volume represents a maximum data volume that the target device can carry under normal performance, and the target device is any one of the multiple devices;
[0009] Predicting, based on the historical data volumes corresponding to the multiple devices, how the total data volumes of the multiple devices change over time within a second preset time after the current moment;
[0010] According to the change of the total data volume over time and the target data volume corresponding to each of the multiple devices, the device access strategy within the second preset time is determined, so as to control the device access through the device access strategy to complete the data processing task.
[0011] By adopting the above technical solution, the historical operation information of the equipment is obtained, which is helpful for analyzing the load capacity and processing efficiency of the equipment. Determining the target data volume based on the historical data volume and historical performance information can reflect the maximum processing capacity of the equipment under normal performance conditions, help to formulate reasonable equipment access strategies, avoid equipment overload or resource waste, predict the change of total data volume in the future, and be able to perceive the growth or decline trend of data volume in advance, which is helpful to adjust the equipment access strategy and ensure the continuity and stability of data processing tasks. According to the change of total data volume and the target data volume of the equipment, a more accurate and reasonable equipment access strategy can be formulated, which helps to achieve load balancing, avoid the situation where some devices are overloaded while other devices are idle, and can also improve data processing efficiency.
[0012] In a preferred example, the present application may be further configured as follows: determining the device access strategy within the second preset time according to the change of the total data volume over time and the target data volume corresponding to each of the multiple devices, including:
[0013] Generate a curve of the total amount of data changing over time according to the change of the total amount of data over time;
[0014] Dividing the variation curve into a plurality of curve segments;
[0015] Determine a maximum total amount of data corresponding to a target curve segment, wherein the target curve segment is any one of the multiple curve segments;
[0016] Determining a plurality of device combinations from the plurality of devices according to the maximum total data volume and the target data volumes corresponding to the plurality of devices respectively;
[0017] Determine the sub-device access strategy for the target time period according to the plurality of device combinations, wherein the target time period is the time period corresponding to the target curve segment, and the sub-device access strategies corresponding to each of the plurality of curve segments constitute the device access strategy within the second preset time period.
[0018] By adopting the above technical solution, a total data volume change curve is generated and divided into multiple curve segments, which is helpful to identify the characteristics and needs of the data volume in different time periods, so as to formulate more targeted device access strategies and determine the maximum total data volume of the target curve segment, which helps to understand the maximum demand for data processing in the target time period, ensure that the connected devices can meet the data processing needs, and avoid untimely data processing. The device combination is determined based on the maximum total data volume and the target data volume of the device, which can ensure that the total processing capacity of the selected device combination can meet the data processing needs in the target time period, thereby improving equipment utilization and data processing efficiency. By formulating a sub-device access strategy for the time period corresponding to each curve segment, it can be ensured that within the second preset time, the device access can be dynamically adjusted according to the change in data volume, which meets the data processing needs while improving the system flexibility and response speed.
[0019] In a preferred example, the present application may be further configured as follows: determining a plurality of device combinations from the plurality of devices according to the maximum total data volume and the target data volumes corresponding to the plurality of devices respectively, including:
[0020] Determining a data volume range according to the maximum total data volume, wherein a minimum value of the data volume range is not less than the maximum total data volume;
[0021] A plurality of device combinations are determined from the plurality of devices, wherein the sum of target data volumes of the devices in each device combination is within the data volume range.
[0022] By adopting the above technical solutions, we can ensure that the selected equipment combination can meet the data processing needs in the current time period and avoid insufficient data processing capacity. By flexibly combining equipment, we can help optimize resource utilization and improve data processing efficiency.
[0023] In a preferred example, the present application may be further configured as follows: the sub-device access strategy for the target time period is determined according to the plurality of device combinations, including:
[0024] Determining whether the number of the plurality of device combinations is one;
[0025] When the number of the plurality of device combinations is not one, determining a sum of target data volumes of devices in each of the plurality of device combinations;
[0026] According to the sum of the target data volumes of the devices in each device combination, the plurality of device combinations are sorted from large to small according to the sum of the target data volumes to obtain a device combination sequence;
[0027] A switching time is determined from the target time period, and a sub-device access strategy for the target time period is determined according to the device combination sequence and the switching time.
[0028] By adopting the above technical solution, it is determined whether the number of several device combinations is one. If it is one, it indicates that the data processing demand of the current time period can be met by one device, and there is no need for subsequent sorting and switching operations, which helps to simplify the process and improve efficiency. If it is not one, the sum of the target data volume of the devices in each device combination is calculated, and the total processing capacity of each device combination can be understood. By sorting the device combinations according to the sum of the target data volume, a device combination sequence with processing capacity ranging from strong to weak can be obtained, which helps to give priority to combinations with stronger processing capacity when the devices are connected, ensuring efficient data processing. According to the device combination sequence and switching time, a specific sub-device access strategy is formulated to ensure that the devices are always kept in a good working state, thereby improving data processing efficiency.
[0029] In a preferred example, the present application can be further configured as follows: the method further includes:
[0030] Obtaining a current data volume, and determining whether the current data volume is within the data volume range;
[0031] If the current data volume is not within the data volume range, the sub-device access strategy corresponding to the current moment is adjusted according to the current data volume.
[0032] By adopting the above technical solution, it is possible to determine whether the current data volume is within a pre-set data volume range. If the current data volume exceeds the data volume range, it means that the current device access strategy may not be applicable and needs to be adjusted, which helps to optimize the network load.
[0033] In a preferred example, the present application may be further configured as follows: adjusting the sub-device access strategy corresponding to the current moment according to the current data volume includes:
[0034] Determine the sum of the target data volumes of the access devices at the current moment;
[0035] If the current data volume is lower than the minimum value of the data volume range, a first difference between the sum of the target data volumes of the devices currently connected and the current data volume is calculated, and a device to be evacuated is determined from the devices currently connected according to the first difference, and the device to be evacuated is evacuated from the network;
[0036] If the current data volume exceeds the maximum value of the data volume range, the second difference between the sum of the target data volumes of the devices currently connected and the maximum value of the data volume range is calculated, and the access device is determined from the devices that are not currently connected based on the second difference, and the access device is connected to the network.
[0037] By adopting the above technical solution, the evacuation of equipment or the connection of new equipment can be accurately determined based on the difference between the current data volume and the data volume range, thereby avoiding excessive waste or insufficient allocation of resources and ensuring the rational use of equipment resources.
[0038] In a preferred example, the present application may be further configured as follows: determining the target data volume of the target device according to the historical data volume and historical performance information of the target device includes:
[0039] Determining, according to the historical performance information of the target device, a performance index of the target device at each moment within the first preset time;
[0040] Determine a target performance index and a target time corresponding to the target performance index from the performance indexes at each time point within the first preset time;
[0041] The data volume corresponding to the target time is determined from the historical data volume of the target device to obtain the target data volume of the target device.
[0042] By adopting the above technical solution and combining it with the historical performance information of the target device, we can accurately understand the performance status of the target device at different times, which helps to determine the performance index of the target device under the optimal working state, and then determine the corresponding target data volume, which helps to improve the efficiency and stability of network load balancing and provide more reliable and efficient support for data processing.
[0043] In a second aspect, the present application provides a computer program product, which adopts the following technical solution:
[0044] A computer program product includes a computer program. When the computer program is executed by a processor, the network load balancing method as described in any one of the first aspects is implemented.
[0045] In a third aspect, the present application provides an electronic device, which adopts the following technical solution:
[0046] one or more processors;
[0047] Memory;
[0048] At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the network load balancing method as described in any one of the first aspects.
[0049] In a fourth aspect, the present application provides a computer-readable storage medium, which adopts the following technical solution:
[0050] A computer-readable storage medium stores a computer program, which, when executed in a computer, causes the computer to execute the network load balancing method as described in any one of the first aspects.
[0051] In summary, this application includes the following beneficial technical effects:
[0052] This application helps to analyze the load capacity and processing efficiency of the device by obtaining the historical operation information of the device, determines the target data volume based on the historical data volume and historical performance information, can reflect the maximum processing capacity of the device under normal performance conditions, helps to formulate reasonable device access strategies, avoid device overload or resource waste, predict the change of total data volume in the future, can perceive the growth or decline trend of data volume in advance, helps to adjust the device access strategy, ensure the continuity and stability of data processing tasks, and can formulate more accurate and reasonable device access strategies based on the change of total data volume and the target data volume of the device, which helps to achieve load balancing, avoid the situation where some devices are overloaded while other devices are idle, and can also improve data processing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a structural diagram of a network load balancing system provided in an embodiment of the present application;
[0054] Figure 2 It is a flowchart of a network load balancing method provided in an embodiment of the present application;
[0055] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0056] The following is combined with Figure 1 -Attached Figure 3 This application is described in further detail.
[0057] This specific embodiment is merely an explanation of the present application and is not a limitation of the present application. After reading this specification, those skilled in the art may make modifications to the present embodiment without any creative contribution as needed, but such modifications are protected by the patent law as long as they are within the scope of the claims of the present application.
[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are 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.
[0059] In addition, the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article, unless otherwise specified, generally means that the associated objects before and after are in an "or" relationship.
[0060] For ease of understanding, the following is an introduction based on the structural diagram of the network load balancing system. Figure 1 As shown, the network load balancing method is performed by an electronic device, which can be a server or a terminal device, wherein the server can be an independent physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services. The terminal device can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited to this. The electronic device can be directly or indirectly connected to multiple devices via wired or wireless communication. The electronic device introduces a load balancing mechanism, which can dynamically access the device according to the device performance and the current data volume, realize load balancing distribution, and avoid waste of device resources and uneven load problems.
[0061] See also Figure 2 , which shows a schematic diagram of a flow chart of a network load balancing method provided in an embodiment of the present application, the method comprises steps S201 to S204, wherein:
[0062] S201. Acquire historical operation data within a first preset time, where the historical operation data includes a historical data volume and historical performance information of each device among a plurality of devices.
[0063] In this embodiment, the first preset time can be set according to actual needs, for example, one week or one month before the current moment, and multiple devices are devices that can be used for data processing in the system. The historical operation data of each device can be obtained through log analysis, monitoring tools or from the device interface, and the obtained historical operation data includes historical data volume and historical performance information. The historical data volume includes the device data volume collected in real time, that is, the device traffic, and the historical performance information includes the device performance indicators collected in real time. The performance indicators may include bandwidth utilization, CPU utilization, disk space utilization, and memory utilization.
[0064] S202. Determine a target data volume of the target device according to the historical data volume and historical performance information of the target device. The target data volume represents the maximum data volume that the target device can carry under normal performance. The target device is any one of the multiple devices.
[0065] In this embodiment, the historical performance information of the target device includes the device performance indicators collected in real time, and the performance indicators may include bandwidth utilization, CPU utilization, disk space utilization, and memory utilization. Furthermore, the acquired performance indicators may be timestamped, and the performance index of the target device at the timestamp may be generated according to the performance indicators corresponding to the timestamp, thereby obtaining the performance index corresponding to different moments within the first preset time.
[0066] Further, a criterion for determining whether the device performance is normal may be preset. Optionally, the device performance may be determined to be normal when the performance index reaches a target performance index. This embodiment does not specifically limit the criterion and the target performance index. The target time corresponding to the device performance index reaching the target performance index may be determined from the first preset time. Furthermore, the data volume corresponding to the target time, i.e., the target data volume, may be determined from the historical data volume of the target device. If there are multiple target times, the maximum data volume is determined from the data volumes corresponding to the respective target times as the target data volume.
[0067] S203: predict, based on the historical data volumes corresponding to the multiple devices, how the total data volumes of the multiple devices change over time within a second preset time after the current moment.
[0068] Specifically, the total historical data volume of multiple devices can be determined based on the historical data volume corresponding to each of the multiple devices. The total historical data volume is the change of the total data volume over time within the first preset time. Then, the total historical data volume is analyzed by time series prediction algorithms such as ARIMA model and LSTM to predict the change of the total data volume over time within the second preset time after the current moment. The duration of the second preset time can be set according to actual needs.
[0069] S204: Determine a device access strategy within a second preset time according to the change of the total data volume over time and the target data volume corresponding to each of the multiple devices, so as to control device access through the device access strategy to complete the data processing task.
[0070] In this embodiment, the second preset time can be divided into multiple time periods, and any of the time periods can be used as the target time period. The maximum total data volume of the target time period can be determined based on the change of the total data volume over time, and then the data volume range can be determined based on the maximum total data volume, and several device combinations can be determined from multiple devices, and the sum of the target number of devices in each device combination is within the data volume range. Within the target time period, a device combination can be randomly determined from several device combinations, and the device corresponding to the device combination is connected to the network to obtain the sub-device access strategy within the target time period. The sub-device access strategies corresponding to each of the multiple time periods constitute the device access strategy within the second preset time period.
[0071] The embodiments of the present application obtain historical operation information of the device, which helps to analyze the load capacity and processing efficiency of the device. The target data volume is determined based on the historical data volume and historical performance information, which can reflect the maximum processing capacity of the device under normal performance conditions, help to formulate a reasonable device access strategy, avoid device overload or resource waste, predict the change of the total data volume in the future, and can perceive the growth or decline trend of the data volume in advance, which helps to adjust the device access strategy and ensure the continuity and stability of data processing tasks. According to the change of the total data volume and the target data volume of the device, a more accurate and reasonable device access strategy can be formulated, which helps to achieve load balancing, avoid the situation where some devices are overloaded while other devices are idle, and can also improve data processing efficiency.
[0072] A possible implementation of the embodiment of the present application is to determine the device access strategy within the second preset time according to the change of the total data volume over time and the target data volume corresponding to each of the multiple devices, including:
[0073] Generate a curve of the total amount of data changing over time according to the total amount of data changing over time;
[0074] Divide the change curve into a plurality of curve segments;
[0075] Determine the maximum total data volume corresponding to the target curve segment, where the target curve segment is any one of the multiple curve segments;
[0076] Determine a plurality of device combinations from the plurality of devices according to the maximum total data volume and the target data volumes corresponding to the plurality of devices respectively;
[0077] The sub-device access strategy for the target time period is determined according to a combination of several devices. The target time period is the time period corresponding to the target curve segment. The sub-device access strategies corresponding to the multiple curve segments constitute the device access strategy within the second preset time period.
[0078] In this embodiment, according to the change of the total data volume over time, the total data volume at each time point within the second preset time is determined, and a time series data set is generated. The obtained time series data set is plotted into a change curve graph using a drawing tool or a programming language (such as Python's matplotlib library), wherein the horizontal axis represents time and the vertical axis represents the total data volume.
[0079] Furthermore, the change curve is divided into a plurality of curve segments, and the division process may be: setting a division threshold, the division threshold represents the upper limit of the allowable range of the total data volume in a curve segment, that is, the difference between the maximum data volume and the minimum data volume in the curve segment. Then, the first data point of the change curve is taken as the starting data point, and each data point is traversed backward along the time axis, that is, the total data volume corresponding to the subsequent time points is determined one by one. During the traversal process, the difference between the maximum and minimum values of the total data volume in the curve segment before the current data point is calculated. Once this difference reaches the division threshold, the current data point is taken as a division node, that is, the part from the starting data point to the current data point constitutes a curve segment. The next data point of the current data point is taken as the new starting data point, and the above division process is repeated, so that the change curve is divided into a plurality of curve segments, and the data volume variation range of each curve segment is within the set division threshold.
[0080] Furthermore, any one of the multiple curve segments is used as the target curve segment, the maximum total data volume of the target curve segment is determined, and the data volume range is determined based on the maximum total data volume, and the minimum value of the data volume range is not less than the maximum total data volume. Then, based on the obtained data volume range and the target data volumes corresponding to the multiple devices, several device combinations are determined from the multiple devices, and the sum of the target data volumes of the devices in each device combination is within the data volume range.
[0081] The embodiment of the present application generates a total data volume change curve and divides it into multiple curve segments, which helps to identify the characteristics and needs of the data volume in different time periods, thereby formulating a more targeted device access strategy and determining the maximum total data volume of the target curve segment, which helps to understand the maximum demand for data processing in the target time period, ensure that the connected devices can meet the data processing needs, and avoid untimely data processing. The device combination is determined based on the maximum total data volume and the target data volume of the device, which can ensure that the total processing capacity of the selected device combination can meet the data processing needs in the target time period, thereby improving device utilization and data processing efficiency. By formulating a sub-device access strategy for the time period corresponding to each curve segment, it can be ensured that within the second preset time, the device access can be dynamically adjusted according to the change in data volume, thereby meeting the data processing needs while improving the system flexibility and response speed.
[0082] A possible implementation of the embodiment of the present application is to determine a plurality of device combinations from a plurality of devices according to the maximum total data volume and the target data volume corresponding to each of the plurality of devices, including:
[0083] The data volume range is determined according to the maximum total data volume, and the minimum value of the data volume range is not less than the maximum total data volume;
[0084] A plurality of device combinations are determined from a plurality of devices, wherein a sum of target data volumes of the devices in each device combination is within a data volume range.
[0085] In this embodiment, considering the possible fluctuations or emergencies in data processing, a safety margin can be added to the maximum total data volume, and the safety margin can be a fixed proportion of the maximum total data volume, such as 10%, or a fixed value, which is not specifically limited in this embodiment. Furthermore, the maximum data volume plus the safety margin is used as the upper limit of the data volume range, and the lower limit of the data volume range can be directly set to the maximum total data volume.
[0086] Furthermore, according to the target data volumes corresponding to the multiple devices, devices with target data volumes within the data volume range are preliminarily screened out from the multiple devices as candidate devices for constructing the device combination. Then, a combination algorithm, such as backtracking method, dynamic programming, etc., is used to generate a device combination that meets the conditions from the candidate devices, and the sum of the target data volumes of the devices in each device combination is within the determined data volume range. In order to avoid generating too many device combinations and causing complex subsequent processing, it is possible to consider limiting the number of devices in the device combination. This embodiment does not specifically limit the number of devices.
[0087] The embodiments of the present application ensure that the selected device combination can meet the data processing requirements within the current time period, avoid insufficient data processing capabilities, and help optimize resource utilization and improve data processing efficiency by flexibly combining devices.
[0088] A possible implementation of the embodiment of the present application is to determine a sub-device access strategy for a target time period according to a combination of several devices, including:
[0089] Determine whether the number of a plurality of device combinations is one;
[0090] When the number of the plurality of device combinations is not one, determining the sum of the target data volumes of the devices in each of the plurality of device combinations;
[0091] According to the sum of the target data volumes of the devices in each device combination, several device combinations are sorted from large to small according to the sum of the target data volumes to obtain a device combination sequence;
[0092] The switching time is determined from the target time period, and the sub-device access strategy of the target time period is determined according to the device combination sequence and the switching time.
[0093] In a possible case, the number of the device combinations is one, and the sub-device access strategy in the target time period may be to connect the device corresponding to the device combination to the network for data processing.
[0094] In another possible situation, the number of several device combinations is not one, then the sum of the target data volume of the devices in each of the several device combinations is determined, and the several device combinations are sorted from large to small according to the sum of the target data volume, and the device combination sequence is obtained, which can be expressed as S=[S1, S2...Sn], where n is the number of several device combinations in the device combination sequence. Further, the target time period is subdivided into a plurality of sub-target time periods equal to the number of device combinations in the device combination sequence, and the obtained plurality of sub-target time periods can be expressed as a sub-target time period sequence T=[T1, T2...Tn] from early to late, where n is the number of the plurality of sub-target time periods, which is equal to the number of several device combinations in the device combination sequence. The division of the sub-target time periods is based on the principle of proportion: the proportion between each sub-target time period corresponds to the proportion of the sum of the target data volume of each device combination in the device combination sequence, so that the device combination with stronger processing power can access the network for a longer time.
[0095] Furthermore, Si is any device combination in the device combination sequence, Ti is any time period in the sub-target time period sequence, Ti+1 is the sub-target time period after Ti, in the sub-target time period Ti, the device combination Si is used to access the network, in the sub-target time period Ti+1, the device combination Si+1 is used to access the network, and the intersection time point of Ti and Ti+1 (the end time point of Ti or the start time point of Ti+1) is the switching time of the device combination Si and Si+1. The intersection time point of every two adjacent sub-target time periods in the sub-target time period sequence is a switching time, which is used to switch the corresponding device combination, so that each sub-target time period corresponds to a device combination. The sub-access strategy of the target time period includes switching the device combination according to the determined switching time in the target time period, so that each sub-target time period corresponds to a device combination.
[0096] The embodiment of the present application determines whether the number of several device combinations is one. If it is one, it indicates that the data processing demand of the current time period can be met by one device, and there is no need for subsequent sorting and switching operations, which helps to simplify the process and improve efficiency. If it is not one, the sum of the target data volume of the devices in each device combination is calculated to understand the total processing capacity of each device combination. By sorting the device combinations according to the sum of the target data volume, a device combination sequence with processing capacity ranging from strong to weak can be obtained, which helps to give priority to combinations with stronger processing capacity when accessing the devices, ensuring efficient data processing. According to the device combination sequence and switching time, a specific sub-device access strategy is formulated to ensure that the devices are always kept in a good working state, thereby improving data processing efficiency.
[0097] In a possible implementation manner of the embodiment of the present application, the method further includes:
[0098] Get the current data volume, and determine whether the current data volume is within the data volume range;
[0099] If the current data volume is not within the data volume range, the access device at the current moment is adjusted according to the current data volume.
[0100] In one possible scenario, if the current data volume is within the data volume range, the device access is controlled according to the set device access policy to complete the data processing task. In another possible scenario, if the current data volume is not within the data volume range, the sub-device access policy corresponding to the current moment is adjusted according to the current data volume.
[0101] The embodiment of the present application determines whether the current data volume is within a pre-set data volume range. If the current data volume exceeds the data volume range, it means that the current device access strategy may not be applicable and needs to be adjusted, which helps to optimize the network load.
[0102] A possible implementation of the embodiment of the present application is to adjust the sub-device access strategy corresponding to the current moment according to the current data volume, including:
[0103] Determine the sum of the target data volumes of the access devices at the current moment;
[0104] If the current data volume is lower than the minimum value of the data volume range, a first difference between the sum of the target data volumes of the devices currently connected and the current data volume is calculated, and a device to be evacuated is determined from the devices currently connected according to the first difference, and the evacuated device is evacuated from the network;
[0105] If the current data volume exceeds the maximum value of the data volume range, the second difference between the sum of the target data volumes of the devices currently connected and the maximum value of the data volume range is calculated, and the access device is determined from the devices not currently connected based on the second difference, and the access device is connected to the network.
[0106] In this embodiment, the target data volume of each device in the sub-device access policy corresponding to the current moment and the sum of the target data volumes of each device may be determined first.
[0107] In a possible situation, the current data volume is lower than the minimum value of the data volume range, a first difference is calculated, and a device whose target data volume does not exceed the first difference is determined from the devices currently connected according to the first difference as an evacuation device, and if there is no device whose target data volume does not exceed the first difference among the devices currently connected, the sub-device access policy corresponding to the current moment is not adjusted. There may be one or more evacuation devices, and a device whose sum of target data volume does not exceed the first difference may be determined from the devices currently connected according to the first difference as an evacuation device.
[0108] In another possible situation, if the current data volume exceeds the maximum value of the data volume range, the second difference is calculated, and the device whose target data volume exceeds the second difference is determined from the devices not currently connected to the network according to the second difference as the access device, and if there is no device whose target data volume exceeds the second difference among the devices currently connected, a warning signal is sent to prompt relevant technicians to come and check. Among them, there may be one or more access devices, and the device whose sum of target data volume exceeds the second difference can be determined from the devices not currently connected to the network according to the second difference as the access device.
[0109] The embodiment of the present application accurately determines whether to evacuate a device or connect a new device based on the difference between the current data volume and the data volume range, thereby avoiding excessive waste or insufficient allocation of resources and ensuring the rational use of device resources.
[0110] A possible implementation of the embodiment of the present application is to determine the target data volume of the target device according to the historical data volume and historical performance information of the target device, including:
[0111] Determine the performance index of the target device at each moment within the first preset time according to the historical performance information of the target device;
[0112] Determine a target performance index and a target time corresponding to the target performance index from the performance indexes at each time point within the first preset time period;
[0113] From the historical data volume of the target device, the data volume corresponding to the target time is determined to obtain the target data volume of the target device.
[0114] In this embodiment, the historical performance information includes the device performance indicators collected in real time, and the performance indicators may include bandwidth utilization, CPU utilization, disk space utilization, and memory utilization. At any moment in the first preset time, the average value of the bandwidth utilization, CPU utilization, disk space utilization, and memory utilization at that moment can be used as the performance index corresponding to that moment, thereby obtaining the performance index at each moment in the first preset time. The target performance index can be set according to actual needs. Optionally, the maximum performance index can be determined from the performance index at each moment in the first preset time, and then the product of the maximum performance index and the performance index ratio is used as the target performance index, wherein the performance index ratio can be set according to actual needs. Optionally, the performance index ratio can be 80%.
[0115] By combining the historical performance information of the target device, the embodiment of the present application can accurately understand the performance status of the target device at different times, which helps to determine the performance index of the target device under the optimal working state, and then determine the corresponding target data volume, which helps to improve the efficiency and stability of network load balancing and provide more reliable and efficient support for data processing.
[0116] An embodiment of the present application provides a computer program product, including a computer program. When the computer program is executed by a processor, the contents shown in the aforementioned network load balancing method embodiment are implemented.
[0117] An electronic device is provided in an embodiment of the present application, such as Figure 3 As shown, Figure 3 The electronic device 300 shown includes: a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 300 may also include a transceiver 304. It should be noted that in actual applications, the transceiver 304 is not limited to one, and the structure of the electronic device 300 does not constitute a limitation on the embodiments of the present application.
[0118] The processor 301 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. The processor 301 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0119] The bus 302 may include a path to transmit information between the above components. The bus 302 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 302 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but it does not mean that there is only one bus or only one type of bus.
[0120] The memory 303 may be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0121] The memory 303 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 301. The processor 301 is used to execute the application code stored in the memory 303 to implement the content shown in the above network load balancing method embodiment.
[0122] Figure 3 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0123] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the contents shown in the aforementioned network load balancing method embodiment.
[0124] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0125] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A network load balancing method, characterized in that: include: Acquire historical operation data within a first preset time, wherein the historical operation data includes historical data volume and historical performance information of each device in the plurality of devices; Determine a target data volume of the target device according to the historical data volume and historical performance information of the target device, wherein the target data volume represents a maximum data volume that the target device can carry under normal performance, and the target device is any one of the multiple devices; Predicting, based on the historical data volumes corresponding to the multiple devices, how the total data volumes of the multiple devices change over time within a second preset time after the current moment; Determine, according to the change of the total data volume over time and the target data volume corresponding to each of the multiple devices, a device access strategy within the second preset time, so as to control device access through the device access strategy to complete the data processing task; The determining, according to the change of the total data volume over time and the target data volume corresponding to each of the multiple devices, a device access strategy within the second preset time includes: Generate a curve of the total amount of data changing over time according to the change of the total amount of data over time; Dividing the variation curve into a plurality of curve segments; Determine a maximum total amount of data corresponding to a target curve segment, wherein the target curve segment is any one of the multiple curve segments; Determining a plurality of device combinations from the plurality of devices according to the maximum total data volume and the target data volumes corresponding to the plurality of devices respectively; A sub-device access strategy for a target time period is determined based on the plurality of device combinations, wherein the target time period is a time period corresponding to the target curve segment, and the sub-device access strategies corresponding to each of the plurality of curve segments constitute a device access strategy within the second preset time period.
2. The network load balancing method according to claim 1, characterized in that: The determining of a plurality of device combinations from the plurality of devices according to the maximum total data volume and the target data volumes corresponding to the plurality of devices respectively includes: Determining a data volume range according to the maximum total data volume, wherein a minimum value of the data volume range is not less than the maximum total data volume; A plurality of device combinations are determined from the plurality of devices, wherein the sum of target data volumes of the devices in each device combination is within the data volume range.
3. The network load balancing method according to claim 1, characterized in that: The determining of the sub-device access strategy for the target time period according to the plurality of device combinations includes: Determining whether the number of the plurality of device combinations is one; When the number of the plurality of device combinations is not one, determining a sum of target data volumes of devices in each of the plurality of device combinations; According to the sum of the target data volumes of the devices in each device combination, the plurality of device combinations are sorted from large to small according to the sum of the target data volumes to obtain a device combination sequence; A switching time is determined from the target time period, and a sub-device access strategy for the target time period is determined according to the device combination sequence and the switching time.
4. The network load balancing method according to claim 2, characterized in that: The method further comprises: Obtaining a current data volume, and determining whether the current data volume is within the data volume range; If the current data volume is not within the data volume range, the sub-device access strategy corresponding to the current moment is adjusted according to the current data volume.
5. The network load balancing method according to claim 4, characterized in that: The adjusting the sub-device access strategy corresponding to the current moment according to the current data volume includes: Determine the sum of the target data volumes of the access devices at the current moment; If the current data volume is lower than the minimum value of the data volume range, a first difference between the sum of the target data volumes of the devices currently connected and the current data volume is calculated, and a device to be evacuated is determined from the devices currently connected according to the first difference, and the device to be evacuated is evacuated from the network; If the current data volume exceeds the maximum value of the data volume range, the second difference between the sum of the target data volumes of the devices currently connected and the maximum value of the data volume range is calculated, and the access device is determined from the devices that are not currently connected based on the second difference, and the access device is connected to the network.
6. The network load balancing method according to claim 1, characterized in that: The step of determining a target data volume of the target device according to the historical data volume and historical performance information of the target device includes: Determining, according to the historical performance information of the target device, a performance index of the target device at each moment within the first preset time; Determine a target performance index and a target time corresponding to the target performance index from the performance indexes at each time point within the first preset time; The data volume corresponding to the target time is determined from the historical data volume of the target device to obtain the target data volume of the target device.
7. A computer program product, characterized in that The method comprises a computer program, which, when executed by a processor, implements the steps of the network load balancing method according to any one of claims 1 to 6.
8. An electronic device, characterized in that: include: at least one processor; Memory; At least one application, wherein the at least one application is stored in a memory and configured to be executed by at least one processor, and the at least one application is configured to: execute the network load balancing method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed in a computer, the computer is caused to execute the network load balancing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Pod scheduling method based on k8s, storage medium and equipment
CN116244061A
Edge cloud cluster task scheduling method and device based on availability prediction
CN116827951A