A method, system and related equipment for improving load balancing of visual data flow

By receiving and splitting data requests in the autonomous driving visualization platform and selecting the service node with the lowest load for processing, the problems of resource waste and load imbalance are solved, and efficient resource utilization and rapid response are achieved.

CN115834588BActive Publication Date: 2025-09-09GUANGZHOU WERIDE TECH LTD CO
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211458776.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2025-09-09
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

Existing autonomous driving visualization platforms have problems with resource utilization and load balancing, resulting in some backend services being busy while others are idle, affecting user experience and resource utilization.

Method used

By receiving client data requests, determining the target data request, and selecting the target service node with the lowest load index from multiple service nodes for data processing, multi-angle sharding and greedy algorithm are used to optimize load balancing, and candidate service nodes are selected by combining multiple load index calculations.

Benefits of technology

It achieves balanced distribution of backend service load, improves resource utilization, reduces response time of data requests, and ensures user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834588B_ABST
    Figure CN115834588B_ABST
Patent Text Reader

Abstract

The present application discloses a method, system, and related equipment for improving the load balancing of visual data streams. The method comprises: receiving a data request from a client, and determining at least one target data request based on the amount of data requested by the data request; for each target data request: determining multiple candidate service nodes from each service node; determining a target service node with the lowest load index from the multiple candidate service nodes; sending the target data request to the target service node, receiving data returned by the target service node, and sending the data to the client. The present application can distribute data requests based on load balancing, so that backend services can be in a more consistent busy state, ensuring higher resource utilization, and reducing the response time of data requests.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of autonomous driving and network communication technology, and more specifically, to a method, system, and related equipment for improving load balancing of visual data streams. Background Art

[0002] Currently, most autonomous driving visualization platforms use a local client architecture model, which wastes a lot of resources. During the period when users are not playing data, the software still needs to occupy a considerable amount of resource overhead. At the same time, the one-to-one model is also one of the reasons for the low resource utilization.

[0003] While migrating backend data processing services to the cloud can indeed achieve the effect of supporting large amounts of user frontend data rendering with a small amount of backend resources, processing user data requests on demand and optimizing resource utilization, most current solutions, however, fail to consider load balancing for user requests. This inevitably leads to uneven distribution of requests, with some backend services being chronically busy while others are idle. This not only underutilizes resources, but also causes long response times for some requests, impacting the user experience. Summary of the Invention

[0004] In view of this, the present application provides a method, system and related devices for improving the load balancing of visual data streams to solve at least one of the problems mentioned above.

[0005] To achieve the above objectives, the first aspect of the present application provides a method for improving the load balancing of a visualization data stream, comprising:

[0006] receiving a data request from a client, and determining at least one target data request based on the amount of data requested by the data request;

[0007] For each target data request:

[0008] Determine multiple candidate service nodes from each service node;

[0009] Determine a target service node with the lowest load index from the multiple candidate service nodes;

[0010] The target data request is sent to the target service node, data returned by the target service node is received, and the data is sent to the client.

[0011] Preferably, the process of determining at least one target data request based on the amount of data requested by the data request includes:

[0012] Determining whether the amount of data requested by the data request exceeds a preset threshold;

[0013] If yes, dividing the data request into multiple target data requests based on the data duration requested by the data request, wherein the data duration requested by each target data request is no longer than a first preset duration;

[0014] If not, the data request is determined as a target data request.

[0015] Preferably, after dividing the data request into multiple target data requests, the method further includes:

[0016] For each target data request, determining whether the amount of data requested by the target data request still exceeds the preset threshold;

[0017] If yes, based on the data type requested by the target data request, split the target data request into n new target data requests, where n satisfies the following equation:

[0018]

[0019] Wherein, m is the amount of data requested by the target data request, c is the preset threshold, It is a round-up operation; the amount of data requested by the new target data request does not exceed the preset threshold, and the data types requested by each new target data request are different.

[0020] Preferably, the process of splitting the target data request into n new target data requests based on the data type requested by the target data request includes:

[0021] Extracting multiple data sub-requests from the target data request, wherein the data requested by each data sub-request only includes one data type;

