Load balancing method and system for server optimization
By receiving and querying device parameters, video processing tasks are simplified and allocated to each processing end, the problem of resource waste in the existing technology is solved and the platform data processing efficiency is improved.
Patent Information
- Application Number
- CN202510520544.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-05-27
- Estimated Expiration
- 2045-04-24
AI Technical Summary
When existing data interaction platforms process data, there is a problem of resource waste, especially in video processing tasks. How to improve the platform's data processing efficiency has become a challenge.
By receiving video processing tasks uploaded by the demand end, querying equipment parameters, simplifying video processing tasks, determining the base resource amount and additional resource amount, and allocating video processing tasks to each processing end based on these resource amounts to ensure uniform working pressure at the processing end.
The uniformity of working pressure at multiple processing ends is achieved, which greatly improves the platform's data processing efficiency and reduces resource waste.
Smart Images

Figure CN120050236A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of server resource optimization, and in particular to a load balancing method and system for server optimization. Background Art
[0002] With the popularization of smart devices and the development of network technology, the demand for network interaction is becoming increasingly strong. The network interaction process occurs between a large number of devices. One of the mainstream ways is to have a unified platform on which multiple parties interact with each other. Existing data interaction solutions are almost all lossless data interaction processes. The data compression process occurs at the receiving end, that is, after the receiving end receives certain data, it will perform some compression. The compressed data will definitely have some omissions, but this omission still occupies certain transmission resources. Therefore, the existing platform will process the data in advance, and the processing process requires the help of a processing module. How to provide a load balancing solution applied to the processing module to improve the efficiency of the platform in processing data is the technical problem that the technical solution of the present invention wants to solve. Summary of the invention
[0003] The object of the present invention is to provide a load balancing method and system for server optimization to solve the problems raised in the above background technology.
[0004] To achieve the above object, the present invention provides the following technical solutions: A load balancing method for server optimization, the method comprising: Receive video processing tasks uploaded by the demand side, send information query requests to the demand side, and receive device parameters of the video receiving end fed back by the demand side; Simplifying the video processing task according to the device parameters, and simultaneously determining a baseline resource amount of the simplified video processing task; Perform capacity detection on the video processing task and determine the amount of additional resources based on the capacity detection result; Allocating each video processing task to each processing end according to the baseline resource amount and the additional resource amount; The allocation process includes two independent control processes, namely, a control process based on the baseline resource amount and the additional resource amount and a control process based on the historical data of the processing end.
[0005] As a further solution of the present invention, the steps of receiving the video processing task uploaded by the demand side, sending an information query request to the demand side, and receiving the device parameters of the video receiving side fed back by the demand side include: Receive the video processing task uploaded by the demand side, send an information query request to the demand side, and receive the type of the video receiving end fed back by the demand side; Inquiring the device of this type in the video receiving terminal with the access permission, synchronously obtaining the display parameters of the device and the CPU occupancy rate at each moment; the CPU occupancy rate is an array, the sequence number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate; Counting the display parameters of all devices to determine the optimal display parameters and the most common display parameters; the display parameters at least include clarity; Collect statistics on the CPU usage of all devices at each time and determine the average usage.
[0006] As a further solution of the present invention: the step of simplifying the video processing task according to the device parameters and synchronously determining the benchmark resource amount of the simplified video processing task includes: Read the optimal display parameters, input the optimal display parameters into a preset conversion function, and obtain the optimal individual resource quantity; Reading the majority value display parameter, inputting the majority value display parameter into a preset conversion function, and obtaining the majority value individual resource quantity; Read the average occupancy rate to determine the amount of CPU idle time; Simplify the video processing task according to the optimal individual resource amount and CPU idle amount to obtain the optimal video, and count the optimal individual resource amount and CPU idle amount as the benchmark resource amount of the optimal video; Simplify the video processing task according to the majority-valued individual resource amount and CPU idle amount to obtain the majority-valued video, and count the majority-valued individual resource amount and CPU idle amount as the benchmark resource amount of the majority-valued video; The individual resource amount is used to determine the simplification extent of each image in the video processing task; and the CPU idle amount is used to determine the number of images in each time unit in the video processing task.
[0007] As a further solution of the present invention: the step of performing capacity detection on the video processing task and determining the amount of additional resources according to the capacity detection result includes: Obtain the data volume of each image in the optimal video, compare the data volume of adjacent images, calculate the data volume difference, and determine the additional resource volume of the optimal video according to the data volume difference; The data volume of each image in the majority-value video is obtained, the data volume of adjacent images is compared, the data volume difference is calculated, and the additional resource volume of the majority-value video is determined according to the data volume difference.
[0008] As a further solution of the present invention: the step of allocating each video processing task to each processing end according to the reference resource amount and the additional resource amount includes: Recording the amount of tasks to be processed of each processing end in real time; the amount of tasks to be processed is the sum of the baseline resource amount and the additional resource amount allocated to the processing end; Determine the allocation probability of each processing end according to the amount of tasks to be processed at each processing end; Allocating the simplified video processing tasks based on the allocation probability; receiving a correction request fed back by the processing end, and correcting the allocation probability according to the correction request; The process of determining the allocation probability is: ; ; In the formula, For the The amount of tasks to be processed by each processing end, is the total number of processing terminals, For the The characteristic value of the processing end, For the The amount of tasks to be processed at each processing end.
[0009] As a further solution of the present invention: the process of generating a correction request at the processing end includes: Read images within a preset time span based on the current moment; Count the images read, calculate the similarity between each image and other images, and calculate the mean similarity; Selecting images whose similarity mean reaches a preset mean threshold as feature images; When allocating video processing tasks, randomly extract a preset number of images in the video processing tasks, compare the extracted images with each feature image, and select the maximum value in the comparison results; Calculate the average of the maximum values of all extracted images as the matching degree, and determine and feed back the correction rate based on the matching degree; The process of determining the correction rate is: ; In the formula, For the The correction rate of each processing end, For the The matching degree between the processing end and the video processing task, is the preset matching threshold; The process of applying the correction rate is: ; For the The corrected allocation probability of each processing end is For the The modified probability of allocation at each processing end.
[0010] The technical solution of the present invention also provides a load balancing system for server optimization, the system comprising: The device parameter query module is used to receive the video processing task uploaded by the demand side, send an information query request to the demand side, and receive the device parameters of the video receiving end fed back by the demand side; A video simplification module, used to simplify the video processing task according to the device parameters, and simultaneously determine the baseline resource amount of the simplified video processing task; A capacity detection module is used to perform capacity detection on the video processing task and determine the amount of additional resources according to the capacity detection result; A task allocation module, used for allocating each video processing task to each processing terminal according to the reference resource amount and the additional resource amount; The allocation process includes two independent control processes, namely, a control process based on the baseline resource amount and the additional resource amount and a control process based on the historical data of the processing end.
[0011] As a further solution of the present invention: the device parameter query module includes: A task receiving unit, used to receive the video processing task uploaded by the demand side, send an information query request to the demand side, and receive the type of the video receiving end fed back by the demand side; An information acquisition unit, used to query the device of this type in the video receiving terminal with the access permission, and synchronously obtain the display parameters of the device and the CPU occupancy rate at each moment; the CPU occupancy rate is an array, the sequence number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate; A display parameter analysis unit, used to count the display parameters of all devices and determine the optimal display parameters and the most common display parameters; the display parameters at least include clarity; The CPU analysis unit is used to count the CPU occupancy rates of all devices at each moment and determine the average occupancy rate.
[0012] As a further solution of the present invention: the video simplification module includes: A first conversion unit is used to read the optimal display parameter, input the optimal display parameter into a preset conversion function, and obtain the optimal individual resource amount; A second conversion unit is used to read the majority value display parameter, input the majority value display parameter into a preset conversion function, and obtain the majority value individual resource quantity; An idle amount determination unit, used to read the average occupancy rate and determine the CPU idle amount; The first execution unit is used to simplify the video processing task according to the optimal individual resource amount and the CPU idle amount to obtain the optimal video, and to count the optimal individual resource amount and the CPU idle amount as the reference resource amount of the optimal video; The second execution unit is used to simplify the video processing task according to the majority-valued individual resource amount and the CPU idle amount to obtain the majority-valued video, and to count the majority-valued individual resource amount and the CPU idle amount as the benchmark resource amount of the majority-valued video; The individual resource amount is used to determine the simplification extent of each image in the video processing task; and the CPU idle amount is used to determine the number of images in each time unit in the video processing task.
[0013] As a further solution of the present invention: the capacity detection module includes: A first calculation unit is used to obtain the data volume of each image in the optimal video, compare the data volume of adjacent images, calculate the data volume difference, and determine the additional resource volume of the optimal video according to the data volume difference; The second calculation unit is used to obtain the data volume of each image in the majority-value video, compare the data volume of adjacent images, calculate the data volume difference, and determine the additional resource volume of the majority-value video according to the data volume difference.
[0014] Compared with the prior art, the beneficial effects of the present invention are: the present invention analyzes the video processing task, determines its resource amount according to its target and the video itself, and allocates processing ends to it according to the resource amount, so that the working pressure of multiple processing ends is similar, which greatly improves the data processing efficiency of the platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention.
[0016] Figure 1 A flow chart of a load balancing method for server optimization is provided.
[0017] Figure 2 A first flow chart of a load balancing method for server optimization is shown.
[0018] Figure 3 The second flowchart of the load balancing method for server optimization is shown in FIG.
[0019] Figure 4 A third flow chart of a load balancing method for server optimization is shown.
[0020] Figure 5 A fourth flow chart of a load balancing method for server optimization is shown.
[0021] Figure 6 A structural block diagram of a load balancing system optimized for servers. DETAILED DESCRIPTION
[0022] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0023] Figure 1 The flowchart of the load balancing method for server optimization is shown in the following figure. In an embodiment of the present invention, a load balancing method for server optimization includes: Step S100: receiving a video processing task uploaded by a demand side, sending an information query request to the demand side, and receiving device parameters of a video receiving end fed back by the demand side; The present application is applied to the field of video processing. The demand side is generally the video publisher, which uploads the video processing task to the execution subject of this method. The execution subject of this method sends an information query request to the demand side, and receives the device parameters of the video receiving end fed back by the demand side; the video receiving end is the video receiver. For example, if the video publisher sends a short video of an advertisement, then the video receiving end may be a mobile phone with lower performance; the device parameters are the device parameters of the video receiving end, including the performance parameters of the display component and the performance parameters of the processing component.
[0024] Step S200: simplifying the video processing task according to the device parameters, and simultaneously determining a baseline resource amount of the simplified video processing task; Simplifying the video processing task according to the device parameters is essentially a preprocessing of the video. Generally, the video uploaded by the demand side will have high precision and large data volume, while the device parameters of the video receiver cannot process or display the video of corresponding precision. Simplifying the video processing task according to the device parameters can reduce the amount of tasks that need to be processed while almost completely guaranteeing the video effect. After the video processing task is simplified, the benchmark resource amount of the simplified video processing task is synchronously determined; the benchmark resource amount is used to represent the size of the simplified video processing task.
[0025] Step S300: Perform capacity detection on the video processing task, and determine the amount of additional resources according to the capacity detection result; After the video processing task is simplified, it is further compared. The comparison process is to convert the video processing task into an image set, compare each image, and determine the image difference of the video itself based on the comparison result. This image difference reflects the fluctuation of the video itself. The amount of additional resources is determined based on the comparison process itself.
[0026] Step S400: allocating each video processing task to each processing terminal according to the reference resource amount and the additional resource amount; After the above process, each video processing task can obtain a baseline resource amount and an additional resource amount. The baseline resource amount and the additional resource amount reflect the processing difficulty of the video processing task. The allocation process of the video processing task can be adjusted according to the baseline resource amount and the additional resource amount, and it can be allocated to different processing ends; the processing end is a component in the execution body of this method for processing the video, and the execution body of this method can be regarded as a collection of multiple processing ends.
[0027] It should be noted that the allocation process includes two independent control processes, namely, a control process based on the baseline resource amount and the additional resource amount, and a control process based on the historical data of the processing end; the purpose of the control process based on the baseline resource amount and the additional resource amount is to ensure that the total amount of video processing tasks that need to be processed by each processing end is similar, and the control process based on the historical data of the processing end is the adjustment process of the processing end itself. According to the historical processing data, the processing process is fine-tuned to make the images it processes more similar, thereby further improving the processing efficiency.
[0028] Figure 2 The first flow chart of the load balancing method for server optimization includes the steps of receiving a video processing task uploaded by a demand side, sending an information query request to the demand side, and receiving device parameters of a video receiving side fed back by the demand side. Step S101: receiving a video processing task uploaded by a demand side, sending an information query request to the demand side, and receiving the type of the video receiving end fed back by the demand side; Step S102: querying the device of this type in the video receiving terminal with the access permission, and synchronously obtaining the display parameters of the device and the CPU occupancy rate at each moment; the CPU occupancy rate is an array, the sequence number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate; Step S103: Counting display parameters of all devices to determine optimal display parameters and mode display parameters; the display parameters at least include clarity; Step S104: Count the CPU occupancy rates of all devices at each moment and determine the average occupancy rate.
[0029] In an example of the technical solution of the present invention, a video processing task uploaded by a demand side is received, an information query request is sent to the demand side, and the type of video receiving end fed back by the demand side is received. The implicit meaning of this process is that when the demand side uploads the video processing task, it has already determined which video receiving ends will process the video processing task; during the working process, the execution subject of this method will send information monitoring requests to certain video receiving ends, such as some video receiving ends dedicated to testing, which will grant the execution subject of this method access rights, query the device of this type in the video receiving ends with access rights, and synchronously obtain the display parameters of the device and the CPU occupancy rate at each moment. The CPU occupancy rate at each moment refers to the array at each moment, and each array indicates which processes are at the corresponding moment and how much CPU occupancy rate each process has.
[0030] Finally, the display parameters of all devices are counted to determine the optimal display parameters and the majority display parameters. The optimal display parameters indicate what the best device is like, and the majority display parameters indicate what most devices are like. The CPU occupancy rates of all devices at all times are counted to determine the average occupancy rate, which indicates the daily CPU usage of this type of device. In the application scenario of this application, display parameters are more important because the CPUs of most devices have a lot of idle space to complete routine processing tasks.
[0031] Figure 3 The second flow chart of the load balancing method for server optimization, wherein the step of simplifying the video processing task according to the device parameters and synchronously determining the reference resource amount of the simplified video processing task comprises: Step S201: reading the optimal display parameters, inputting the optimal display parameters into a preset conversion function, and obtaining the optimal individual resource quantity; Step S202: reading the majority value display parameter, inputting the majority value display parameter into a preset conversion function, and obtaining the majority value individual resource quantity; Step S203: Read the average occupancy rate to determine the CPU idle amount; Step S204: simplify the video processing task according to the optimal individual resource amount and CPU idle amount to obtain the optimal video, and count the optimal individual resource amount and CPU idle amount as the benchmark resource amount of the optimal video; Step S205: simplify the video processing task according to the majority-valued individual resource amount and the CPU idle amount to obtain the majority-valued video, and count the majority-valued individual resource amount and the CPU idle amount as the benchmark resource amount of the majority-valued video.
[0032] In an example of the technical solution of the present invention, the process of determining the benchmark resource amount is explained. It actually provides two parallel operation schemes to obtain the optimal result and the majority result respectively; when sending to the video receiving end, the majority value scheme is sent uniformly, and when the recovery request fed back by the video receiving end is received, the optimal result is sent to the video receiving end; this method can further simplify the data transmission amount while ensuring the data integrity as much as possible.
[0033] For the CPU, no matter which solution is used, it is the same. The average occupancy rate is read to determine the CPU idle amount. On this basis, the optimal display parameters are read and the optimal display parameters are input into the preset conversion function to obtain the optimal individual resource amount. The video processing task is simplified according to the optimal individual resource amount and the CPU idle amount to obtain the optimal video. The optimal individual resource amount and the CPU idle amount are counted as the benchmark resource amount for the optimal video.
[0034] Read the majority value display parameter, input the majority value display parameter into a preset conversion function to obtain the majority value individual resource amount; simplify the video processing task according to the majority value individual resource amount and the CPU idle amount to obtain the majority value video, and count the majority value individual resource amount and the CPU idle amount as the benchmark resource amount of the majority value video.
[0035] Specifically, the conversion function is a preset value, which represents the relationship between display parameters and resource amounts. The higher the performance of the display parameters, the greater the resource amounts. The individual resource amounts are used to determine the simplification extent of each image in the video processing task. The CPU idle amount is used to determine the number of images in each time unit in the video processing task.
[0036] The simplification scheme of the individual resource amount for the image can be downsampling, such as randomly removing rows or columns, and continuously executing in a loop until the resource amount of the image meets the individual resource amount; the individual resource amount generally adopts the image size, and at this time, the resource amount of the image is also the image size.
[0037] Figure 4 The third flow chart of the load balancing method for server optimization is as follows. The step of performing capacity detection on the video processing task and determining the amount of additional resources according to the capacity detection result includes: Step S301: obtaining the data volume of each image in the optimal video, comparing the data volume of adjacent images, calculating the data volume difference, and determining the additional resource volume of the optimal video according to the data volume difference; Step S302: obtaining the data volume of each image in the majority-value video, comparing the data volume of adjacent images, calculating the data volume difference, and determining the additional resource volume of the majority-value video according to the data volume difference.
[0038] In an example of the technical solution of the present invention, the calculation process of the additional resource amount is explained, and it is also divided into two processes, which process the optimal video and the majority video respectively. The processing method is: obtain the data amount of each image in the video, compare the data amount of adjacent images, calculate the data amount difference, and determine the additional resource amount of the optimal video according to the data amount difference. The additional resource amount is proportional to the mean of the data amount difference and proportional to the standard deviation of the data amount difference.
[0039] Figure 5 The fourth flow chart of the load balancing method for server optimization, wherein the step of allocating each video processing task to each processing end according to the reference resource amount and the additional resource amount comprises: Step S401: Recording the amount of tasks to be processed of each processing end in real time; the amount of tasks to be processed is the sum of the baseline resource amount and the additional resource amount allocated to the processing end; Step S402: determining the allocation probability of each processing end according to the amount of tasks to be processed of each processing end; Step S403: allocating the simplified video processing tasks based on the allocation probability; Step S404: receiving a correction request fed back by the processing end, and correcting the allocation probability according to the correction request.
[0040] For each processing end, the total amount of tasks that need to be processed is recorded in real time, and the allocation probability is determined based on the total amount of tasks that need to be processed. The simplified video processing tasks are allocated based on the determined allocation probability and handed over to different processing ends for processing. This is a control process based on the baseline resource amount and the additional resource amount.
[0041] The process of determining the allocation probability is: ; ; In the formula, For the The amount of tasks to be processed by each processing end, is the total number of processing terminals, For the The characteristic value of the processing end, For the The amount of tasks to be processed at each processing end.
[0042] The process of determining the allocation probability is not complicated. The eigenvalue of each processing end is calculated according to the amount of tasks to be processed at each processing end. The eigenvalue is inversely proportional to the amount of tasks to be processed. Then, all the eigenvalues are counted and converted into allocation probabilities.
[0043] Furthermore, the process of generating a correction request by the processing end includes: Read images within a preset time span based on the current moment; Count the images read, calculate the similarity between each image and other images, and calculate the mean similarity; Selecting images whose similarity mean reaches a preset mean threshold as feature images; When allocating video processing tasks, randomly extract a preset number of images in the video processing tasks, compare the extracted images with each feature image, and select the maximum value in the comparison results; The average of the maximum values of all extracted images is calculated as the matching degree, and the correction rate is determined and fed back based on the matching degree.
[0044] In addition to the above-mentioned control process based on the baseline resource amount and the additional resource amount, there is also a control process based on the historical data of the processing end. For each processing end, at regular intervals, images within a preset time span are read forward based on the current moment, and the similarity between each image and other images is calculated. The similarity mean is calculated at the same time, and images whose similarity mean reaches a preset mean threshold are selected as feature images. The feature image is used to characterize the features of the images processed by the processing end within a period of time, indicating what kind of images it has been processing in the recent period. When allocating video processing tasks, a preset number of images are randomly selected from the video processing tasks, and the extracted images are compared with each feature image. The maximum value in the comparison result is selected, and the average of the maximum values of all the extracted images is calculated as the matching degree. In layman's terms, for video processing tasks, some images are randomly selected from them and compared with the feature image. The matching degree between the processing end and the video processing task is determined according to the comparison result, and then the allocation probability is corrected. The higher the matching degree, the greater the corrected allocation probability, and the easier it is for the video processing task to be processed by the corresponding processing end.
[0045] The process of determining the correction rate is: ; In the formula, For the The correction rate of each processing end, For the The matching degree between the processing end and the video processing task, is the preset matching threshold; For any processing end, read the matching degree between the processing end and the video processing task, and calculate the difference between the matching degree and the matching degree threshold. The larger the difference, the higher the matching degree and the greater the correction rate. It should be noted that is a value in the range of zero to one. and Directly proportional.
[0046] The process of applying the correction rate is: ; For the The corrected allocation probability of each processing end is For the The probability of allocating the modified hypothesis to each processing end; The corrected distribution probability is actually magnified, which will make the sum of the corrected distribution probabilities not equal to one. When using it, it can be normalized again to calculate the ratio of each corrected distribution probability to the total of the corrected distribution probabilities as the final distribution probability, or it can be directly applied; for example, if the sum of the corrected distribution probabilities is A, then the range of 0 to A is divided into multiple sub-intervals, and the span of each sub-interval corresponds to the distribution probability of a processing end, and then a random number is generated in the range of 0 to A. The processing end is selected according to which sub-interval the random number falls into.
[0047] Figure 6 The structure block diagram of a load balancing system for server optimization is shown in FIG. 1 . In an embodiment of the present invention, a load balancing system for server optimization is provided. The system 10 includes: The device parameter query module 11 is used to receive the video processing task uploaded by the demand side, send an information query request to the demand side, and receive the device parameters of the video receiving end fed back by the demand side; A video simplification module 12, configured to simplify the video processing task according to the device parameters, and simultaneously determine a reference resource amount of the simplified video processing task; A capacity detection module 13 is used to perform capacity detection on the video processing task and determine the amount of additional resources according to the capacity detection result; A task allocation module 14, configured to allocate each video processing task to each processing terminal according to the reference resource amount and the additional resource amount; The allocation process includes two independent control processes, namely, a control process based on the baseline resource amount and the additional resource amount and a control process based on the historical data of the processing end.
[0048] Furthermore, the device parameter query module 11 includes: A task receiving unit, used to receive the video processing task uploaded by the demand side, send an information query request to the demand side, and receive the type of the video receiving end fed back by the demand side; An information acquisition unit, used to query the device of this type in the video receiving terminal with the access permission, and synchronously obtain the display parameters of the device and the CPU occupancy rate at each moment; the CPU occupancy rate is an array, the sequence number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate; A display parameter analysis unit, used to count the display parameters of all devices and determine the optimal display parameters and the most common display parameters; the display parameters at least include clarity; The CPU analysis unit is used to count the CPU occupancy rates of all devices at each moment and determine the average occupancy rate.
[0049] Specifically, the video simplification module 12 includes: A first conversion unit is used to read the optimal display parameter, input the optimal display parameter into a preset conversion function, and obtain the optimal individual resource amount; A second conversion unit is used to read the multi-value display parameter, input the multi-value display parameter into a preset conversion function, and obtain the multi-value individual resource amount; An idle amount determination unit, used to read the average occupancy rate and determine the CPU idle amount; The first execution unit is used to simplify the video processing task according to the optimal individual resource amount and the CPU idle amount to obtain the optimal video, and to count the optimal individual resource amount and the CPU idle amount as the reference resource amount of the optimal video; The second execution unit is used to simplify the video processing task according to the majority-valued individual resource amount and the CPU idle amount to obtain the majority-valued video, and to count the majority-valued individual resource amount and the CPU idle amount as the benchmark resource amount of the majority-valued video; The individual resource amount is used to determine the simplification extent of each image in the video processing task; and the CPU idle amount is used to determine the number of images in each time unit in the video processing task.
[0050] Furthermore, the capacity detection module 13 includes: A first calculation unit is used to obtain the data volume of each image in the optimal video, compare the data volume of adjacent images, calculate the data volume difference, and determine the additional resource volume of the optimal video according to the data volume difference; The second calculation unit is used to obtain the data volume of each image in the majority-value video, compare the data volume of adjacent images, calculate the data volume difference, and determine the additional resource volume of the majority-value video according to the data volume difference.
[0051] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A load balancing method for server optimization, characterized in that: The method comprises: Receive video processing tasks uploaded by the demand side, send information query requests to the demand side, and receive device parameters of the video receiving end fed back by the demand side; Simplifying the video processing task according to the device parameters, and simultaneously determining a baseline resource amount of the simplified video processing task; Perform capacity detection on the video processing task and determine the amount of additional resources based on the capacity detection result; Allocating each video processing task to each processing end according to the baseline resource amount and the additional resource amount; The allocation process includes two independent control processes, namely, a control process based on the baseline resource amount and the additional resource amount and a control process based on the historical data of the processing end.
2. The load balancing method for server optimization according to claim 1, characterized in that: The steps of receiving the video processing task uploaded by the demand side, sending an information query request to the demand side, and receiving the device parameters of the video receiving side fed back by the demand side include: Receive the video processing task uploaded by the demand side, send an information query request to the demand side, and receive the type of the video receiving end fed back by the demand side; Inquiring the device of this type in the video receiving terminal with the access permission, synchronously obtaining the display parameters of the device and the CPU occupancy rate at each moment; the CPU occupancy rate is an array, the sequence number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate; Counting the display parameters of all devices to determine the optimal display parameters and the most common display parameters; the display parameters at least include clarity; Collect statistics on the CPU usage of all devices at each time and determine the average usage.
3. The load balancing method for server optimization according to claim 2, characterized in that: The step of simplifying the video processing task according to the device parameters and simultaneously determining the reference resource amount of the simplified video processing task includes: Read the optimal display parameters, input the optimal display parameters into a preset conversion function, and obtain the optimal individual resource quantity; Reading the majority value display parameter, inputting the majority value display parameter into a preset conversion function, and obtaining the majority value individual resource quantity; Read the average occupancy rate to determine the amount of CPU idle time; Simplify the video processing task according to the optimal individual resource amount and CPU idle amount to obtain the optimal video, and count the optimal individual resource amount and CPU idle amount as the benchmark resource amount of the optimal video; Simplify the video processing task according to the majority-valued individual resource amount and CPU idle amount to obtain the majority-valued video, and count the majority-valued individual resource amount and CPU idle amount as the benchmark resource amount of the majority-valued video; The individual resource amount is used to determine the simplification extent of each image in the video processing task; and the CPU idle amount is used to determine the number of images in each time unit in the video processing task.
4. The load balancing method for server optimization according to claim 1, characterized in that: The step of performing capacity detection on the video processing task and determining the amount of additional resources according to the capacity detection result comprises: Obtain the data volume of each image in the optimal video, compare the data volume of adjacent images, calculate the data volume difference, and determine the additional resource volume of the optimal video according to the data volume difference; The data volume of each image in the majority-value video is obtained, the data volume of adjacent images is compared, the data volume difference is calculated, and the additional resource volume of the majority-value video is determined according to the data volume difference.
5. The load balancing method for server optimization according to claim 1, characterized in that: The step of allocating each video processing task to each processing end according to the reference resource amount and the additional resource amount comprises: Recording the amount of tasks to be processed of each processing end in real time; the amount of tasks to be processed is the sum of the baseline resource amount and the additional resource amount allocated to the processing end; Determine the allocation probability of each processing end according to the amount of tasks to be processed at each processing end; Allocating the simplified video processing tasks based on the allocation probability; receiving a correction request fed back by the processing end, and correcting the allocation probability according to the correction request; The process of determining the allocation probability is: ; ; In the formula, For the The amount of tasks to be processed by each processing end, is the total number of processing terminals, For the The characteristic value of the processing end, For the The amount of tasks to be processed at each processing end.
6. The load balancing method for server optimization according to claim 5, characterized in that: The process of generating a correction request on the processing side includes: Read images within a preset time span based on the current moment; Count the images read, calculate the similarity between each image and other images, and calculate the mean similarity; Selecting images whose similarity mean reaches a preset mean threshold as feature images; When allocating video processing tasks, randomly extract a preset number of images in the video processing tasks, compare the extracted images with each feature image, and select the maximum value in the comparison results; Calculate the average of the maximum values of all extracted images as the matching degree, and determine and feed back the correction rate based on the matching degree; The process of determining the correction rate is: ; In the formula, For the The correction rate of each processing end, For the The matching degree between the processing end and the video processing task, is the preset matching threshold; The process of applying the correction rate is: ; For the The corrected allocation probability of each processing end is For the The modified probability of allocation at each processing end.
7. A load balancing system for server optimization, characterized in that: The system comprises: The device parameter query module is used to receive the video processing task uploaded by the demand side, send an information query request to the demand side, and receive the device parameters of the video receiving end fed back by the demand side; A video simplification module, used to simplify the video processing task according to the device parameters, and simultaneously determine the baseline resource amount of the simplified video processing task; A capacity detection module is used to perform capacity detection on the video processing task and determine the amount of additional resources according to the capacity detection result; A task allocation module, used for allocating each video processing task to each processing end according to the reference resource amount and the additional resource amount; The allocation process includes two independent control processes, namely, a control process based on the baseline resource amount and the additional resource amount and a control process based on the historical data of the processing end.
8. The load balancing system for server optimization according to claim 7, characterized in that: The device parameter query module includes: A task receiving unit, used to receive the video processing task uploaded by the demand side, send an information query request to the demand side, and receive the type of the video receiving end fed back by the demand side; An information acquisition unit, used to query the device of this type in the video receiving terminal with the access permission, and synchronously obtain the display parameters of the device and the CPU occupancy rate at each moment; the CPU occupancy rate is an array, the sequence number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate; A display parameter analysis unit, used to count the display parameters of all devices and determine the optimal display parameters and the most common display parameters; the display parameters at least include clarity; The CPU analysis unit is used to count the CPU occupancy rates of all devices at each moment and determine the average occupancy rate.
9. The load balancing system for server optimization according to claim 8, characterized in that: The video simplification module comprises: A first conversion unit is used to read the optimal display parameter, input the optimal display parameter into a preset conversion function, and obtain the optimal individual resource amount; A second conversion unit is used to read the multi-value display parameter, input the multi-value display parameter into a preset conversion function, and obtain the multi-value individual resource amount; An idle amount determination unit, used to read the average occupancy rate and determine the CPU idle amount; The first execution unit is used to simplify the video processing task according to the optimal individual resource amount and the CPU idle amount to obtain the optimal video, and to count the optimal individual resource amount and the CPU idle amount as the reference resource amount of the optimal video; The second execution unit is used to simplify the video processing task according to the majority-valued individual resource amount and the CPU idle amount to obtain the majority-valued video, and to count the majority-valued individual resource amount and the CPU idle amount as the benchmark resource amount of the majority-valued video; The individual resource amount is used to determine the simplification extent of each image in the video processing task; and the CPU idle amount is used to determine the number of images in each time unit in the video processing task.
10. The load balancing system for server optimization according to claim 7, characterized in that: The capacity detection module comprises: A first calculation unit is used to obtain the data volume of each image in the optimal video, compare the data volume of adjacent images, calculate the data volume difference, and determine the additional resource volume of the optimal video according to the data volume difference; The second calculation unit is used to obtain the data volume of each image in the majority-value video, compare the data volume of adjacent images, calculate the data volume difference, and determine the additional resource volume of the majority-value video according to the data volume difference.
Citation Information
Patent Citations
Data processing method, data emitting terminal, data receiving terminal and communication system
CN108781218A
GPU (Graphics Processing Unit) bare metal computing power resource allocation scheduling method and device and storage medium
CN117636137A
Video service balancing method and device for intelligent server cluster, equipment and medium
CN117750040A
Container migration optimization method and system and storage medium
CN118585290A
Video acquisition encryption method and system based on Web
CN119011762A