Load balancing method and device based on DPVS, equipment and storage medium
By combining DPVS, zero copy technology and intelligent traffic identification mechanism, real-time monitoring and adjustment of server load status, the performance bottlenecks and scalability problems of load balancing methods in the existing technology are solved, efficient packet processing and distribution are achieved, and the system is improved stability and reliability.
Patent Information
- Application Number
- CN202411213179.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
AI Technical Summary
The existing load balancing method based on DPVS has performance bottlenecks and scalability problems, and cannot meet the needs of modern high-traffic and high-concurrency applications.
Combining DPVS, zero-copy technology and intelligent traffic identification mechanism, we can monitor the working status of each server in real time, dynamically adjust the DPVS processing module allocation plan, and optimize resource usage and packet processing efficiency.
It improves the overall performance of the system, ensures the consistency and high availability of the system, reduces the dwell time of data packets in the system, reduces processing and transmission delays, and avoids system crashes or performance degradation caused by uneven load.
Smart Images

Figure CN119094451A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a load balancing method, device, equipment and storage medium based on DPVS. Background Art
[0002] Load balancing technology improves system performance and reliability by distributing traffic to multiple servers. However, existing load balancing methods based on DPVS still have performance bottlenecks and scalability issues, and cannot fully meet the needs of modern high-traffic, high-concurrency applications.
[0003] It can be seen that the existing technology still needs to be improved and enhanced. Summary of the invention
[0004] In order to overcome the shortcomings of the prior art, the purpose of the present invention is to provide a load balancing method, device, equipment and storage medium based on DPVS, which combines DPVS, zero-copy technology and intelligent traffic identification mechanism to greatly improve the overall performance of the system, and can monitor the working status of each server in real time to ensure the consistency and high availability of the system.
[0005] The first aspect of the present invention provides a DPVS-based load balancing method, comprising: when a network request from a client is received, real-time load information of each DPVS processing module is obtained, and a preset DPVS processing module allocation scheme is determined based on each real-time load information; a load index detection point is configured for each DPVS processing module, the load data of each DPVS processing module is recorded in real time, and the preset DPVS processing module is adjusted based on the load data to obtain a target DPVS processing module allocation scheme; data packets to be distributed are obtained, and the data packets to be distributed are pre-processed to obtain distribution data; distribution processing is performed on the distribution data through the target DPVS processing module allocation scheme, and the status information of each DPVS processing module in the target DPVS processing module allocation scheme after the distribution processing is performed is recorded.
[0006] Optionally, in a first implementation method of the first aspect of the present invention, when a network request from a client is received, real-time load information of each DPVS processing module is obtained, and a preset DPVS processing module allocation scheme is determined based on each real-time load information, including: when a network request from a client is received, a detection packet is sent to each DPVS processing module in a preset load balancing pool, and a corresponding feedback indicator is obtained; the response status of the feedback indicator is judged, and the DPVS processing modules in the load balancing pool whose response status is an unexpected status are eliminated to obtain a dynamic load balancing pool; the real-time load information of each DPVS processing module in the dynamic load balancing pool is obtained, and a preset DPVS processing module allocation scheme is determined based on each real-time load information.
[0007] Optionally, in a second implementation method of the first aspect of the present invention, the real-time load information of each DPVS processing module in the dynamic load balancing pool is obtained, and a preset DPVS processing module allocation scheme is determined based on each real-time load information, including: obtaining the real-time load information of each DPVS processing module in the dynamic load balancing pool, and calculating the load value of each DPVS processing module based on the real-time load information; configuring a corresponding scheduling weight value for each DPVS processing module based on a polling algorithm and a load value; and confirming the preset DPVS processing module allocation scheme based on the number of network requests and each scheduling weight value.
[0008] Optionally, in a third implementation method of the first aspect of the present invention, a load indicator detection point is configured for each DPVS processing module, the load data of each DPVS processing module is recorded in real time, and the preset DPVS processing module is adjusted according to the load data to obtain a target DPVS processing module allocation plan, including: configuring a load indicator detection point for each DPVS processing module, obtaining the CPU utilization, memory occupancy and network traffic of each DPVS processing module in real time to form load data; calculating the average load of each DPVS processing module based on the EWMA model and load data; and adjusting the preset DPVS processing module based on the average load to obtain a target DPVS processing module allocation plan.
[0009] Optionally, in a fourth implementation of the first aspect of the present invention, the obtaining of the data packets to be distributed and preprocessing of the data packets to be distributed to obtain distribution data include: obtaining the data packets to be distributed and calling the zero-copy sendfile interface to transmit the data packets to be distributed to the DPVS processing module corresponding to the target DPVS processing module allocation scheme; parsing the corresponding data packets to be distributed based on the parsing rules preset by each DPVS processing module to obtain parsed data; and encapsulating the parsed data based on the protobuf sequence protocol to obtain distribution data.
[0010] Optionally, in a fifth implementation of the first aspect of the present invention, the distribution data is distributed and processed through the target DPVS processing module allocation scheme, including: building a traffic classification model based on the RNN recurrent neural network and the GRU gated recurrent unit; inputting the distribution data into the traffic classification model to obtain the traffic type; dynamically configuring the processing strategy according to the traffic type, and distributing and processing the distribution data according to the processing strategy.
[0011] Optionally, in a sixth implementation of the first aspect of the present invention, after each DPVS processing module in the target DPVS processing module allocation scheme executes the distribution processing status information, it also includes: encapsulating the status information based on the protobuf sequence protocol to obtain status encapsulation data; configuring at least one backup module for each PVS processing module; synchronizing the status encapsulation data to a preset backup library based on a preset period, and determining whether there is a data anomaly in the status encapsulation data through the preset backup library; if a data anomaly occurs in any status encapsulation data, calling the historical status encapsulation data in the preset backup library, and synchronizing the historical status encapsulation data to the corresponding backup module.
[0012] The second aspect of the present invention provides a DPVS-based load balancing device, including: a determination module, which is used to obtain the real-time load information of each DPVS processing module when receiving a network request from a client, and determine a preset DPVS processing module allocation plan based on each real-time load information; an adjustment module, which is used to configure a load indicator detection point for each DPVS processing module, record the load data of each DPVS processing module in real time, and adjust the preset DPVS processing module according to the load data to obtain a target DPVS processing module allocation plan; a preprocessing module, which is used to obtain a data packet to be distributed, and preprocess the data packet to be distributed to obtain distribution data; a distribution module, which is used to distribute the distribution data through the target DPVS processing module allocation plan, and record the status information of each DPVS processing module in the target DPVS processing module allocation plan after the distribution processing is performed.
[0013] Optionally, in a first implementation method of the second aspect of the present invention, the determination module includes: a detection unit, which is used to send a detection packet to each DPVS processing module in the preset load balancing pool when a network request from the client is received, and obtain corresponding feedback indicators; an elimination unit, which is used to judge the response status of the feedback indicator, and eliminate the DPVS processing modules in the load balancing pool whose response status is an unexpected status to obtain a dynamic load balancing pool; a determination unit, which is used to obtain real-time load information of each DPVS processing module in the dynamic load balancing pool, and determine the preset DPVS processing module allocation plan based on each real-time load information.
[0014] Optionally, in a second implementation of the second aspect of the present invention, the confirmation unit includes: a load unit, used to obtain real-time load information of each DPVS processing module in the dynamic load balancing pool, and calculate the load value of each DPVS processing module based on the real-time load information; a weight unit, used to configure a corresponding scheduling weight value for each DPVS processing module based on the polling algorithm and the load value; a confirmation unit, used to confirm the preset DPVS processing module allocation plan based on the number of network requests and each scheduling weight value.
[0015] Optionally, in a third implementation of the second aspect of the present invention, the adjustment module includes: a detection unit, used to configure a load index detection point for each DPVS processing module, and obtain the CPU utilization, memory occupancy and network traffic of each DPVS processing module in real time to form load data; a calculation unit, used to calculate the average load of each DPVS processing module based on the EWMA model and load data; and an adjustment unit, used to adjust the preset DPVS processing module based on the average load to obtain a target DPVS processing module allocation plan.
[0016] Optionally, in a fourth implementation of the second aspect of the present invention, the preprocessing module includes: a zero-copy unit, used to obtain the data packet to be distributed, and call the zero-copy sendfile interface to transmit the data packet to be distributed to the DPVS processing module corresponding to the target DPVS processing module allocation scheme; a parsing unit, used to parse the corresponding data packet to be distributed based on the parsing rules preset by each DPVS processing module to obtain parsed data; a first encapsulation unit, used to encapsulate the parsed data based on the protobuf sequence protocol to obtain distribution data.
[0017] Optionally, in a fifth implementation of the second aspect of the present invention, the distribution module includes: a construction unit for constructing a traffic classification model based on an RNN recurrent neural network and a GRU gated recurrent unit; an input unit for inputting distribution data into the traffic classification model to obtain a traffic type; and a processing unit for dynamically configuring a processing strategy according to the traffic type, and performing distribution processing on the distribution data according to the processing strategy.
[0018] Optionally, in a sixth implementation of the second aspect of the present invention, the distribution module further includes: a second encapsulation unit, used to encapsulate the state information based on the protobuf sequence protocol to obtain state encapsulation data; a backup unit, used to configure at least one backup module for each PVS processing module; an exception unit, used to synchronize the state encapsulation data to a preset backup library based on a preset period, and determine whether there is a data anomaly in the state encapsulation data through the preset backup library; a synchronization unit, used to call the historical state encapsulation data in the preset backup library if a data anomaly occurs in any state encapsulation data, and synchronize the historical state encapsulation data to the corresponding backup module.
[0019] The third aspect of the present invention provides a DPVS-based load balancing device, which includes: a memory and at least one processor, wherein instructions are stored in the memory; at least one of the processors calls the instructions in the memory so that the DPVS-based load balancing device executes each step of the DPVS-based load balancing method described above.
[0020] A fourth aspect of the present invention provides a computer-readable storage medium having instructions stored thereon, and when the instructions are executed by a processor, the various steps of any of the above-mentioned DPVS-based load balancing methods are implemented.
[0021] In the technical solution of the present invention, the load information of each DPVS processing module is obtained in real time to ensure that the data packet distribution can be dynamically adjusted according to the current system load status, thereby avoiding the situation where some processing modules are overloaded while other modules are idle, and realizing dynamic load balancing; the DPVS processing module allocation scheme is preset and adjusted in combination with the real-time load data of each DPVS processing module, which can optimize resource utilization and improve the efficiency of data packet processing and distribution; the data packets are pre-processed and distributed according to the optimized allocation scheme, which can reduce the residence time of the data packets in the system, thereby reducing the overall processing and transmission delays; real-time monitoring and adjustment of the load status of the DPVS processing module helps to maintain the stable operation of the system and prevent system crashes or performance degradation due to uneven loads; the scheme can be flexibly adjusted according to the actual load conditions to adapt to different network request volumes and data packet sizes, while facilitating future system expansion and upgrades. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A first flow chart of a load balancing method based on DPVS provided in an embodiment of the present invention;
[0023] Figure 2 A second flow chart of a load balancing method based on DPVS provided in an embodiment of the present invention;
[0024] Figure 3 A third flow chart of a load balancing method based on DPVS provided in an embodiment of the present invention;
[0025] Figure 4 A fourth flow chart of a load balancing method based on DPVS provided in an embodiment of the present invention;
[0026] Figure 5 A fifth flow chart of a load balancing method based on DPVS provided in an embodiment of the present invention;
[0027] Figure 6A sixth flow chart of a load balancing method based on DPVS provided in an embodiment of the present invention;
[0028] Figure 7 A seventh flow chart of a load balancing method based on DPVS provided in an embodiment of the present invention;
[0029] Figure 8 A schematic diagram of a structure of a load balancing device based on DPVS provided in an embodiment of the present invention;
[0030] Fig. 9 Another structural diagram of a load balancing device based on DPVS provided in an embodiment of the present invention;
[0031] Fig.10 A schematic diagram of the structure of a load balancing device based on DPVS provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The present invention provides a load balancing method, device, equipment and storage medium based on DPVS. The present invention obtains the load information of each DPVS processing module in real time to ensure that the data packet distribution can be dynamically adjusted according to the current system load status, thereby avoiding the situation where some processing modules are overloaded while other modules are idle, and realizing dynamic load balancing; the DPVS processing module allocation scheme is preset and adjusted in combination with the real-time load data of each DPVS processing module, which can optimize resource utilization and improve the efficiency of data packet processing and distribution; the data packet is pre-processed and distributed according to the optimized allocation scheme, which can reduce the residence time of the data packet in the system, thereby reducing the overall processing and transmission delay; the load status of the DPVS processing module is monitored and adjusted in real time, which helps to maintain the stable operation of the system and prevent system crash or performance degradation caused by uneven load; the scheme can be flexibly adjusted according to the actual load situation to adapt to different network request volumes and data packet sizes, and is convenient for future system expansion and upgrading.
[0033] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "including" or "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] For ease of understanding, the specific process of the embodiment of the present invention is described below. Figure 1 , an embodiment of a load balancing method based on DPVS in an embodiment of the present invention includes:
[0035] 101. When receiving a network request from a client, obtain the real-time load information of each DPVS processing module, and determine a preset DPVS processing module allocation scheme according to each real-time load information;
[0036] 102. Configure a load index detection point for each DPVS processing module, record the load data of each DPVS processing module in real time, and adjust the preset DPVS processing module according to the load data to obtain a target DPVS processing module allocation scheme.
[0037] In this embodiment, the load information of each DPVS processing module is obtained in real time to ensure that the data packet distribution can be dynamically adjusted according to the current system load status, thereby avoiding the situation where some processing modules are overloaded while other modules are idle, and realizing dynamic load balancing; the DPVS processing module allocation plan is preset and adjusted in combination with the real-time load data of each DPVS processing module, which can optimize resource utilization and improve the efficiency of data packet processing and distribution.
[0038] 103. Obtain a data packet to be distributed, and pre-process the data packet to be distributed to obtain distribution data;
[0039] 104. Perform distribution processing on the distribution data through the target DPVS processing module allocation scheme, and record the status information of each DPVS processing module in the target DPVS processing module allocation scheme after executing the distribution processing.
[0040] In this embodiment, data packets are preprocessed and distributed according to the optimized allocation scheme, which can reduce the residence time of data packets in the system, thereby reducing the overall processing and transmission delays; real-time monitoring and adjustment of the load status of the DPVS processing module helps to maintain the stable operation of the system and prevent system crashes or performance degradation due to uneven load.
[0041] In the embodiment of the present invention, the load information of each DPVS processing module is obtained in real time to ensure that the data packet distribution can be dynamically adjusted according to the current system load status, thereby avoiding the situation where some processing modules are overloaded while other modules are idle, and realizing dynamic load balancing; the DPVS processing module allocation scheme is preset and adjusted in combination with the real-time load data of each DPVS processing module, which can optimize resource utilization and improve the efficiency of data packet processing and distribution; the data packets are pre-processed and distributed according to the optimized allocation scheme, which can reduce the residence time of the data packets in the system, thereby reducing the overall processing and transmission delays; real-time monitoring and adjustment of the load status of the DPVS processing module helps to maintain the stable operation of the system and prevent system crashes or performance degradation caused by uneven loads; the scheme can be flexibly adjusted according to the actual load conditions to adapt to different network request volumes and data packet sizes, while facilitating future system expansion and upgrades.
[0042] See also Figure 2 , a second embodiment of the load balancing method based on DPVS in an embodiment of the present invention includes:
[0043] 201. When receiving a network request from a client, a detection packet is sent to each DPVS processing module in a preset load balancing pool, and corresponding feedback indicators are obtained;
[0044] 202. Determine the response status of the feedback indicator, and remove the DPVS processing modules in the load balancing pool whose response status is an unexpected state, so as to obtain a dynamic load balancing pool;
[0045] 203. Obtain real-time load information of each DPVS processing module in the dynamic load balancing pool, and determine a preset DPVS processing module allocation scheme according to each real-time load information.
[0046] In this embodiment, by sending detection packets to the DPVS processing modules in the load balancing pool and obtaining feedback indicators, the performance status of each processing module can be monitored in real time, so as to quickly respond to client requests and improve the efficiency of network request processing; by eliminating DPVS processing modules with unexpected response status, it is possible to avoid allocating requests to processing modules with poor performance or failures, thereby reducing the risk of system failures and enhancing the stability and reliability of the system; by obtaining real-time load information of each DPVS processing module and adjusting the preset allocation plan based on this information, it is possible to ensure that network traffic is reasonably allocated to each processing module, avoid overload or waste of resources, and achieve dynamic load balancing; dynamically adjusting the allocation plan of the load balancing pool and the processing module can ensure that client requests are responded to quickly and stably, thereby improving the overall user experience; through real-time monitoring and dynamic adjustment, server resources can be used more effectively, avoiding idle or excessive use of resources, and achieving optimal resource configuration.
[0047] See also Figure 3 , a third embodiment of the load balancing method based on DPVS in an embodiment of the present invention includes:
[0048] 301. Acquire real-time load information of each DPVS processing module in the dynamic load balancing pool, and calculate the load value of each DPVS processing module according to the real-time load information;
[0049] 302. Configure corresponding scheduling weight values for each DPVS processing module based on the polling algorithm and the load value;
[0050] 303. Confirm the preset DPVS processing module allocation scheme according to the number of network requests and each scheduling weight value.
[0051] In this embodiment, by real-time monitoring of the load conditions of each DPVS processing module, network requests can be allocated more effectively to avoid overloading of some processing modules while other modules are idle, thereby improving the overall resource utilization; by dynamically adjusting the scheduling weight according to the load value of each DPVS processing module, it can be ensured that network requests are allocated to processing modules with lighter loads, thereby reducing the response time of requests and improving user experience; through real-time load balancing, it is possible to avoid the collapse of a single processing module due to overload, thereby improving the stability and reliability of the system; by collecting and analyzing real-time load information, the system load can be predicted to provide data support for system expansion and maintenance; the dynamic load balancing mechanism enables the system to flexibly adjust resource allocation according to the actual load conditions, facilitate system expansion, and support the smooth operation of the system under high load conditions.
[0052] To facilitate understanding, the following explanation is provided to assist understanding: When selecting a server, it is not simply selected in turn, but the next server to process the request is determined based on the weight ratio. For example, the weight of server A is 2 and the weight of server B is 1. For every three requests, A processes it twice and B processes it once, thereby dynamically balancing the load.
[0053] See also Figure 4 The fourth embodiment of the load balancing method based on DPVS in the embodiment of the present invention includes:
[0054] 401. Configure a load index detection point for each DPVS processing module, and obtain the CPU utilization, memory usage and network traffic of each DPVS processing module in real time to form load data;
[0055] 402. Calculate the average load of each DPVS processing module based on the EWMA model and the load data;
[0056] 403. Adjust the preset DPVS processing modules based on the average load to obtain a target DPVS processing module allocation scheme.
[0057] In this embodiment, by configuring a load indicator detection point for each DPVS processing module, the CPU utilization, memory usage and network traffic can be monitored in real time to ensure the transparency and manageability of the system operation status; the average load calculated based on the EWMA model and the load data collected in real time can provide data support for the system, so that the system can make reasonable resource allocation decisions, and according to the calculated average load, the allocation plan of the DPVS processing module can be dynamically adjusted to optimize resource utilization efficiency and avoid resource waste or overload; by timely adjusting resource allocation, the system performance degradation or failure caused by overload of a single processing module can be effectively avoided, thereby improving the stability and reliability of the entire system, and dynamic resource management helps to ensure that user requests are responded to quickly, reduce delays, and thus improve user experience; reasonable resource allocation can reduce unnecessary hardware investment, reduce operating costs, and improve resource utilization efficiency.
[0058] See also Figure 5 The fifth embodiment of the load balancing method based on DPVS in the embodiment of the present invention includes:
[0059] 501. Obtain a data packet to be distributed, and call a zero-copy sendfile interface to transmit the data packet to be distributed to a DPVS processing module corresponding to the target DPVS processing module allocation scheme;
[0060] 502. Parse the corresponding data packets to be distributed based on the parsing rules preset by each DPVS processing module to obtain parsed data;
[0061] 503. Encapsulate the parsed data based on the protobuf sequence protocol to obtain distribution data.
[0062] In this embodiment, by using the zero-copy sendfile interface, the number of times data is copied between the user space and the kernel space is reduced, thereby reducing the CPU usage and improving the efficiency of data transmission; each DPVS processing module parses the data packet according to the preset parsing rules, and can quickly and accurately extract the required information, thereby speeding up the data processing speed; by encapsulating the data through the protobuf sequence protocol, the size of the data packet can be reduced, the efficiency of network transmission can be improved, and the network bandwidth occupancy can be reduced, thereby optimizing the overall network performance; distributing the data packet to the corresponding DPVS processing module can make the system more modular, facilitate expansion and maintenance, and improve the scalability of the system. Through a unified parsing and encapsulation process, the format consistency of the data during transmission and processing is ensured, the possibility of errors is reduced, and the stability and reliability of the system are improved.
[0063] See also Figure 6 The sixth embodiment of the load balancing method based on DPVS in the embodiment of the present invention includes:
[0064] 601. Construct a traffic classification model based on RNN recurrent neural network and GRU gated recurrent unit;
[0065] 602. Input the distribution data into a traffic classification model to obtain a traffic type;
[0066] 603. Dynamically configure a processing strategy according to the traffic type, and perform distribution processing on the distribution data according to the processing strategy.
[0067] In this embodiment, the combination of RNN and GRU can effectively process sequence data and capture time dependency, thereby improving the accuracy of traffic classification. The traffic classification model can process traffic data in real time and quickly identify traffic types, which helps to respond to network conditions immediately. Accurate traffic classification helps to detect abnormal traffic in a timely manner and enhance network security protection capabilities. Based on the identified traffic types, the system can dynamically configure corresponding processing strategies, optimize network resource allocation, and implement dynamic strategy adjustment. Intelligent distribution processing of distribution data can be implemented in the above manner, which can reduce unnecessary data transmission and improve the overall network efficiency.
[0068] See also Figure 7 The seventh embodiment of the load balancing method based on DPVS in the embodiment of the present invention includes:
[0069] 701. Encapsulate the state information based on the protobuf sequence protocol to obtain state encapsulation data;
[0070] 702. Configure at least one backup module for each PVS processing module.
[0071] 703. Synchronize the state encapsulation data to a preset backup library based on a preset period, and determine whether there is data anomaly in the state encapsulation data through the preset backup library;
[0072] 704. If any state encapsulation data has data anomalies, the historical state encapsulation data in the preset backup library is called, and the historical state encapsulation data is synchronized to the corresponding backup module.
[0073] In this embodiment, the state information is encapsulated based on the protobuf sequence protocol, which can effectively compress the data size and improve the data transmission efficiency. At least one backup module is configured for each PVS processing module to enhance the fault tolerance and reliability of the system. By synchronizing the state encapsulation data to the preset backup library through a preset period and checking the data anomaly, data problems can be discovered and handled in time to ensure the integrity and accuracy of the data. If data anomalies are found, the historical state encapsulation data is called and synchronized to the backup module, which can ensure that the system can quickly recover to a normal state when encountering problems, thereby ensuring business continuity and data security.
[0074] The above describes the load balancing method based on DPVS in the embodiment of the present invention. The following describes the load balancing device based on DPVS in the embodiment of the present invention. Figure 8 In one embodiment of the present invention, a load balancing device based on DPVS includes:
[0075] The determination module 801 is used to obtain the real-time load information of each DPVS processing module when receiving the network request of the client, and determine the preset DPVS processing module allocation scheme according to each real-time load information;
[0076] The adjustment module 802 is used to configure a load index detection point for each DPVS processing module, record the load data of each DPVS processing module in real time, and adjust the preset DPVS processing module according to the load data to obtain a target DPVS processing module allocation scheme;
[0077] The preprocessing module 803 is used to obtain the data packet to be distributed and preprocess the data packet to be distributed to obtain distribution data;
[0078] The distribution module 804 is used to perform distribution processing on the distribution data through the target DPVS processing module allocation scheme, and record the state information after each DPVS processing module in the target DPVS processing module allocation scheme performs the distribution processing.
[0079] In this embodiment, the determination module 801 obtains the load information of each DPVS processing module in real time to ensure that the data packet distribution can be dynamically adjusted according to the current system load status, thereby avoiding the situation where some processing modules are overloaded while other modules are idle, and realizing dynamic load balancing; the adjustment module 802 presets and adjusts the DPVS processing module allocation plan in combination with the real-time load data of each DPVS processing module, which can optimize resource utilization and improve the efficiency of data packet processing and distribution; the preprocessing module 803 preprocesses the data packet and distributes it according to the optimized allocation plan, which can reduce the residence time of the data packet in the system, thereby reducing the overall processing and transmission delay; the distribution module 804 monitors and adjusts the load status of the DPVS processing module in real time, which helps to maintain the stable operation of the system and prevent system crashes or performance degradation due to uneven load.
[0080] See also Fig. 9 Another embodiment of the load balancing device based on DPVS in the embodiment of the present invention includes:
[0081] The determination module 801 is used to obtain the real-time load information of each DPVS processing module when receiving the network request of the client, and determine the preset DPVS processing module allocation scheme according to each real-time load information;
[0082] The adjustment module 802 is used to configure a load index detection point for each DPVS processing module, record the load data of each DPVS processing module in real time, and adjust the preset DPVS processing module according to the load data to obtain a target DPVS processing module allocation scheme;
[0083] The preprocessing module 803 is used to obtain the data packet to be distributed and preprocess the data packet to be distributed to obtain distribution data;
[0084] The distribution module 804 is used to perform distribution processing on the distribution data through the target DPVS processing module allocation scheme, and record the state information after each DPVS processing module in the target DPVS processing module allocation scheme performs the distribution processing.
[0085] In this embodiment, in the first implementation method of the second aspect of the present invention, the determination module 801 includes: a detection unit 8011, which is used to send a detection packet to each DPVS processing module in the preset load balancing pool when a network request from the client is received, and obtain the corresponding feedback indicator; an elimination unit 8012, which is used to judge the response status of the feedback indicator, and eliminate the DPVS processing modules in the load balancing pool whose response status is an unexpected state to obtain a dynamic load balancing pool; a determination unit 8013, which is used to obtain the real-time load information of each DPVS processing module in the dynamic load balancing pool, and determine the preset DPVS processing module allocation plan according to each real-time load information.
[0086] In this embodiment, in the second implementation method of the second aspect of the present invention, the confirmation unit 8013 includes: a load unit 80131, which is used to obtain the real-time load information of each DPVS processing module in the dynamic load balancing pool, and calculate the load value of each DPVS processing module based on the real-time load information; a weight unit 80132, which is used to configure a corresponding scheduling weight value for each DPVS processing module based on the polling algorithm and the load value; a confirmation unit 80133, which is used to confirm the preset DPVS processing module allocation plan according to the number of network requests and each scheduling weight value.
[0087] In this embodiment, in the third implementation method of the second aspect of the present invention, the adjustment module 802 includes: a detection unit 8021, which is used to configure a load index detection point for each DPVS processing module, and obtain the CPU utilization, memory occupancy and network traffic of each DPVS processing module in real time to form load data; a calculation unit 8022, which is used to calculate the average load of each DPVS processing module based on the EWMA model and load data; an adjustment unit 8023, which is used to adjust the preset DPVS processing module based on the average load to obtain a target DPVS processing module allocation plan.
[0088] In this embodiment, in the fourth implementation method of the second aspect of the present invention, the preprocessing module 803 includes: a zero-copy unit 8031, which is used to obtain the data packet to be distributed, and call the zero-copy sendfile interface to transmit the data packet to be distributed to the DPVS processing module corresponding to the target DPVS processing module allocation scheme; a parsing unit 8032, which is used to parse the corresponding data packet to be distributed based on the parsing rules preset by each DPVS processing module to obtain parsed data; a first encapsulation unit 8033, which is used to encapsulate the parsed data based on the protobuf sequence protocol to obtain distribution data.
[0089] In this embodiment, in the fifth implementation method of the second aspect of the present invention, the distribution module 804 includes: a construction unit 8041, which is used to construct a traffic classification model based on the RNN recurrent neural network and the GRU gated recurrent unit; an input unit 8042, which is used to input the distribution data into the traffic classification model to obtain the traffic type; a processing unit 8043, which is used to dynamically configure the processing strategy according to the traffic type, and distribute the distribution data according to the processing strategy.
[0090] In this embodiment, in a sixth implementation of the second aspect of the present invention, the distribution module 804 further includes: a second encapsulation unit 8044, which is used to encapsulate the state information based on the protobuf sequence protocol to obtain state encapsulation data; a backup unit 8045, which is used to configure at least one backup module for each PVS processing module; an exception unit 8046, which is used to synchronize the state encapsulation data to a preset backup library based on a preset period, and determine whether there is a data anomaly in the state encapsulation data through the preset backup library; a synchronization unit 8047, which is used to call the historical state encapsulation data in the preset backup library if a data anomaly occurs in any state encapsulation data, and synchronize the historical state encapsulation data to the corresponding backup module.
[0091] above Figure 8 and Fig. 9 The DPVS-based load balancing device in the embodiment of the present invention is described in detail from the perspective of modular functional entities. The DPVS-based load balancing device in the embodiment of the present invention is described in detail from the perspective of hardware processing.
[0092] Fig.10 1 is a schematic diagram of the structure of a DPVS-based load balancing device provided in an embodiment of the present invention. The DPVS-based load balancing device 900 may have relatively large differences due to different configurations or performances, and may include one or more processors (central processing units, CPU) 910 (for example, one or more processors) and a memory 920, and one or more storage media 930 (for example, one or more mass storage devices) storing application programs 933 or data 932. Among them, the memory 920 and the storage medium 930 may be short-term storage or permanent storage. The program stored in the storage medium 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the DPVS-based load balancing device 900. Furthermore, the processor 910 may be configured to communicate with the storage medium 930, and execute a series of instruction operations in the storage medium 930 on the DPVS-based load balancing device 900 to implement the steps of the DPVS-based load balancing method provided in the above-mentioned method embodiments.
[0093] The DPVS-based load balancing device 900 may also include one or more power supplies 940, one or more wired or wireless network interfaces 950, one or more input and output interfaces 960, and / or one or more operating systems 931, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will appreciate that Fig.10 The illustrated structure of the DPVS-based load balancing device does not constitute a limitation on the DPVS-based load balancing device, and may include more or fewer components than illustrated, or a combination of certain components, or a different arrangement of components.
[0094] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions are executed on a computer, the computer executes the steps of a load balancing method based on DPVS.
[0095] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described system, device, or unit can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0096] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.
[0097] Finally, it should be noted that the above description is only a preferred example of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A load balancing method based on DPVS, It is characterized in that include: When receiving a network request from a client, the real-time load information of each DPVS processing module is obtained, and a preset DPVS processing module allocation scheme is determined according to each real-time load information; Configure a load index detection point for each DPVS processing module, record the load data of each DPVS processing module in real time, and adjust the preset DPVS processing module according to the load data to obtain a target DPVS processing module allocation plan; Obtaining a data packet to be distributed, and preprocessing the data packet to be distributed to obtain distribution data; The distribution data is distributed and processed through the target DPVS processing module allocation scheme, and the state information after each DPVS processing module in the target DPVS processing module allocation scheme executes the distribution processing is recorded.
2. According to the load balancing method based on DPVS according to claim 1, It is characterized in that When receiving a network request from a client, real-time load information of each DPVS processing module is obtained, and a preset DPVS processing module allocation scheme is determined according to each real-time load information, including: When receiving a network request from a client, it sends a detection packet to each DPVS processing module in the preset load balancing pool and obtains the corresponding feedback indicators; The response status of the feedback indicator is judged, and the DPVS processing modules with unexpected response status in the load balancing pool are removed to obtain a dynamic load balancing pool; The real-time load information of each DPVS processing module in the dynamic load balancing pool is obtained, and a preset DPVS processing module allocation scheme is determined according to each real-time load information.
3. The load balancing method based on DPVS according to claim 2, It is characterized in that The obtaining of real-time load information of each DPVS processing module in the dynamic load balancing pool and determining a preset DPVS processing module allocation scheme according to each real-time load information includes: Obtaining real-time load information of each DPVS processing module in the dynamic load balancing pool, and calculating the load value of each DPVS processing module based on the real-time load information; Configure corresponding scheduling weight values for each DPVS processing module based on the polling algorithm and load value; The preset DPVS processing module allocation scheme is confirmed according to the number of network requests and the various scheduling weight values.
4. The load balancing method based on DPVS according to claim 1, It is characterized in that The method configures a load index detection point for each DPVS processing module, records the load data of each DPVS processing module in real time, and adjusts the preset DPVS processing module according to the load data to obtain a target DPVS processing module allocation scheme, including: Configure a load indicator detection point for each DPVS processing module to obtain the CPU utilization, memory usage and network traffic of each DPVS processing module in real time to form load data; Calculate the average load of each DPVS processing module based on the EWMA model and load data; The preset DPVS processing modules are adjusted based on the average load to obtain a target DPVS processing module allocation scheme.
5. The load balancing method based on DPVS according to claim 1, It is characterized in that The step of obtaining a data packet to be distributed and preprocessing the data packet to be distributed to obtain distribution data includes: Obtain the data packet to be distributed, and call the zero-copy sendfile interface to transfer the data packet to be distributed to the DPVS processing module corresponding to the target DPVS processing module allocation scheme; Parsing the corresponding data packets to be distributed based on the parsing rules preset by each DPVS processing module to obtain parsed data; The parsed data is encapsulated based on the protobuf sequence protocol to obtain the distribution data.
6. The load balancing method based on DPVS according to claim 1, It is characterized in that The distribution processing of the distribution data by the target DPVS processing module allocation scheme includes: Build a traffic classification model based on RNN recurrent neural network and GRU gated recurrent unit; Input the distribution data into the traffic classification model to obtain the traffic type; A processing strategy is dynamically configured according to the traffic type, and distribution data is processed according to the processing strategy.
7. The load balancing method based on DPVS according to claim 1, It is characterized in that After recording the status information of each DPVS processing module after executing the distribution processing in the target DPVS processing module allocation scheme, the method further includes: Encapsulate the state information based on the protobuf sequence protocol to obtain state encapsulation data; At least one backup module is configured for each PVS processing module; Synchronize the state encapsulation data to the preset backup library based on the preset period, and determine whether there is data anomaly in the state encapsulation data through the preset backup library; If any state encapsulation data has data anomalies, the historical state encapsulation data in the preset backup library is called and synchronized to the corresponding backup module.
8. A load balancing device based on DPVS, It is characterized in that include: A determination module, used for obtaining real-time load information of each DPVS processing module when receiving a network request from a client, and determining a preset DPVS processing module allocation scheme according to each real-time load information; An adjustment module is used to configure a load index detection point for each DPVS processing module, record the load data of each DPVS processing module in real time, and adjust the preset DPVS processing module according to the load data to obtain a target DPVS processing module allocation scheme; A preprocessing module is used to obtain data packets to be distributed and preprocess the data packets to be distributed to obtain distribution data; The distribution module is used to perform distribution processing on the distribution data through the target DPVS processing module allocation scheme, and record the state information after each DPVS processing module in the target DPVS processing module allocation scheme executes the distribution processing.
9. A load balancing device based on DPVS, It is characterized in that The DPVS-based load balancing device includes: a memory and at least one processor, wherein instructions are stored in the memory; At least one of the processors calls the instructions in the memory so that the DPVS-based load balancing device executes each step of the DPVS-based load balancing method as described in any one of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, It is characterized in that When the instructions are executed by the processor, the steps of the DPVS-based load balancing method as described in any one of claims 1 to 7 are implemented.