[0022] Based on the amount of data requested by each data sub-request, split each data sub-request into n groups of data sub-requests;

[0023] Merge each set of data sub-requests into a new target data request;

[0024] The variance of the data amounts requested by each new target data request is smaller than a preset variance value.

[0025] Preferably, the process of determining multiple candidate service nodes from each service node includes:

[0026] The number of candidate service nodes Pick is calculated using the following equation:

[0027]

[0028] Randomly select candidate service nodes from each service node;

[0029] Among them, Num req Num is the total number of data requests that have not been completed by each service node. node is the total number of service nodes, This is a round-up operation.

[0030] Preferably, the load index of the service node includes a current busy / idle index, a queue busy / idle index, a CPU busy / idle index, and a memory busy / idle index; and the calculation process of the load index of the service node includes:

[0031] The current busy / idle index M1 of the service node is calculated using the following equation:

[0032] M1=t1 / t2

[0033] The service node queue busy / idle index M2 is calculated using the following equation:

[0034] M2=(∑ i S i ) / S max

[0035] The service node CPU busy / idle index M3 is calculated using the following equation:

[0036] M3=CPU ocp / CPU total

[0037] The current memory usage M4 of the service node is calculated using the following equation:

[0038] M4=MEM ocp / MEM total

[0039] The load index is calculated using the following equation:

[0040] Idx=k1·M1+k2·M2+k3·M3+k4·M4

[0041] Wherein, t2 is the second preset duration, t1 is the duration of time during which the service node has been in working state in the past t2; S max is the third preset time length of the queue to be processed, S i The data duration of the i-th data request in the waiting queue of the service node; CPU ocp The number of CPUs currently in use by the service node. total is the total number of CPUs of the service node; MEM ocp The amount of memory currently used by the service node, MEM totalis the total memory of the service node; k1, k2, k3 and k4 are preset coefficients, and satisfy k1+k2+k3+k4=1.

[0042] A second aspect of the present application provides a system for improving load balancing of visual data streams, including a client, multiple service agents, multiple service nodes, and a service monitoring module;

[0043] The service agent is connected to the service node and the client, and the service monitoring module is connected to the server node and the service agent;

[0044] The client is used to send a data request to a service agent and receive data returned by the service agent;

[0045] The service agent is used to implement the various steps of the above-mentioned method for improving the load balancing of the visualization data flow;

[0046] The service node is configured to receive data requests forwarded by the service agent and return data to the service agent;

[0047] The service monitoring module is used to monitor the load index of each service node and to monitor the total number of data requests that have not yet been completed by each service node.

[0048] A third aspect of the present application provides a device for improving load balancing of a visualization data stream, comprising:

[0049] a data request segmentation unit, configured to receive a data request from a client and determine at least one target data request based on the amount of data requested by the data request;

[0050] a candidate node determining unit, configured to determine a plurality of candidate service nodes from among the service nodes;

[0051] a target node determining unit, configured to determine a target service node having the lowest load index from among the plurality of candidate service nodes;

[0052] The target request processing unit is configured to send the target data request to the target service node, receive data returned by the target service node, and send the data to the client.

[0053] A fourth aspect of the present application provides a device for improving load balancing of visual data streams, comprising: a memory and a processor;

[0054] The memory is used to store programs;

[0055] The processor is used to execute the program to implement the various steps of the above-mentioned method for improving the load balancing of visual data streams.

[0056] In a fifth aspect, the present application provides a storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements the various steps of the above-mentioned method for improving the load balancing of visual data streams.

[0057] As can be seen from the above technical solution, the present application first receives a data request from a client and, based on the amount of data requested by the data request, determines at least one target data request. It is understood that a data request that meets the conditions can be split into multiple target data requests, thereby distributing the original data request to multiple service nodes for parallel processing, reducing the response time of the data request. Then, for each target data request, multiple candidate service nodes are determined from each service node, and the target service node with the lowest load index is determined from the multiple candidate service nodes. By selecting the locally optimal target service node to process the target data request, on the one hand, the liability index of different service nodes is taken into account, incorporating the greedy principle of optimal selection; on the other hand, compared to a global search, the computational data and computational effort are simplified, and the load status of each service node is balanced to a certain extent. Finally, the target data request is sent to the target service node, the data returned by the target service node is received, and the data is sent to the client, ultimately completing the client's data request. The present application can distribute data requests based on load balancing, so that the backend service can maintain a relatively consistent busy state, ensuring high resource utilization and reducing the response time of data requests. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without any creative work.

