Load Balancing Method and System for Server Optimization
By receiving video processing tasks, querying device parameters, simplifying tasks and allocating them to the processing end, the problems of resource waste and unbalanced processing modules during data interaction in the prior art are solved, and efficient data processing is achieved.
Patent Information
- Application Number
- CN202510520544.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-24
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2045-04-24
AI Technical Summary
In the prior art, resources are wasted due to data compression during data interaction, and it is difficult for the processing module to achieve efficient load balancing when processing data.
By receiving video processing tasks uploaded by the demand side, querying device parameters, simplifying video processing tasks, determining the base resource amount and additional resource amount, and allocating tasks to each processing end based on these resource amounts to achieve load balancing.
The efficiency of platform data processing is improved, and resource waste is reduced by balancing the working pressure on the processing end.
Smart Images

Figure CN120050236B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of server resource optimization, and specifically to a load balancing method and system for server optimization. Background Art
[0002] With the popularization of intelligent devices and the development of network technology, the demand for network interaction is increasing day by day. The network interaction process occurs among a large number of devices. A mainstream method is to have a unified platform where multiple parties conduct data interaction on this platform. Almost all existing data interaction solutions are lossless data interaction processes, and the data compression process occurs at the receiving end. That is, after the receiving end receives certain data, it will perform some compression. There will definitely be some data loss after compression, but this loss still occupies a certain amount of transmission resources. Therefore, the existing platform will pre-process the data, and the processing process requires the assistance of a processing module. How to provide a load balancing solution for the processing module and 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 purpose 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 art.
[0004] To achieve the above purpose, the present invention provides the following technical solutions:
[0005] A load balancing method for server optimization, the method includes:
[0006] 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;
[0007] Simplifying the video processing task according to the device parameters, and simultaneously determining the benchmark resource amount of the simplified video processing task;
[0008] Performing a capacity detection on the video processing task, and determining an additional resource amount according to the capacity detection result;
[0009] Allocating each video processing task to each processing end according to the benchmark resource amount and the additional resource amount;
[0010] Among them, the allocation process includes two independent control processes, namely a control process based on the benchmark 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 step 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 end fed back by the demand side includes:
[0012] Receive the video processing tasks uploaded by the demand side, send an information query request to the demand side, and receive the type of the video receiving side feedback by the demand side;
[0013] Query the devices of this type among the video receiving sides with access rights, and synchronously obtain the display parameters of the devices and the CPU occupancy rates at each moment; the CPU occupancy rate is an array, the serial number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate;
[0014] Statistically analyze the display parameters of all devices, and determine the optimal display parameters and the modal display parameters; the display parameters at least include clarity;
[0015] Statistically analyze the CPU occupancy rates of all devices at each moment, and determine the average occupancy rate.
[0016] 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:
[0017] Read the optimal display parameters, input the optimal display parameters into a preset conversion function, and obtain the optimal individual resource amount;
[0018] Read the modal display parameters, input the modal display parameters into a preset conversion function, and obtain the modal individual resource amount;
[0019] Read the average occupancy rate and determine the CPU idle amount;
[0020] Simplify the video processing task according to the optimal individual resource amount and the CPU idle amount to obtain the optimal video, and statistically analyze the optimal individual resource amount and the CPU idle amount as the benchmark resource amount of the optimal video;
[0021] Simplify the video processing task according to the modal individual resource amount and the CPU idle amount to obtain the modal video, and statistically analyze the modal individual resource amount and the CPU idle amount as the benchmark resource amount of the modal video;
[0022] Among them, the individual resource amount is used to determine the simplification amplitude of each image in the video processing task; the CPU idle amount is used to determine the number of images per time unit in the video processing task.
[0023] As a further solution of the present invention: the step of performing a capacity detection on the video processing task and determining the additional resource amount according to the capacity detection result includes:
[0024] Obtain the data amount of each image in the optimal video, compare the data amounts of adjacent images, calculate the data amount difference, and determine the additional resource amount of the optimal video according to the data amount difference;
[0025] Obtain the data volume of each image in the median-value video, compare the data volumes of adjacent images, calculate the data volume difference, and determine the additional resource volume of the median-value video based on the data volume difference.
[0026] 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 volume and the additional resource volume includes:
[0027] Record the amount of tasks to be processed at each processing end in real time; the amount of tasks to be processed is the sum of the reference resource volume and the additional resource volume allocated to this processing end;
[0028] Determine the allocation probability of each processing end according to the amount of tasks to be processed at each processing end;
[0029] Allocate the simplified video processing tasks based on the allocation probability;
[0030] Receive the correction request feedback from the processing end, and correct the allocation probability according to the correction request;
[0031] The determination process of the allocation probability is:
[0032] ; ; where is the amount of tasks to be processed at the th processing end, is the total number of processing ends, is the eigenvalue of the th processing end, is the amount of tasks to be processed at the th processing end.
[0033] As a further solution of the present invention: The process of the processing end generating a correction request includes:
[0034] Regularly read the images within a preset time span forward based on the current moment;
[0035] Count the read images, calculate the similarity between each image and other images, and calculate the average similarity at the same time;
[0036] Select the images whose average similarity reaches the preset average threshold as the feature images;
[0037] When allocating the video processing tasks, randomly extract a preset number of images from the video processing tasks, compare the extracted images with each feature image, and select the maximum value in the comparison results;
[0038] Calculate the average value of the maximum values of all the extracted images as the matching degree, and determine and feedback the correction rate according to the matching degree;
[0039] The determination process of the correction rate is:
[0040] ;
[0041] Wherein, is the correction rate of the th processing end, is the matching degree of the th processing end and the video processing task, is a preset matching degree threshold;
[0042] The application process of the correction rate is as follows:
[0043] ; is the corrected allocation probability of the th processing end, is the corrected guessed allocation probability of the th processing end.
[0044] The technical solution of the present invention further provides a load balancing system for server optimization, and the system includes:
[0045] A device parameter query module, configured to receive a video processing task uploaded by a 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;
[0046] A video simplification module, configured to simplify the video processing task according to the device parameters, and synchronously determine the benchmark resource amount of the simplified video processing task;
[0047] A capacity detection module, configured to perform capacity detection on the video processing task, and determine the additional resource amount according to the capacity detection result;
[0048] A task allocation module, configured to allocate each video processing task to each processing end according to the benchmark resource amount and the additional resource amount;
[0049] Wherein, the allocation process includes two independent control processes, namely a control process based on the benchmark resource amount and the additional resource amount and a control process based on the historical data of the processing end.
[0050] As a further solution of the present invention: the device parameter query module includes:
[0051] A task receiving unit, configured to receive a video processing task uploaded by a 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;
[0052] An information acquisition unit, configured to query devices of this type in a video receiving end with access rights, and synchronously acquire the display parameters of the devices and the CPU occupancy rates at each moment; the CPU occupancy rates are an array, the serial numbers of the array correspond to processes, and the element values correspond to the CPU occupancy rates;
[0053] A display parameter analysis unit, configured to count the display parameters of all devices, and determine the optimal display parameters and the mode display parameters; the display parameters at least include clarity;
[0054] A CPU analysis unit, configured to count the CPU occupancy rates at each moment of all devices, and determine the average occupancy rate.
[0055] As a further solution of the present invention: the video simplification module includes:
[0056] A first conversion unit, configured to read the optimal display parameters, input the optimal display parameters into a preset conversion function, and obtain the optimal individual resource amount;
[0057] A second conversion unit, configured to read the mode display parameters, input the mode display parameters into a preset conversion function, and obtain the mode individual resource amount;
[0058] An idle amount determination unit, configured to read the average occupancy rate and determine the CPU idle amount;
[0059] A first execution unit, configured to simplify the video processing task according to the optimal individual resource amount and the CPU idle amount to obtain an optimal video, and count the optimal individual resource amount and the CPU idle amount as the benchmark resource amount of the optimal video;
[0060] A second execution unit, configured to simplify the video processing task according to the mode individual resource amount and the CPU idle amount to obtain a mode video, and count the mode individual resource amount and the CPU idle amount as the benchmark resource amount of the mode video;
[0061] Among them, the individual resource amount is used to determine the simplification amplitude of each image in the video processing task; the CPU idle amount is used to determine the number of images per time unit in the video processing task.
[0062] As a further solution of the present invention: the capacity detection module includes:
[0063] A first calculation unit, configured to obtain the data amount of each image in the optimal video, compare the data amounts of adjacent images, calculate the data amount difference, and determine the additional resource amount of the optimal video according to the data amount difference;
[0064] A second calculation unit, configured to obtain the data amount of each image in the mode video, compare the data amounts of adjacent images, calculate the data amount difference, and determine the additional resource amount of the mode video according to the data amount difference.
[0065] Compared with the prior art, the beneficial effects of the present invention are as follows: The present invention analyzes video processing tasks, determines the resource amount according to its target and the video itself, and allocates a processing end according to the resource amount, so that the working pressures of multiple processing ends are approximately the same, greatly improving the data processing efficiency of the platform. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present invention.
[0067] Figure 1 It is a flow block diagram of a load balancing method for server optimization.
[0068] Figure 2 It is the first flow block diagram of a load balancing method for server optimization.
[0069] Figure 3 It is the second flow block diagram of a load balancing method for server optimization.
[0070] Figure 4 It is the third flow block diagram of a load balancing method for server optimization.
[0071] Figure 5 It is the fourth flow block diagram of a load balancing method for server optimization.
[0072] Figure 6 It is a block diagram of the composition structure of a load balancing system for server optimization. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0073] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present invention more clearly understood, the following further describes the present invention in detail with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0074] Figure 1 It is a flow block diagram of a load balancing method for server optimization. In an embodiment of the present invention, a load balancing method for server optimization, the method includes:
[0075] Step S100: Receive a video processing task uploaded by a demand side, send an information query request to the demand side, and receive the device parameters of the video receiving side fed back by the demand side;
[0076] This application is applied to the field of video processing. The demand side is generally the video publisher, which uploads video processing tasks to the execution entity of this method. The execution entity of this method sends an information query request to the demand side and receives the device parameters of the video receiver feedback by the demand side; the video receiver is the video recipient. For example, if the video sent by the video publisher is a short advertising video, then the video receiver may be a mobile phone with low performance; the device parameters are the device parameters of the video receiver, including the performance parameters of the display component and the performance parameters of the processing component.
[0077] Step S200: Simplify the video processing task according to the device parameters, and simultaneously determine the benchmark resource amount of the simplified video processing task;
[0078] Simplifying the video processing task according to the device parameters is essentially a preprocessing of the video. Generally, the accuracy of the video uploaded by the demand side is very high and the data volume is large, while the device parameters of the video receiver simply cannot process or display the video with corresponding accuracy. By first simplifying the video processing task according to the device parameters, the amount of tasks to be processed can be reduced while almost completely ensuring the video effect. After the video processing task is simplified, the benchmark resource amount of the simplified video processing task is determined simultaneously; the benchmark resource amount is used to represent the size of the simplified video processing task.
[0079] Step S300: Perform a capacity detection on the video processing task, and determine the additional resource amount according to the capacity detection result;
[0080] After the video processing task is simplified, a further comparison is made on the simplified video processing task. The comparison process is to convert the video processing task into an image set, compare each image, determine the image difference of the video itself according to the comparison result, and this image difference reflects the fluctuation situation of the video itself. The additional resource amount is determined according to the self-comparison process.
[0081] Step S400: Allocate each video processing task to each processing end according to the benchmark resource amount and the additional resource amount;
[0082] After the processing of the above process, each video processing task can obtain a benchmark resource amount and an additional resource amount. The benchmark resource amount and the additional resource amount reflect the processing difficulty of the video processing task. According to the benchmark resource amount and the additional resource amount, the allocation process of the video processing task can be adjusted and allocated to different processing ends; the processing end is the component in the execution entity of this method used to process the video, and the execution entity of this method can be regarded as a collection of multiple processing ends.
[0083] It should be noted that the allocation process includes two independent control processes, namely, the control process based on the benchmark resource volume and the additional resource volume, and the control process based on the historical data of the processing end. The purpose of the control process based on the benchmark resource volume and the additional resource volume is to ensure that the total amount of video processing tasks to be processed by each processing end is similar. The control process based on the historical data of the processing end is the self-regulation process of the processing end. According to the historical processing data, the processing process is fine-tuned to make the processed images more similar and further improve the processing efficiency.
[0084] Figure 2 It is the first flow chart of the load balancing method for server optimization. The steps of receiving the video processing tasks uploaded by the demand side and sending an information query request to the demand side and receiving the device parameters of the video receiving end feedback by the demand side include:
[0085] Step S101: Receive the video processing tasks uploaded by the demand side, send an information query request to the demand side, and receive the type of the video receiving end feedback by the demand side.
[0086] Step S102: Query the devices of this type in the video receiving ends with viewing permissions, and synchronously obtain the display parameters of the devices and the CPU occupancy rates at each moment. The CPU occupancy rate is an array, the serial number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate.
[0087] Step S103: Statistically analyze the display parameters of all devices, and determine the optimal display parameters and the mode display parameters. The display parameters at least include clarity.
[0088] Step S104: Statistically analyze the CPU occupancy rates at each moment of all devices, and determine the average occupancy rate.
[0089] In an example of the technical solution of the present invention, the process of receiving the video processing tasks uploaded by the demand side, sending an information query request to the demand side, and receiving the type of the video receiving end feedback by the demand side implies that when the demand side uploads the video processing tasks, it has already determined which video receiving ends will process the video processing tasks. During the working process of the execution subject of this method, an information monitoring request will be sent to some video receiving ends, such as some video receiving ends dedicated to testing, and they will grant the execution subject of this method the viewing permission. Query the devices of this type in the video receiving ends with viewing permissions, and synchronously obtain the display parameters of the devices and the CPU occupancy rates at each moment. The CPU occupancy rates at each moment refer to the arrays at each moment. Each array represents which processes exist at the corresponding moment and how much CPU occupancy rate each process has.
[0090] Finally, the display parameters of all devices are counted to determine the optimal display parameters and the modal display parameters. The optimal display parameters indicate what the best device is like, and the modal display parameters indicate what most devices are like. The CPU occupancy rates of all devices at each moment are counted to determine the average occupancy rate, which represents the daily CPU usage of this type of device. In the application scenario of this application, the display parameters are more important because the CPUs of most devices have a lot of idle capacity and can complete routine processing tasks.
[0091] Figure 3 It is the second flowchart of the load balancing method for server optimization. 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:
[0092] Step S201: Read the optimal display parameters, input the optimal display parameters into a preset conversion function to obtain the optimal individual resource amount;
[0093] Step S202: Read the modal display parameters, input the modal display parameters into a preset conversion function to obtain the modal individual resource amount;
[0094] Step S203: Read the average occupancy rate and determine the CPU idle capacity;
[0095] Step S204: Simplify the video processing task according to the optimal individual resource amount and the CPU idle capacity to obtain the optimal video, and count the optimal individual resource amount and the CPU idle capacity as the benchmark resource amount of the optimal video;
[0096] Step S205: Simplify the video processing task according to the modal individual resource amount and the CPU idle capacity to obtain the modal video, and count the modal individual resource amount and the CPU idle capacity as the benchmark resource amount of the modal video.
[0097] In an example of the technical solution of the present invention, the process of determining the benchmark resource amount is described. It actually provides two parallel operation schemes to obtain the optimal result and the modal result respectively. When sending to the video receiving end, the modal scheme is sent uniformly. When receiving the restoration request feedback from the video receiving end, the optimal result is sent to the video receiving end. This way can further simplify the data transmission volume while ensuring the data integrity as much as possible.
[0098] For the CPU, no matter which solution is adopted, the process is the same: read the average occupancy rate to determine the CPU idle amount; on this basis, read the optimal display parameters, input the optimal display parameters into a preset conversion function to obtain the optimal individual resource amount, simplify the video processing task according to the optimal individual resource amount and the CPU idle amount to obtain the optimal video, and count the optimal individual resource amount and the CPU idle amount as the benchmark resource amount of the optimal video.
[0099] Read the mode display parameters, input the mode display parameters into a preset conversion function to obtain the mode individual resource amount; simplify the video processing task according to the mode individual resource amount and the CPU idle amount to obtain the mode video, and count the mode individual resource amount and the CPU idle amount as the benchmark resource amount of the mode video.
[0100] Specifically, the conversion function is a preset value representing the relationship between display parameters and resource amount. The higher the performance of the display parameters, the larger the resource amount; the individual resource amount is used to determine the simplification amplitude of each image in the video processing task; the CPU idle amount is used to determine the number of images per time unit in the video processing task.
[0101] The simplification scheme of the individual resource amount for an image can be downsampling, such as randomly removing rows or columns, and continuously looping until the resource amount of the image meets the individual resource amount; generally, the individual resource amount uses the image size, and at this time, the resource amount of the image is also the image size.
[0102] Figure 4 It is the third process block diagram of the load balancing method for server optimization. The steps of performing capacity detection on the video processing task and determining the additional resource amount according to the capacity detection result include:
[0103] Step S301: Obtain the data amount of each image in the optimal video, compare the data amounts of adjacent images, calculate the data amount difference, and determine the additional resource amount of the optimal video according to the data amount difference;
[0104] Step S302: Obtain the data amount of each image in the mode video, compare the data amounts of adjacent images, calculate the data amount difference, and determine the additional resource amount of the mode video according to the data amount difference.
[0105] In an example of the technical solution of the present invention, the calculation process of the additional resource amount is described. It is also divided into two processes, respectively processing the optimal video and the mode video. The processing method is: obtain the data amount of each image in the video, compare the data amounts of adjacent images, calculate the data amount difference, and determine the additional resource amount of the optimal video. 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.
[0106] Figure 5 It is the fourth process block diagram of the load balancing method for server optimization. The step of allocating each video processing task to each processing end according to the benchmark resource amount and the additional resource amount includes:
[0107] Step S401: Record the amount of tasks to be processed at each processing end in real time; the amount of tasks to be processed is the sum of the benchmark resource amount and the additional resource amount allocated to this processing end;
[0108] Step S402: Determine the allocation probability of each processing end according to the amount of tasks to be processed at each processing end;
[0109] Step S403: Allocate the simplified video processing tasks based on the allocation probability;
[0110] Step S404: Receive the correction request feedback from the processing end and correct the allocation probability according to the correction request.
[0111] For each processing end, record in real time the total amount of tasks it still needs to process, determine the allocation probability according to the total amount of tasks still to be processed, allocate the simplified video processing tasks based on the determined allocation probability, and hand them over to different processing ends for processing. This is a control process based on the benchmark resource amount and the additional resource amount.
[0112] The process of determining the allocation probability is as follows:
[0113] ; ; In the formula, is the amount of tasks to be processed at the th processing end, is the total number of processing ends, is the eigenvalue of the th processing end, is the th processing end,
[0114] The process of determining the allocation probability is not complicated. Calculate the eigenvalue of each processing end 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, count all the eigenvalues and convert them into the allocation probability.
[0115] Furthermore, the process of the processing end generating the correction request includes:
[0116] Read the images within the preset time span forward based on the current moment at regular intervals;
[0117] Count the read images, calculate the similarity between each image and other images, and calculate the average similarity at the same time;
[0118] Select the images whose average similarity reaches the preset average threshold as the feature images;
[0119] When allocating video processing tasks, randomly select a preset number of images from the video processing tasks, compare the selected images with each feature image, and select the maximum value in the comparison results;
[0120] Calculate the average value of the maximum values of all the selected images as the matching degree, and determine and feedback the correction rate according to the matching degree.
[0121] In addition to the above control process based on the benchmark resource amount and the additional resource amount, there is another process which is the control process based on the historical data of the processing end. For each processing end, at regular intervals, read the images within a preset time span forward from the current moment, calculate the similarity between each image and other images, and at the same time calculate the average similarity. Select the images whose average similarity reaches the preset average threshold as the feature images. The feature images are used to represent the characteristics of the images processed by the processing end within a period of time, indicating what kind of images it has been processing recently. When allocating video processing tasks, randomly select a preset number of images from the video processing tasks, compare the selected images with each feature image, select the maximum value in the comparison results, calculate the average value of the maximum values of all the selected images as the matching degree. Generally speaking, for video processing tasks, randomly select some images from them, compare them with the feature images, and determine the matching degree between the processing end and the video processing task according to the comparison results, and then correct the allocation probability. The higher the matching degree, the greater the corrected allocation probability, and the more likely the video processing task is to be processed by the corresponding processing end.
[0122] The process of determining the correction rate is as follows:
[0123] ; where is the correction rate of the th processing end, is the matching degree between the th processing end and the video processing task, is the preset matching degree threshold;
[0124] For any processing end, read the matching degree between the processing end and the video processing task, 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 within the range of zero to one, is proportional to
[0125] The application process of the correction rate is as follows:
[0126] ; is the corrected allocation probability for the th processing end, is the corrected hypothesized allocation probability for the th processing end;
[0127] The corrected allocation probability is actually amplified, which will cause the sum of the corrected allocation probabilities not to be one. When using, a normalization process can be carried out again. Calculate the ratio of each corrected allocation probability to the total sum of the corrected allocation probabilities as the final allocation probability, or it can be directly applied; for example, if the sum of the corrected allocation probabilities is A, then divide the range from 0 to A into multiple sub-intervals, the span of each sub-interval corresponds to the allocation probability of a processing end, and then generate a random number within the range from 0 to A. Whichever sub-interval the random number falls into, select that processing end.
[0128] Figure 6 is the block diagram of the composition structure of the load balancing system for server optimization. In the embodiment of the present invention, a load balancing system for server optimization, the system 10 includes:
[0129] 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;
[0130] The video simplification module 12 is used to simplify the video processing task according to the device parameters, and synchronously determine the benchmark resource amount of the simplified video processing task;
[0131] The capacity detection module 13 is used to perform capacity detection on the video processing task, and determine the additional resource amount according to the capacity detection result;
[0132] The task allocation module 14 is used to allocate each video processing task to each processing end according to the benchmark resource amount and the additional resource amount;
[0133] Among them, the allocation process includes two independent control processes, namely the control process based on the benchmark resource amount and the additional resource amount and the control process based on the historical data of the processing end.
[0134] Further, the device parameter query module 11 includes:
[0135] The task receiving unit 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 type of the video receiving end fed back by the demand side;
[0136] The information acquisition unit is used to query the devices of this type among the video receiving ends with access rights, and synchronously obtain the display parameters of the devices and the CPU occupancy rate at each moment; the CPU occupancy rate is an array, the serial number of the array corresponds to the process, and the element value corresponds to the CPU occupancy rate;
[0137] A display parameter analysis unit for counting the display parameters of all devices and determining the optimal display parameter and the mode display parameter; the display parameter at least includes clarity.
[0138] A CPU analysis unit for counting the CPU occupancy rate of all devices at each moment and determining the average occupancy rate.
[0139] Specifically, the video simplification module 12 includes:
[0140] A first conversion unit for reading the optimal display parameter, inputting the optimal display parameter into a preset conversion function, and obtaining the optimal individual resource amount.
[0141] A second conversion unit for reading the mode display parameter, inputting the mode display parameter into a preset conversion function, and obtaining the mode individual resource amount.
[0142] An idle amount determination unit for reading the average occupancy rate and determining the CPU idle amount.
[0143] A first execution unit for simplifying the video processing task according to the optimal individual resource amount and the CPU idle amount to obtain an optimal video, and counting the optimal individual resource amount and the CPU idle amount as the benchmark resource amount of the optimal video.
[0144] A second execution unit for simplifying the video processing task according to the mode individual resource amount and the CPU idle amount to obtain a mode video, and counting the mode individual resource amount and the CPU idle amount as the benchmark resource amount of the mode video.
[0145] Wherein, the individual resource amount is used to determine the simplification amplitude of each image in the video processing task; the CPU idle amount is used to determine the number of images per time unit in the video processing task.
[0146] Furthermore, the capacity detection module 13 includes:
[0147] A first calculation unit for obtaining the data amount of each image in the optimal video, comparing the data amounts of adjacent images, calculating the data amount difference, and determining the additional resource amount of the optimal video according to the data amount difference.
[0148] A second calculation unit for obtaining the data amount of each image in the mode video, comparing the data amounts of adjacent images, calculating the data amount difference, and determining the additional resource amount of the mode video according to the data amount difference.
[0149] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, and improvements made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A load balancing method for server optimization, characterized in that: The method comprises: 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; Count the CPU usage of all devices at each time and determine the average usage; 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; Among them, the individual resource amount is used to determine the simplification amplitude 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; 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; Obtaining the data volume of each image in the majority-valued video, comparing the data volume of adjacent images, calculating the data volume difference, and determining the additional resource volume of the majority-valued video according to the data volume difference; 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 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 probability of assigning a processing end is 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.
3. The load balancing method for server optimization according to claim 2, 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 distribution probability before correction for each processing end.
4. A load balancing system for server optimization, characterized in that: The system comprises: 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 usage of all devices at each time and determine the average usage; 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; Among them, the individual resource amount is used to determine the simplification amplitude 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; 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; A 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; 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.
Citation Information
Patent Citations
Data processing method, data emitting terminal, data receiving terminal and communication system
CN108781218A
Container migration optimization method and system and storage medium
CN118585290A