CN-121166354-B - Low-delay distributed reasoning cluster optimization method and system
Abstract
The invention relates to the technical field of cluster optimization, and particularly discloses a low-delay distributed reasoning cluster optimization method and a system, wherein the method comprises the steps of screening processed images and constructing a sample image group; the method comprises the steps of sequentially carrying out data simplification on each image in a sample image group, calculating data fidelity, determining a data simplification scheme of each image according to the data fidelity, clustering the images, determining a comprehensive simplification scheme of each type of image, determining a demand score according to the comprehensive simplification scheme for each type of image, carrying out resource allocation on an inference cluster according to the demand score, matching a corresponding type of image when a new image is received, inquiring the comprehensive simplification scheme of the type of image, simplifying the image, and allocating the simplified image to resources corresponding to the type of image.
Inventors
- Cai Qipin
- HUANG GUN
- BAI SIYU
Assignees
- 北京创驰恒业科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20250910
Claims (5)
- 1. A method for low-latency distributed inference cluster optimization, the method comprising: reading processed images within a preset time range, screening the processed images, and constructing a sample image group; Sequentially carrying out data simplification on each image in the sample image group, calculating data fidelity, and determining a data simplification scheme of each image according to the data fidelity; clustering the images, identifying the data simplification scheme of each type of image, and determining the comprehensive simplification scheme of each type of image; For each type of image, determining a demand score according to the comprehensive simplification scheme, and distributing resources to the reasoning clusters according to the demand score; when a new image is received, matching a corresponding image, inquiring a comprehensive simplification scheme of the image, simplifying the image, and synchronously distributing the simplified image to resources corresponding to the image; the step of sequentially carrying out data simplification on each image in the sample image group, calculating data fidelity, and determining a data simplification scheme of each image according to the data fidelity comprises the following steps: sequentially reading images in a sample image group; performing Fourier transform on the image to obtain a frequency domain diagram and a phase diagram; creating a circular area based on an origin in the frequency domain diagram, wherein the radius of the circular area is that the average value of pixel values in the circular area is not smaller than a preset average value threshold value; randomly selecting a preset number of points in the non-reference reserved area to serve as a random reserved area, and performing cyclic execution to obtain a preset number of random reserved areas; Carrying out inverse Fourier transform on the frequency domain image and the phase image according to the reference reserved area and the random reserved area to obtain a restored image; Comparing the restored image with the original image, and calculating the data fidelity; selecting a restored image with the maximum data fidelity, inquiring a random reserved area corresponding to the restored image, reading the random reserved area and a reference reserved area, and generating a position matrix as a data simplification scheme; The step of clustering the images, identifying the data simplification scheme of each type of image, and determining the comprehensive simplification scheme of each type of image comprises the following steps: the images in the sample image group are compared pairwise, and the images are clustered according to the comparison result; reading a data simplifying scheme of each image for each type of image; for any position in the data simplifying schemes, calculating the selection density of the position according to all the data simplifying schemes; reserving and selecting the position of which the density reaches a preset density threshold value, and creating a position matrix as a comprehensive simplification scheme, wherein the reserved position is set as one, and the unreserved position is set as zero; Wherein, the density threshold is externally connected with an adjusting port; The step of determining the demand scores for each type of image according to the comprehensive simplification scheme and allocating resources to the reasoning clusters according to the demand scores comprises the following steps: reading a comprehensive simplification scheme for each type of image; calculating the ratio of the number of the positions which is one in the comprehensive simplified scheme to all the number of the positions, and determining a demand score according to the ratio; and counting the demand scores of all types of images, and distributing resources to the reasoning clusters according to the demand scores.
- 2. The method of claim 1, wherein the step of reading the processed images within a predetermined time range, filtering the processed images, and constructing the sample image group comprises: reading processed images within a preset time range, and constructing an image sequence; acquiring the size and the type of each image, determining the data quantity of the images, and obtaining a data quantity sequence; Reading the maximum value and the minimum value in the data volume sequence, determining a data volume interval, and segmenting the data volume interval according to a preset data volume step length to obtain a subinterval; Counting the data quantity in the data quantity sequence according to the subintervals, and determining the number of elements in each subinterval; determining the selection probability of each subinterval according to the number of the elements, and carrying out probability assignment on each element in the data quantity sequence; and sequentially judging whether to read the images according to the assigned probabilities, and taking the read images as a sample image group.
- 3. The method of claim 1, wherein when a new image is received, matching its corresponding class of images, inquiring the comprehensive simplification scheme of the image, simplifying the image, and synchronously distributing the simplified image to the resources corresponding to the image, wherein the step of synchronously distributing the simplified image to the resources corresponding to the image comprises the following steps of: when a new image is received, matching the class corresponding to the image; inquiring a comprehensive simplification scheme corresponding to the matched class, and simplifying the image based on the comprehensive simplification scheme; inquiring the resources corresponding to the matched classes, and sending the simplified images to the resources; and monitoring the occupancy rate of the resources in real time, and transmitting the image to the standby processing end when the occupancy rate reaches a preset occupancy rate threshold value.
- 4. A low-latency distributed inference cluster optimization system, the system comprising: The image group construction module is used for reading the processed images within a preset time range, screening the processed images and constructing a sample image group; The simplified scheme generation module is used for sequentially carrying out data simplification on each image in the sample image group, calculating the data fidelity and determining the data simplified scheme of each image according to the data fidelity; the comprehensive scheme determining module is used for clustering the images, identifying the data simplifying scheme of each type of image and determining the comprehensive simplifying scheme of each type of image; the resource allocation module is used for determining a demand score for each type of image according to the comprehensive simplified scheme and allocating resources to the reasoning clusters according to the demand score; The image distribution module is used for matching the corresponding image types when receiving the new image, inquiring the comprehensive simplification scheme of the image types, simplifying the image, and synchronously distributing the simplified image to the corresponding resources of the image types; The simplified scheme generating module includes: an image reading unit for sequentially reading images in the sample image group; the frequency domain conversion unit is used for carrying out Fourier transform on the image to obtain a frequency domain image and a phase image; The reference area determining unit is used for creating a circular area based on an origin in the frequency domain diagram and taking the circular area as a reference reserved area, wherein the radius of the circular area is that the average value of pixel values in the circular area is not smaller than a preset average value threshold value; The random area determining unit is used for randomly selecting a preset number of points in the non-reference reserved area to serve as a random reserved area, and circularly executing the points to obtain the preset number of random reserved areas; the inverse transformation unit is used for carrying out inverse Fourier transformation on the frequency domain image and the phase image according to the reference reserved area and the random reserved area to obtain a restored image; the fidelity calculating unit is used for comparing the restored image with the original image and calculating the data fidelity; the position statistics unit is used for selecting a restored image with the maximum data fidelity, inquiring a random reserved area corresponding to the restored image, reading the random reserved area and a reference reserved area, and generating a position matrix as a data simplification scheme; the comprehensive scheme determining module comprises: The image comparison unit is used for carrying out pairwise comparison on the images in the sample image group and clustering the images according to the comparison result; a scheme reading unit for reading a data simplified scheme of each image for each type of image; The density calculating unit is used for calculating the selected density of any position in the data simplifying schemes according to all the data simplifying schemes; the position reservation unit is used for reserving positions with selected densities reaching a preset density threshold value, creating a position matrix as a comprehensive simplification scheme, wherein reserved positions are set as ones, and unreserved positions are set as zeros; Wherein, the density threshold is externally connected with an adjusting port; the content for allocating resources to the reasoning clusters according to the demand scores comprises the following steps of: reading a comprehensive simplification scheme for each type of image; calculating the ratio of the number of the positions which is one in the comprehensive simplified scheme to all the number of the positions, and determining a demand score according to the ratio; and counting the demand scores of all types of images, and distributing resources to the reasoning clusters according to the demand scores.
- 5. The low-latency distributed inference cluster optimization system of claim 4, wherein the image organization modeling block comprises: the image sequence construction unit is used for reading the processed images within a preset time range and constructing an image sequence; The data volume acquisition unit is used for acquiring the size and the type of each image, determining the data volume of the images and obtaining a data volume sequence; the interval segmentation unit is used for reading the maximum value and the minimum value in the data volume sequence, determining a data volume interval, and segmenting the data volume interval according to a preset data volume step length to obtain a subinterval; The data quantity statistics unit is used for counting the data quantity in the data quantity sequence according to the subintervals and determining the number of elements in each subinterval; The probability assignment unit is used for determining the selection probability of each subinterval according to the number of the elements and carrying out probability assignment on each element in the data quantity sequence; And the probability application unit is used for sequentially judging whether the images are read according to the assigned probabilities, and taking the read images as a sample image group.
Description
Low-delay distributed reasoning cluster optimization method and system Technical Field The invention relates to the technical field of cluster optimization, in particular to a low-delay distributed reasoning cluster optimization method and system. Background The reasoning cluster is a computing platform formed by a plurality of computer devices, wherein a data processing model is built in the computer devices and is used for coping with data processing requirements, for example, when data to be processed is a picture, the plurality of computer devices are GPUs, the data processing model is a picture processing model, and when the picture processing requirements are met, the data processing model is processed by means of the reasoning cluster. The processing process relates to a task distribution process, the existing task distribution process mainly adopts a sequential distribution process, when pictures are received, GPUs are sequentially selected according to the sequence to process the pictures, the scheme is clear in logic and convenient to operate, but the distribution process does not consider image differences, so that the stability of the processing process of each GPU is not high, and therefore, how to provide the task distribution process based on the images per se, and the purpose of extracting the stability of the GPU processing process is the technical problem to be solved by the technical scheme of the invention. Disclosure of Invention The invention aims to provide a low-delay distributed reasoning cluster optimization method and system, which are used for solving the problems in the background technology. In order to achieve the above purpose, the present invention provides the following technical solutions: A low-delay distributed reasoning cluster optimization method and system, the method includes: reading processed images within a preset time range, screening the processed images, and constructing a sample image group; Sequentially carrying out data simplification on each image in the sample image group, calculating data fidelity, and determining a data simplification scheme of each image according to the data fidelity; clustering the images, identifying the data simplification scheme of each type of image, and determining the comprehensive simplification scheme of each type of image; For each type of image, determining a demand score according to the comprehensive simplification scheme, and distributing resources to the reasoning clusters according to the demand score; when a new image is received, matching the corresponding image, inquiring the comprehensive simplification scheme of the image, simplifying the image, and synchronously distributing the simplified image to the corresponding resource of the image. The invention further provides a method for reading processed images within a preset time range, screening the processed images and constructing a sample image group, wherein the method comprises the following steps: reading processed images within a preset time range, and constructing an image sequence; acquiring the size and the type of each image, determining the data quantity of the images, and obtaining a data quantity sequence; Reading the maximum value and the minimum value in the data volume sequence, determining a data volume interval, and segmenting the data volume interval according to a preset data volume step length to obtain a subinterval; Counting the data quantity in the data quantity sequence according to the subintervals, and determining the number of elements in each subinterval; determining the selection probability of each subinterval according to the number of the elements, and carrying out probability assignment on each element in the data quantity sequence; and sequentially judging whether to read the images according to the assigned probabilities, and taking the read images as a sample image group. The invention further provides a method for simplifying data of each image in a sample image group in turn, calculating data fidelity, and determining the data simplifying scheme of each image according to the data fidelity, wherein the method comprises the following steps: sequentially reading images in a sample image group; performing Fourier transform on the image to obtain a frequency domain diagram and a phase diagram; creating a circular area based on an origin in the frequency domain diagram, wherein the radius of the circular area is that the average value of pixel values in the circular area is not smaller than a preset average value threshold value; randomly selecting a preset number of points in the non-reference reserved area to serve as a random reserved area, and performing cyclic execution to obtain a preset number of random reserved areas; Carrying out inverse Fourier transform on the frequency domain image and the phase image according to the reference reserved area and the random reserved area to obtain a restored image; Comparing the restored