[0059] Figure 1 A schematic diagram of a system for improving load balancing of visual data streams disclosed in an embodiment of the present application;

[0060] Figure 2 A schematic diagram of a method for improving load balancing of visual data streams disclosed in an embodiment of the present application;

[0061] Figure 3 This is a schematic diagram of processing a target data request based on data type disclosed in an embodiment of the present application;

[0062] Figure 4 A schematic diagram of a device for improving load balancing of visual data streams disclosed in an embodiment of the present application;

[0063] Figure 5 A schematic diagram of a device for improving load balancing of visual data streams disclosed in an embodiment of the present application. DETAILED DESCRIPTION

[0064] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0065] The inventors of this application discovered that when the user and the back-end service node responsible for data processing are in an M-to-M mode, a single service node may receive requests from different users, and requests from different users may also be assigned to different service nodes. If this distribution is not reasonable enough, it will lead to an unbalanced busyness of each service node. To solve this problem, this application has largely ensured the load balancing of each service node by defining reasonable load indicators and request distribution schemes. In addition, a multi-angle sharding scheme is designed for special long data requests to achieve a further load balancing effect at a more fine-grained level.

[0066] The following describes a system for improving the load balancing of visual data streams provided by an embodiment of the present application. Figure 1 The system includes a client 10, multiple service agents 20, multiple service nodes 40 and a service monitoring module 50.

[0067] The service agent 20 is connected to each service node 40 and the client 10 , and the service monitoring module 50 is connected to each server node 40 and each service agent 20 .

[0068] The client 10 is used to send a data request to a service agent 20 and receive data returned by the service agent 20 .

[0069] The service agent 20 is configured to perform preliminary processing on the received data request, forward the processed data request to the selected service node 40 , and forward the data returned by the service node 40 to the client 10 .

[0070] The service node 40 is configured to receive the data request forwarded by the service agent 20 and return the data to the service agent 20 .

[0071] The service monitoring module 50 is used to monitor the load indicator of each service node and the total number of outstanding data requests for each service node. For the load indicator, each service node 40 can proactively report the load indicator to the service monitoring module 50. For the total number of outstanding data requests, each service agent 20 can report the number of pending data requests to the service monitoring module 50 and promptly report completed data requests to the service monitoring module 50. The service monitoring module 50 integrates the data reported by each service agent 20 and updates the total number of outstanding data requests in real time.

[0072] Among the above-mentioned execution entities, the specific processing method of the service agent 20 is particularly critical. The following is a detailed introduction to the method for improving the load balancing of the visual data flow applied to the service agent 20. Figure 2 The method for improving the load balancing of visual data streams provided in the embodiment of the present application may include the following steps:

[0073] Step S101: receiving a data request from a client, and determining at least one target data request based on the amount of data requested by the data request.

[0074] It is understandable that if the data request requires a large amount of data, the data request can be divided into multiple target data requests. This can shorten the client's waiting time and evenly distribute the data request task to multiple service nodes.

[0075] Step S102 : for each target data request, determine a plurality of candidate service nodes from each service node.

[0076] It can be understood that each target data request is an independent data request. When there are multiple target data requests, each target data request needs to be processed one by one. In actual operation, a thread can be assigned to each target data request, and each thread processes each target data request independently.

[0077] Step S103: Determine a target service node with the lowest load index from the multiple candidate service nodes.

[0078] The load indicator reflects the load status of the service node, and the load indicator of the service node can be obtained from the service monitoring module 50 .

[0079] Step S104: Send the target data request to the target service node, receive the data returned by the target service node, and send the data to the client.

[0080] The present application first receives a data request from a client and, based on the amount of data requested by the data request, determines at least one target data request. It is understood that a data request that meets the requirements can be split into multiple target data requests, thereby distributing the original data request to multiple service nodes for parallel processing, reducing the response time of the data request. Then, for each target data request, multiple candidate service nodes are identified from each service node, and the target service node with the lowest load index is determined from these multiple candidate service nodes. By selecting the locally optimal target service node to process the target data request, this not only takes into account the liability indexes of different service nodes and incorporates the greedy principle of optimal selection, but also simplifies the computational data and computational effort compared to a global search, balancing the load status of each service node to a certain extent. Finally, the target data request is sent to the target service node, the data returned by the target service node is received, and the data is sent to the client, ultimately completing the client's data request. The present application can distribute data requests based on load balancing, allowing backend services to maintain a relatively consistent busy state, ensuring high resource utilization, and reducing the response time of data requests.

[0081] In some embodiments of the present application, the process of determining at least one target data request based on the amount of data requested by the data request in step S101 may include:

[0082] S1, determine whether the amount of data requested by the data request exceeds a preset threshold. If so, execute S2; if not, execute S3.

[0083] S2: Based on the data duration requested by the data request, split the data request into multiple target data requests.

[0084] The data duration requested by each target data request is no longer than a first preset duration. After long-term testing, the inventors of this application have found that 5 seconds is a relatively suitable slicing base. Therefore, the first preset duration can be set to 5 seconds, and the data request can be divided into multiple target data requests with a request duration of less than 5 seconds.

[0085] S3: Determine the data request as a target data request.

[0086] It is understandable that if the amount of data requested by the data request does not exceed the preset threshold, it does not need to be segmented and is directly determined as the target data request.

[0087] Visual data streams in the field of autonomous driving usually contain multiple data types, such as video data, point cloud data, map data, control data, etc. When a data request contains many data types, even if the request duration is limited to the first preset duration, the requested data volume can still be quite large.

[0088] Based on this, in some embodiments of this application, please refer to Figure 3 After the data request is divided into multiple target data requests in S2, the following steps may also be included:

[0089] For each target data request:

[0090] S4: Determine whether the data volume requested by each target data request still exceeds the preset threshold. If so, execute S5.

[0091] S5, based on the data type requested by the target data request, split the target data request into n new target data requests, where n satisfies the following equation:

[0092]

[0093] Where m is the amount of data requested by the target data request, c is the preset threshold, is a round-up operation; the amount of data requested by the new target data request does not exceed the preset threshold value c, and the data types requested by each new target data request are different.

[0094] In some embodiments of the present application, the process of splitting the target data request into n new target data requests in S5 based on the data type requested by the target data request may include:

[0095] S51, extracting multiple data sub-requests from the target data request.

[0096] The data requested by each data sub-request only includes one data type.

[0097] S52 : Based on the amount of data requested by each data sub-request, divide each data sub-request into n groups of data sub-requests.

[0098] S53: Merge each group of data sub-requests into a new target data request.

[0099] The variance of the data amounts requested by each new target data request is smaller than a preset variance value.

[0100] Exemplarily, the DFS (Depth First Search) algorithm can be used to cluster each data subrequest into n groups of data subrequests of similar size, and the clustering convergence condition is set to that the variance of the total amount of data requested by each group of data subrequests is less than a preset variance value.

[0101] By dividing data requests into states with similar processing time based on the data duration and data type dimensions, no matter how the length and complexity of the visualization data requested by the user end change, the technical architecture of this application will not be affected and the load balancing state will not be destroyed.

[0102] The candidate service node selection strategy in step S102 can be an extension of the P2C strategy (The Power of Two Random Choices). Specifically, the P2C strategy selects two service nodes from all resource pools at absolute random, compares their load status, and selects the less loaded service node for request allocation and connection establishment. Compared to simple random selection, this strategy takes the load status of different service nodes into consideration and incorporates the greedy principle of optimal selection. Compared to simply selecting the optimal greedy strategy from all service nodes, P2C reduces the amount of data required (2 vs. N). Furthermore, because this problem is not an absolutely greedy one, the current optimal decision cannot guarantee the optimal future cluster state. Therefore, adding a random factor can balance the overall state to a certain extent and prevent the cluster from tilting in an extreme direction.

[0103] Based on the P2C strategy, this application has made further improvements. Regarding the number of randomly selected nodes, with the dynamic changes in request volume and the total number of backend service nodes, maintaining the number of randomly selected nodes at 2 is not a very wise decision. When the request volume increases, we prefer to select a larger number of backend service nodes for comparison.

[0104] Based on this, in some embodiments of the present application, the process of determining multiple candidate service nodes from each service node in step S102 may include:

[0105] S1, use the following equation to calculate the number of candidate service nodes Pick:

[0106]

[0107] S2: Randomly select candidate service nodes from each service node.

[0108] Among them, Num req Num is the total number of data requests that have not been completed by each service node.node is the total number of service nodes, This is a round-up operation.

[0109] The design of load indicators is a key technology in this application. Using reasonable indicators to express the load status of services is crucial to ensuring a sound basis for decision-making. To this end, this application integrates multiple indicators to comprehensively express the load status of services. This not only accurately presents the current status of services, but also allows for better predictions of future trends.

[0110] Based on this, in some embodiments of the present application, the load index of the service node includes the current busy-idle index, the queue busy-idle index, the CPU busy-idle index, and the memory busy-idle index. The calculation process of the load index of a service node may include:

[0111] S1, use the following equation to calculate the current busy / idle index M1 of the service node:

[0112] M1=t1 / t2

[0113] Where t2 is the second preset duration, and t1 is the duration that the service node has been in an active state within the past t2. For example, the second preset duration can be set to 2 minutes (i.e., 120 seconds). Assuming that the service node has been in an active state for N1 seconds within the past 2 minutes, then M1 = N1 / 120. This indicator describes the busy state of the service node over a period of time and can be reflected as an average under the current allocation scheme.

[0114] S2, the service node queue busy / idle index M2 is calculated using the following equation:

[0115] M2=(∑ i S i ) / S max

[0116] Among them, S max is the third preset time length of the queue to be processed, S i The data duration of the i-th data request in the waiting queue of the service node.

[0117] When a service node is overloaded, the value of the M1 metric may reach its maximum value of 1, making it impossible to distinguish between individual service nodes. Therefore, a new metric, M2, is introduced to describe the future busyness of a service node by taking into account the data duration of data requests currently in the service node's pending queue.

[0118] For example, assuming that the third preset time length S max is 1800 seconds, and assume that there are n data requests in the current queue: {Q1,Q2,…,Qn}, the data lengths of each request are {S1, S2, ..., S n Then M2=(∑ i S i ) / 1800. The third preset time length S max It is set to 1800 seconds to normalize M2, which means that a backend service node can only cache data requests with a total length of 1800 seconds at most. Data requests exceeding this length will be canceled.

[0119] S3, use the following equation to calculate the service node CPU busy index M3:

[0120] M3=CPU ocp / CPU total

[0121] Among them, CPU ocp The number of CPUs currently in use by the service node. total The total number of CPUs on the service node.

[0122] S4, use the following equation to calculate the current memory usage of the service node M4:

[0123] M4=MEM ocp / MEM total

[0124] Among them, MEM ocp The amount of memory currently used by the service node, MEM total The total memory of the service node.

[0125] S5, calculate the load index using the following equation:

[0126] Idx=k1·M1+k2·M2+k3·M3+k4·M4

[0127] Among them, k1, k2, k3 and k4 are preset coefficients, and satisfy k1 + k2 + k3 + k4 = 1. The closer the value of the load index is to 1, the higher the load is, and the closer it is to 0, the lower the load is.

[0128] The following describes an apparatus for improving the load balancing of a visualization data stream provided in an embodiment of the present application. The apparatus for improving the load balancing of a visualization data stream described below and the method for improving the load balancing of a visualization data stream described above can refer to each other.

[0129] See Figure 4 The apparatus for improving the load balancing of visual data streams provided in an embodiment of the present application may include:

[0130] The data request segmentation unit 21 is configured to receive a data request from a client and determine at least one target data request based on the amount of data requested by the data request;

[0131] The candidate node determination unit 22 is configured to determine a plurality of candidate service nodes from among the service nodes;

[0132] A target node determining unit 23 is configured to determine a target service node with the lowest load index from the multiple candidate service nodes;

[0133] The target request processing unit 24 is configured to send the target data request to the target service node, receive data returned by the target service node, and send the data to the client.

[0134] In some embodiments of the present application, the process of the data request segmentation unit 21 determining at least one target data request based on the amount of data requested by the data request may include:

[0135] Determining whether the amount of data requested by the data request exceeds a preset threshold;

[0136] If yes, dividing the data request into multiple target data requests based on the data duration requested by the data request, wherein the data duration requested by each target data request is no longer than a first preset duration;

[0137] If not, the data request is determined as a target data request.

[0138] In some embodiments of the present application, after the data request is divided into multiple target data requests, the data request division unit 21 may further include:

[0139] For each target data request, determining whether the amount of data requested by the target data request still exceeds the preset threshold;

[0140] If yes, based on the data type requested by the target data request, split the target data request into n new target data requests, where n satisfies the following equation:

[0141]

[0142] Wherein, m is the amount of data requested by the target data request, c is the preset threshold, It is a round-up operation; the amount of data requested by the new target data request does not exceed the preset threshold, and the data types requested by each new target data request are different.

[0143] In some embodiments of the present application, the process of the data request splitting unit 21 splitting the target data request into n new target data requests based on the data type requested by the target data request may include:

[0144] Extracting multiple data sub-requests from the target data request, wherein the data requested by each data sub-request only includes one data type;

[0145] Based on the amount of data requested by each data sub-request, split each data sub-request into n groups of data sub-requests;

[0146] Merge each set of data sub-requests into a new target data request;

[0147] The variance of the data amounts requested by each new target data request is smaller than a preset variance value.

[0148] In some embodiments of the present application, the process of the candidate node determination unit 22 determining multiple candidate service nodes from each service node may include:

[0149] The number of candidate service nodes Pick is calculated using the following equation:

[0150]

[0151] Randomly select candidate service nodes from each service node;

[0152] Among them, Num req Num is the total number of data requests that have not been completed by each service node. node is the total number of service nodes, This is a round-up operation.

[0153] In some embodiments of the present application, the load index of a service node includes a current busy / idle index, a queue busy / idle index, a CPU busy / idle index, and a memory busy / idle index. The calculation process of the load index of a service node may include:

[0154] The current busy / idle index M1 of the service node is calculated using the following equation:

[0155] M1=t1 / t2

[0156] The service node queue busy / idle index M2 is calculated using the following equation:

[0157] M2=(∑ i S i ) / S max

[0158] The service node CPU busy / idle index M3 is calculated using the following equation:

[0159] M3=CPU ocp / CPU total

[0160] The current memory usage M4 of the service node is calculated using the following equation:

[0161] M4=MEM ocp / MEM total

[0162] The load index is calculated using the following equation:

[0163] Idx=k1·M1+k2·M2+k3·M3+k4·M4

[0164] Wherein, t2 is the second preset duration, t1 is the duration of time during which the service node has been in working state in the past t2; S max is the third preset time length of the queue to be processed, S i The data duration of the i-th data request in the waiting queue of the service node; CPU ocp The number of CPUs currently in use by the service node. total is the total number of CPUs of the service node; MEM ocp The amount of memory currently used by the service node, MEM total is the total memory of the service node; k1, k2, k3 and k4 are preset coefficients, and satisfy k1+k2+k3+k4=1.

[0165] The apparatus for improving the load balancing of visual data streams provided in the embodiment of the present application can be applied to devices for improving the load balancing of visual data streams, such as computers. Figure 5 The hardware structure diagram of the device for improving the load balancing of the visual data flow is shown. Figure 5 The hardware structure of the device for improving the load balancing of visual data streams may include: at least one processor 31 , at least one communication interface 32 , at least one memory 33 and at least one communication bus 34 .

[0166] In the embodiment of the present application, the number of the processor 31, the communication interface 32, the memory 33, and the communication bus 34 is at least one, and the processor 31, the communication interface 32, and the memory 33 communicate with each other through the communication bus 34;

[0167] The processor 31 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application;

[0168] The memory 33 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory;

[0169] The memory 33 stores a program, and the processor 31 can call the program stored in the memory 33, wherein the program is used to:

[0170] receiving a data request from a client, and determining at least one target data request based on the amount of data requested by the data request;

[0171] For each target data request:

[0172] Determine multiple candidate service nodes from each service node;

[0173] Determine a target service node with the lowest load index from the multiple candidate service nodes;

[0174] The target data request is sent to the target service node, data returned by the target service node is received, and the data is sent to the client.

[0175] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0176] An embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, wherein the program is used to:

[0177] receiving a data request from a client, and determining at least one target data request based on the amount of data requested by the data request;

[0178] For each target data request:

[0179] Determine multiple candidate service nodes from each service node;

[0180] Determine a target service node with the lowest load index from the multiple candidate service nodes;

[0181] The target data request is sent to the target service node, data returned by the target service node is received, and the data is sent to the client.

[0182] Optionally, the detailed functions and extended functions of the program may refer to the above description.

[0183] In summary:

[0184] The present application first receives a data request from a client and, based on the amount of data requested by the data request, determines at least one target data request. It is understood that a data request that meets the requirements can be split into multiple target data requests, thereby distributing the original data request to multiple service nodes for parallel processing, reducing the response time of the data request. Then, for each target data request, multiple candidate service nodes are identified from each service node, and the target service node with the lowest load index is determined from these multiple candidate service nodes. By selecting the locally optimal target service node to process the target data request, this not only takes into account the liability indexes of different service nodes and incorporates the greedy principle of optimal selection, but also simplifies the computational data and computational effort compared to a global search, balancing the load status of each service node to a certain extent. Finally, the target data request is sent to the target service node, the data returned by the target service node is received, and the data is sent to the client, ultimately completing the client's data request. The present application can distribute data requests based on load balancing, allowing backend services to maintain a relatively consistent busy state, ensuring high resource utilization, and reducing the response time of data requests.

[0185] Finally, it should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0186] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referenced to each other.

[0187] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for improving the load balancing of visual data streams, characterized in that: include: receiving a data request from a client, and determining at least one target data request based on the amount of data requested by the data request; For each target data request: Determine multiple candidate service nodes from each service node; Determine a target service node with the lowest load index from the multiple candidate service nodes; Sending the target data request to the target service node, receiving data returned by the target service node, and sending the data to the client; The process of determining at least one target data request based on the amount of data requested by the data request includes: Determining whether the amount of data requested by the data request exceeds a preset threshold; If yes, dividing the data request into multiple target data requests based on the data duration requested by the data request, wherein the data duration requested by each target data request is no longer than a first preset duration; If not, determining the data request as a target data request; After dividing the data request into multiple target data requests, the method further includes: For each target data request, determining whether the amount of data requested by the target data request still exceeds the preset threshold; If yes, based on the data type requested by the target data request, split the target data request into n new target data requests, where n satisfies the following equation: Wherein, m is the amount of data requested by the target data request, c is the preset threshold, is a round-up operation; the amount of data requested by the new target data request does not exceed the preset threshold, and the data types requested by each new target data request are different; The process of determining multiple candidate service nodes from various service nodes includes: The number of candidate service nodes Pick is calculated using the following equation: Randomly select candidate service nodes from each service node; Among them, Num req Num is the total number of data requests that have not been completed by each service node. node is the total number of service nodes, It is a rounding operation; The process of dividing the target data request into n new target data requests based on the data type requested by the target data request includes: Extracting multiple data sub-requests from the target data request, wherein the data requested by each data sub-request only includes one data type; Based on the amount of data requested by each data sub-request, split each data sub-request into n groups of data sub-requests; Merge each set of data sub-requests into a new target data request; wherein the variance of the data amounts requested by each new target data request is less than a preset variance value; The DFS algorithm is used to cluster each data sub-request into n groups of data sub-requests of similar size, and the convergence condition of the clustering is set to that the variance of the total amount of data requested by each group of data sub-requests is less than a preset variance value.

2. The method according to claim 1, characterized in that The load indicators of a service node include the current busy / idle indicator, the queue busy / idle indicator, the CPU busy / idle indicator, and the memory busy / idle indicator. The calculation process of the service node load indicator includes: The current busy / idle index M1 of the service node is calculated using the following equation: M1=t1 / t2 The service node queue busy / idle index M2 is calculated using the following equation: M2=(∑ i With i ) / S max The service node CPU busy / idle index M3 is calculated using the following equation: M3=CPU ocp / CPU total The current memory usage M4 of the service node is calculated using the following equation: M4=MEM ocp / MEM total The load index is calculated using the following equation: Idx=k1·M1+k2·M2+k3·M3+k4·M4 Wherein, t2 is the second preset duration, t1 is the duration of time during which the service node has been in working state in the past t2; S max is the third preset duration of the queue to be processed, S i The data duration of the i-th data request in the waiting queue of the service node; CPU ocp The number of CPUs currently in use by the service node. total is the total number of CPUs of the service node; MEM ocp The amount of memory currently used by the service node, MEM total is the total memory of the service node; k1, k2, k3 and k4 are preset coefficients, and satisfy k1+k2+k3+k4=1.

3. A system for improving load balancing of visual data streams, characterized in that: Includes client, multiple service agents, multiple service nodes and service monitoring module; The service agent is connected to the service node and the client, and the service monitoring module is connected to the service node and the service agent; The client is used to send a data request to a service agent and receive data returned by the service agent; The service agent is used to implement each step of the method for improving the load balancing of visual data flow according to any one of claims 1 to 2; The service node is configured to receive data requests forwarded by the service agent and return data to the service agent; The service monitoring module is used to monitor the load index of each service node and to monitor the total number of data requests that have not yet been completed by each service node.

4. A device for improving the load balancing of visual data flow, characterized in that: include: a data request segmentation unit, configured to receive a data request from a client and determine at least one target data request based on the amount of data requested by the data request; a candidate node determining unit, configured to determine a plurality of candidate service nodes from among the service nodes; a target node determining unit, configured to determine a target service node having the lowest load index from among the plurality of candidate service nodes; a target request processing unit, configured to send the target data request to the target service node, receive data returned by the target service node, and send the data to the client; The process of the data request segmentation unit determining at least one target data request based on the amount of data requested by the data request includes: Determining whether the amount of data requested by the data request exceeds a preset threshold; If yes, dividing the data request into multiple target data requests based on the data duration requested by the data request, wherein the data duration requested by each target data request is no longer than a first preset duration; If not, determining the data request as a target data request; After the data request is divided into a plurality of target data requests, the data request division unit further includes: For each target data request, determining whether the amount of data requested by the target data request still exceeds the preset threshold; If yes, based on the data type requested by the target data request, split the target data request into n new target data requests, where n satisfies the following equation: Wherein, m is the amount of data requested by the target data request, c is the preset threshold, is a round-up operation; the amount of data requested by the new target data request does not exceed the preset threshold, and the data types requested by each new target data request are different; The process of the candidate node determination unit determining multiple candidate service nodes from each service node includes: The number of candidate service nodes Pick is calculated using the following equation: Randomly select candidate service nodes from each service node; Among them, Num req Num is the total number of data requests that have not been completed by each service node. node is the total number of service nodes, It is a rounding operation; The process of dividing the target data request into n new target data requests based on the data type requested by the target data request includes: Extracting multiple data sub-requests from the target data request, wherein the data requested by each data sub-request only includes one data type; Based on the amount of data requested by each data sub-request, split each data sub-request into n groups of data sub-requests; Merge each set of data sub-requests into a new target data request; wherein the variance of the data amounts requested by each new target data request is less than a preset variance value; The DFS algorithm is used to cluster each data sub-request into n groups of data sub-requests of similar size, and the convergence condition of the clustering is set to that the variance of the total amount of data requested by each group of data sub-requests is less than a preset variance value.

5. A device for improving the load balancing of visual data flow, characterized in that: include: memory and processor; The memory is used to store programs; The processor is configured to execute the program to implement the steps of the method for improving the load balancing of visual data streams according to any one of claims 1 to 2.

6. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for improving the load balancing of a visualization data stream as claimed in any one of claims 1 to 2 is implemented.

Citation Information

Patent Citations

  • Distributed computing method and system

    CN109298948A

  • Load balancing processing method and device and electronic device

    CN110278226A

  • Load balancing method, routing server and load balancing system

    CN113783904A