A parallel scheduling system for peak memory resources
By constructing a chaos model of memory resources and an artificial immune algorithm, the problem of insufficient prediction ability and uneven resource utilization in memory resource scheduling in the existing technology is solved, and more efficient resource scheduling and system performance optimization are achieved.
Patent Information
- Application Number
- CN202410578568.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-05-11
AI Technical Summary
Existing memory resource scheduling methods lack the ability to predict future resource demand trends, resulting in lag in system response. Traditional scheduling algorithms only consider a single factor and are difficult to achieve balanced utilization of resources, resulting in long task waiting times and reduced system throughput.
The chaos building module is used to build the memory resource data model, and the chaotic attractor model is used to predict the future state. The system entropy index and artificial immunity algorithm are combined to generate the optimal scheduling strategy, taking into account the system state and task characteristics.
It improves the prediction ability and stability of the system, achieves balanced utilization of resources, quickly searches for the optimal scheduling strategy, and improves system throughput and user experience.
Smart Images

Figure CN118152143B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of resource allocation, and more specifically, to a memory resource peak parallel scheduling system. Background Art
[0002] The patent with application publication number CN102567107A discloses a highly parallel real-time memory resource management scheduling method, including an initialization step, a memory management module allocates a specified amount of memory as a management heap, and divides the memory into multiple memory blocks, the memory management module establishes a mapping module, a memory management step, when a thread with dynamic memory management requirements is added to the memory management module, the mapping module is responsible for creating a local heap for the current thread and maintaining the correspondence between the local heap and the current thread, a dynamic memory allocation step, after processing the business logic of the current thread, returning the memory of the current thread and terminating the current thread, solving the bottleneck problem of concurrent memory resource scheduling on modern multi-core high-end business servers, allowing traditional application systems to fully explore the hardware resource potential of modern computers without any code changes, and greatly improving the real-time operation efficiency of software systems.
[0003] However, existing memory resource scheduling methods lack the ability to predict future trends in resource demand changes, making it difficult to make scheduling decisions in advance, resulting in delayed system response, poor predictive ability and stability. Secondly, traditional scheduling algorithms often only consider a single factor, such as task priority, resource utilization, etc., and lack comprehensive consideration of the overall state of the system. This local or static scheduling strategy is likely to cause problems such as unbalanced resource utilization and long task waiting time, and cannot achieve global optimization. Most existing scheduling algorithms use heuristic search or rule matching to generate scheduling strategies, with low search efficiency and slow convergence speed. It is difficult to quickly respond to dynamically changing resource environments and lacks robustness. For peak memory resource competition, existing methods are often first-come-first-served or priority scheduling, which is likely to cause task blocking, reduced system throughput, poor user experience, and other problems, and cannot achieve balanced resource utilization.
[0004] In view of this, the present invention proposes a memory resource peak parallel scheduling system to solve the above problem. Summary of the invention
[0005] In order to overcome the above defects of the prior art and to achieve the above objectives, the present invention provides the following technical solutions: A memory resource peak parallel scheduling system, comprising: a chaos construction module, for collecting memory resource data and constructing a chaotic system model according to the memory resource data;
[0006] An index determination module is used to construct a chaotic attractor model to make a chaotic prediction of the future state of the chaotic system model and calculate the chaotic uncertainty index;
[0007] The system entropy module is used to calculate the current utilization rate of the memory resource data, and calculate the system entropy index based on the current utilization rate of the memory resource data and the chaos uncertainty index;
[0008] The simulated immune module is used to obtain the data of the tasks to be scheduled, and output the optimal scheduling strategy based on the system entropy index and the data of the tasks to be scheduled using the task scheduling algorithm based on artificial immunity. The modules are connected by wired and / or wireless means.
[0009] Furthermore, the memory resource data includes CPU usage data, memory usage data and storage data;
[0010] CPU usage data includes CPU load and CPU waiting time, memory usage data includes memory availability and memory allocation rate, and storage data includes disk I / O rate and disk usage rate;
[0011] The memory resource data is collected by setting a data collection agent or probe monitoring, and defining the data collection interval of the data collection agent or probe monitoring;
[0012] The method of constructing the chaotic system model includes:
[0013] Clean and standardize the collected memory resource data, and align the memory resource data of different time scales so that they have the same time interval;
[0014] Define the dynamic equation of the chaotic system model, the dynamic equation is: ;in, For CPU usage data, For memory usage data, To store data, is the time variable, , and These are the target parameters that need to be fitted;
[0015] Define the objective function of the chaotic system model ;
[0016] ,in, Indicates at time CPU usage data at the moment The value of Indicates at time Memory usage data at the moment The value of Indicates at time Storage data at the moment The value of Represents the CPU usage data observed by the chaotic system model In time The value of Represents the memory usage data observed by the chaotic system model In time The value of Represents the stored data observed by the chaotic system model In time The value of
[0017] According to the objective function, the genetic algorithm is used to solve the target parameters to be fitted, and the obtained target parameters to be fitted are substituted into the dynamic equation. , and Perform numerical simulation to obtain simulation results, and calculate the root mean square error between the simulation results and the real-time observation data. If the value of the root mean square error does not decrease for p consecutive times, the chaotic system model is completed.
[0018] Furthermore, the method of solving and obtaining the target parameters to be fitted includes:
[0019] Encode the target parameter to be fitted into a chromosome, define the population size N of the genetic algorithm, and randomly generate chromosomes of N individuals as the initial population;
[0020] The fitness function of the population is defined as the objective function of the chaotic system model. For each individual in the population, the parameter value corresponding to the chromosome encoded by it is used to solve the dynamic equation , and , and calculate the value of the fitness function, i.e., the fitness;
[0021] According to the fitness, the tournament selection operator is used to select C individuals from the current population as the parent generation. According to the crossover probability, two individuals are randomly selected from the parent generation for uniform crossover operation to generate new individuals, i.e., the offspring.
[0022] The individuals generated by the uniform crossover operation are merged with the individuals in the parent generation whose fitness is greater than the preset fitness threshold to form a new population;
[0023] If the preset upper limit of iterations is not reached, the selection and uniform crossover operations will continue. When the upper limit of iterations is reached, the target parameters to be fitted corresponding to the individual with the highest fitness in the current population will be output.
[0024] Furthermore, the method of selecting C individuals includes:
[0025] Set the tournament size k, set the number of parent individuals C, randomly select k individuals from the current population, calculate the fitness of these k individuals, and find the individual Pwin with the highest fitness as the parent.
[0026] The method of performing the uniform crossover operation includes:
[0027] Step 1: Randomly select two individuals from the parent generation as the parents P1 and P2. The length of the chromosomes of P1 and P2 is L, and P1 and P2 are encoded as real numbers, then P1=[p11, p12, ..., p1L], P2=[p21, p22, ..., p2L];
[0028] Step 2: Create a 01 mask vector mask=[m1, m2, ..., mL] of length L. For each bit in the 01 mask vector mask, generate 0 or 1 with a crossover probability pc.
[0029] Step 3. According to the 01 mask vector mask, copy the corresponding gene positions of P1 and P2 to the offspring C1 and C2. For the i-th gene position, if mi=1, then c1i=p1i, c2i=p2i; if mi=0, then c1i=p2i, c2i=p1i. Then two new offspring individuals C1 and C2 are generated, C1=[c11, c12, ..., c1L], C2=[c21, c22, ..., c2L]. Repeat steps 1-3 until all C individuals are used up.
[0030] Furthermore, the method of constructing the chaotic attractor model includes:
[0031] Using the time-delay coordinate method, the chaotic system model is mapped to dimensional phase space, that is, constructing the time delay vector of the state variable ,in, For delay, The attractor of the chaotic system model in the dimensional phase space is denoted by ;
[0032] exist A reference point is randomly selected in the dimensional phase space , which is the current state, and lie in Calculate all other trajectory points With reference point Distance , find the closest point, which is the reference point of nearest neighbor points;
[0033] according to The invariant measure of the attractor is obtained by using the local nearest neighbor method or the point distance statistics method;
[0034] According to the invariant measure of the attractor, the attractor is analyzed using the wavelet basis function. After parameter fitting, the model obtained is the chaotic attractor model;
[0035] The method of performing parameterized fitting includes:
[0036] Define Daubechies wavelet as wavelet basis and determine the order of wavelet basis. In the dimensional phase space, according to the defined wavelet basis and its order, the wavelet basis function is constructed ,in, A variable representing the input signal, is the displacement parameter, is a set of high-pass filter coefficients, represents the scaling function;
[0037] Using wavelet basis functions to find attractors exist The set of trajectory points in the dimensional phase space is decomposed by wavelet to obtain the wavelet component coefficients at each scale;
[0038] The wavelet component coefficients at each scale are used as parameters to fit the function form of the model ,in, is the wavelet component coefficient obtained by wavelet decomposition, indicating that the signal is The scale and The size of the component under displacement, The scale is , displacement is The scaling function of the chaotic attractor model is constructed.
[0039] Furthermore, the method for performing chaos prediction includes:
[0040] exist In the dimensional phase space, the current state Located at the attractor On the other hand, using the constructed chaotic attractor model, we can determine The manifold structure of the attractor where it is located constrains In the future movement trajectory, in finding After finding the nearest neighbor point, the chaotic attractor model is used to consider only the trajectory points where the subsequent trajectory of the nearest neighbor point is located on the manifold structure of the same attractor, and these trajectory points are locally linearly fitted to obtain the prediction equation;
[0041] The expression of the prediction equation is: ,in, Indicates at time The predicted state vector is the prediction result obtained by local linear fitting. , to is the regression coefficient, is the prediction time step, is the degree of the polynomial;
[0042] Map the trajectory predicted by the prediction equation based on the chaotic attractor model constraints back to the original state space to obtain the future state prediction distribution sequence;
[0043] The calculation method of the chaos uncertainty index includes:
[0044] Select the initial moment from the predicted future state distribution sequence Status point ,exist Construct a hypersphere nearby , the radius of the hypersphere is , using the prediction equation, the hypersphere Evolving to subsequent moments, in time After that, the hypersphere will be stretched into a ribbon structure, and the length of the ribbon structure is obtained. and width , based on the length of the ribbon structure and width Chaos uncertainty index .
[0045] Furthermore, the current utilization rate of the memory resource data is calculated in the following manner:
[0046] The current utilization of CPU usage data ,in, For CPU load, is the unit time, It is the CPU waiting time;
[0047] Current utilization of memory usage data ,in, is the memory availability, is the memory allocation rate;
[0048] Current utilization of stored data ,in, is the disk usage, is the disk I / O rate, It is an empirical coefficient used to control the influence of disk I / O rate on storage utilization and is obtained through least squares fitting.
[0049] The current utilization of the CPU usage data, the current utilization of the memory usage data, and the current utilization of the storage data are averaged to obtain the current utilization of the memory resource data.
[0050] The system entropy index ,in, is the current utilization of memory resource data, is the weight coefficient.
[0051] Furthermore, the task data to be scheduled includes task resource requirements, task priority, task execution time, task dependency, task submission time and task type. Task resource requirements include CPU requirements, memory requirements and storage requirements. Task priority includes high priority tasks, medium priority tasks and low priority tasks. Task dependencies include predecessor tasks, successor tasks and parallel tasks. Task types include batch tasks, service tasks, data processing tasks, compute-intensive tasks and I / O-intensive tasks.
[0052] Furthermore, the method of outputting the optimal scheduling strategy includes:
[0053] The task data to be scheduled is encoded into a task antigen vector as the input of the artificial immune algorithm. The task scheduling algorithm initializes an antibody population, which contains U antibodies. Each antibody represents a scheduling strategy, and the antibody is encoded as a permutation vector.
[0054] Define the goodness function of the task scheduling algorithm ;
[0055] ,in, is the maximum resource peak value, is the total resource capacity, For the The task priority of each task, For the The task execution time of each task, is the average waiting time, is the resource utilization efficiency weight parameter, is the priority weight parameter, is the waiting time weight parameter, is the weight parameter of the entropy index penalty term, and ;
[0056] Average waiting time , where For the The completion time of a task, For the The submission time of the task, is the total number of tasks;
[0057] Calculate the function value of the merit function of each antibody in the antibody population, and add them up to get the total merit of the antibody population. Calculate the probability pi of each antibody being selected to enter the next generation antibody population, that is, the function value of the antibody merit function divided by the total merit. Perform M selections, and randomly select an antibody each time with probability pi. The selected antibody will be added to the next generation antibody population to obtain a new generation antibody population.
[0058] The new generation antibody population is mapped and crossed to obtain a new second generation antibody population. The new second generation antibody population is mutated to obtain a final antibody population. The function value of the merit function of each antibody in the final antibody population is calculated, and the scheduling strategy corresponding to the antibody with the highest function value of the merit function is taken as the optimal scheduling strategy.
[0059] Furthermore, the method of performing the mapping cross operation includes:
[0060] Step 101, randomly selecting two antibodies from the new generation antibody population as mapping cross objects, denoted as Parent1 and Parent2, and randomly selecting two different cutting points to divide Parent1 and Parent2 into three parts;
[0061] Step 102, exchanging the middle parts of the two antibodies to obtain temporary offspring Offspring 1 and Offspring 2;
[0062] Step 103: For the repeated parts in the temporary offspring, repair them according to the rules of partial mapping to obtain the repaired Offspring1 and Offspring2, and finally obtain offspring antibodies without repeated parts, and add Offspring1 and Offspring2 to the next generation population;
[0063] Perform steps 101 to 103 on all antibodies in the new generation antibody population, thereby obtaining a new second generation antibody population;
[0064] The method of performing the mutation operation includes:
[0065] Step 201: Define the mutation rate of the mutation operation , determine whether to mutate the antibodies in the new second-generation antibody population based on the mutation rate, and randomly generate a number rand in the interval [0, 1]. If rand is greater than , then the antibody is mutated, otherwise the antibody is kept unchanged;
[0066] Step 202: If mutation is to be performed, randomly select insertion mutation or exchange mutation, randomly generate a number rand2 in the interval [0, 1], and if rand2 is greater than 0.5, perform insertion mutation, otherwise perform exchange mutation;
[0067] The method of performing insertion mutation includes:
[0068] Randomly select positions u1 and u2 of two different genes in the antibody, where u1 is greater than or equal to 1 and u2 is less than or equal to the total length of the antibody. Temporarily save the gene at position u1, move the genes at position u2 and behind it as a whole one position toward u1, and insert the temporarily saved gene into position u2.
[0069] The method of performing the exchange mutation is: randomly selecting positions u1 and u2 of two different genes, where u1 is greater than or equal to 1 and u2 is less than or equal to the total length of the antibody, and exchanging the two genes at positions u1 and u2;
[0070] Step 203: Generate new antibodies and add them to the next generation population. Perform steps 201-202 on all antibodies in the new second generation antibody population to obtain the final antibody population.
[0071] The technical effects and advantages of a memory resource peak parallel scheduling system of the present invention are as follows:
[0072] The present invention constructs a prediction model for memory resource data through chaos theory, which can dynamically perceive changes in resource demand in the future, provide predictive guidance for scheduling decisions, and improve the prediction ability and stability of the system. Secondly, the generated scheduling strategy can comprehensively consider multiple factors such as the system's orderliness, resource utilization, and task characteristics, avoiding resource waste caused by local or static scheduling, and achieving a more globally optimal scheduling. Thirdly, it can quickly search for the optimal scheduling strategy, with better convergence speed and robustness. In addition, it can balance resource allocation, reduce resource contention during peak hours, improve system throughput, alleviate congestion, and improve user experience. While improving the system's predictability, adaptability, and robustness, it achieves balanced optimization of resource utilization and task performance. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 A schematic diagram of a memory resource peak parallel scheduling system of the present invention;
[0074] Figure 2 A schematic diagram of a method for parallel scheduling of memory resources at peak times according to the present invention. DETAILED DESCRIPTION
[0075] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0076] Example 1
[0077] See also Figure 1 As shown, the memory resource peak parallel scheduling system described in this embodiment includes:
[0078] A chaos building module is used to collect memory resource data and build a chaotic system model based on the memory resource data;
[0079] An index determination module is used to construct a chaotic attractor model to make a chaotic prediction of the future state of the chaotic system model and calculate the chaotic uncertainty index;
[0080] The system entropy module is used to calculate the current utilization rate of the memory resource data, and calculate the system entropy index based on the current utilization rate of the memory resource data and the chaos uncertainty index;
[0081] The simulated immune module is used to obtain the data of the tasks to be scheduled, and output the optimal scheduling strategy based on the system entropy index and the data of the tasks to be scheduled using the task scheduling algorithm based on artificial immunity. The modules are connected by wired and / or wireless means to realize data transmission between modules.
[0082] Furthermore, the memory resource data includes CPU usage data, memory usage data and storage data;
[0083] CPU usage data includes CPU load and CPU waiting time, memory usage data includes memory availability and memory allocation rate, and storage data includes disk I / O rate and disk usage rate;
[0084] The memory resource data is collected by setting a data collection agent or probe monitoring, and defining the data collection interval (for example, 1 minute, 1 hour) of the data collection agent or probe monitoring.
[0085] Furthermore, the method of constructing the chaotic system model includes:
[0086] Clean and standardize the collected memory resource data, eliminate outliers and noise data, and align the memory resource data of different time scales so that the data have the same time interval;
[0087] Define the dynamic equation of the chaotic system model, the dynamic equation is: ,in, For CPU usage data, For memory usage data, To store data, is the time variable, , and These are the target parameters that need to be fitted;
[0088] Define the objective function of the chaotic system model ;
[0089] ,in, Indicates at time CPU usage data at the moment The value of Indicates at time Memory usage data at the moment The value of Indicates at time Storage data at the moment The value of Represents the CPU usage data observed by the chaotic system model In time The value of Represents the memory usage data observed by the chaotic system model In time The value of Represents the stored data observed by the chaotic system model In time The value of .
[0090] According to the objective function, the genetic algorithm is used to solve the target parameters to be fitted, and the obtained target parameters to be fitted are substituted into the dynamic equation. , and Perform numerical simulation to obtain simulation results; calculate the root mean square error between the simulation results and the real-time observation data. If the value of the root mean square error does not decrease for p consecutive times, the chaotic system model is completed. In this process, the value of the target parameter to be fitted needs to be continuously adjusted.
[0091] The method of solving and obtaining the target parameters to be fitted includes:
[0092] Encode the target parameters to be fitted as a chromosome, for example, ,The encoding method is determined according to the range of the parameter, for example, binary encoding or real number encoding;
[0093] Define the population size N of the genetic algorithm, usually between 50 and 200, and randomly generate N chromosomes as the initial population;
[0094] The fitness function of the population is defined as the objective function of the chaotic system model. For each individual in the population, the parameter value corresponding to the chromosome encoded by it is used to solve the dynamic equation , and , and calculate the value of the fitness function, that is, the fitness. The smaller the fitness, the better the individual;
[0095] Based on the fitness size, the tournament selection operator is used to select from the current population as the parent.
[0096] The method of selecting C individuals includes:
[0097] Set the tournament size k to control the number of individuals selected in each competition. It is usually a value between 2 and 5. The larger the k value, the greater the selection pressure, and it is easier to converge to the local optimum. The smaller the k value, the smaller the selection pressure, and it can better maintain population diversity. Set the number of parent individuals C. The number of parent individuals C is usually about half of the population size N.
[0098] Randomly select k individuals from the current population, calculate the fitness of these k individuals, and find the individual Pwin with the highest fitness as the parent.
[0099] For example, assuming the population size N=10 and the tournament size k=3, C=5 parent individuals need to be selected. Three individuals are randomly selected from the population, for example, P1, P2 and P3, and their fitness f(P1), f(P2) and f(P3) are calculated. Assuming f(P2) is the largest, P2 is selected as the first parent individual. Three individuals are randomly selected from the population again, for example, P4, P5 and P6, and the fitness is calculated. The largest one is selected as the second parent individual. The above process is repeated until five parent individuals are selected. For the remaining five individuals, the parent individuals are directly copied to generate offspring, and different copy probabilities are assigned according to the fitness value.
[0100] According to the crossover probability, two individuals are randomly selected from the parent generation for uniform crossover operation to generate new individuals, namely the offspring.
[0101] The method of performing the uniform crossover operation includes:
[0102] Step 1: Randomly select two individuals from the parent generation as the parents P1 and P2. The length of the chromosomes of P1 and P2 is L, and P1 and P2 are encoded as real numbers, then P1=[p11, p12, ..., p1L], P2=[p21, p22, ..., p2L];
[0103] Step 2: Create a 01 mask vector mask=[m1, m2, ..., mL] of length L. For each bit in the 01 mask vector mask, generate 0 or 1 with a crossover probability pc, usually using random numbers.
[0104] Step 3. According to the 01 mask vector mask, copy the corresponding gene positions of P1 and P2 to the offspring C1 and C2. For the i-th gene position, if mi=1, then c1i=p1i, c2i=p2i. If mi=0, then c1i=p2i, c2i=p1i. In this way, two new offspring individuals C1 and C2 are generated. C1=[c11, c12, ..., c1L], C2=[c21, c22, ..., c2L]. Repeat steps 1-3 until all C individuals are used up.
[0105] By adjusting the crossover probability pc, the similarity between the new individual and the parent individual is controlled. Generally speaking, a value of pc between 0.5 and 0.9 is appropriate.
[0106] The individuals generated by the uniform crossover operation are merged with the individuals in the parent generation whose fitness is greater than the preset fitness threshold to form a new population;
[0107] If the preset upper limit of iterations is not reached, the selection and uniform crossover operations will continue. When the upper limit of iterations is reached, the target parameters to be fitted corresponding to the individual with the highest fitness in the current population will be output.
[0108] Furthermore, the method of constructing the chaotic attractor model includes:
[0109] Using the time-delay coordinate method, the chaotic system model is mapped to dimensional phase space, that is, constructing the time delay vector of the state variable ,in, For delay.
[0110] exist The attractor of the chaotic system model in the dimensional phase space is its asymptotically invariant set, denoted by , the attractor refers to the invariant set that the system tends to after a long period of evolution.
[0111] Specifically, the chaotic system model is a nonlinear dynamic system, whose state evolves over time following certain rules or equations. For given initial conditions, the system state will evolve along a specific trajectory in the state space (phase space). After a period of time, the trajectory will tend to converge to a limited area instead of converging indefinitely. This limited area is called the attractor of the system model. The attractor represents the invariant properties and long-term behavior patterns of the system model. The attractor is a closed curve that reflects the complex dynamic behavior of the system.
[0112] exist A reference point is randomly selected in the dimensional phase space , which is the current state, and lie in Calculate all other trajectory points With reference point Distance , find the closest point, which is the reference point of The trajectory point refers to the state point of the chaotic system model that evolves over time in the phase space. Specifically, the chaotic system is usually described by a set of differential equations or difference equations, and its state is determined by multiple variables. By mapping these state variables to different coordinate axes of the phase space, the current state of the system can be represented as a point in the phase space. As time goes by, the system state will change according to the given dynamic rules, which corresponds to new state points in the phase space. Connecting these discrete state points in chronological order forms the trajectory of the system in the phase space. Therefore, each point on the trajectory corresponds to the state of the system at a certain moment, which is called a trajectory point.
[0113] according to The invariant metric of the attractor is obtained by using the local nearest neighbor method or the point distance statistics method. The invariant metric refers to a probability distribution function on the attractor, which describes the distribution density of the trajectory points on the attractor. The invariant metric reflects the geometric structure characteristics of the attractor, such as fractal dimension, entropy value, etc.
[0114] The method of performing parameterized fitting includes:
[0115] Define Daubechies wavelet as wavelet basis and determine the order of wavelet basis. The order of wavelet basis function determines their regularity and approximation accuracy. The higher the order, the stronger the description ability of high-frequency components, but the higher the computational complexity.
[0116] exist In the dimensional phase space, according to the defined wavelet basis and its order, the wavelet basis function is constructed ,in, A variable representing the input signal, is the displacement parameter, which controls the movement of the wavelet function in time or space. is a set of high-pass filter coefficients that are used to generate the wavelet function, represents the scaling function.
[0117] Using wavelet basis functions to find attractors exist The set of trajectory points in the dimensional phase space is decomposed by wavelet to obtain the wavelet component coefficients at each scale.
[0118] The wavelet component coefficients at each scale are used as parameters to fit the function form of the model ,in, is the wavelet component coefficient obtained by wavelet decomposition, indicating that the signal is The scale and The size of the component under displacement, The scale is , displacement is The scaling function is used to reconstruct the low-frequency component of the function, thus completing the construction of the chaotic attractor model.
[0119] Furthermore, the method for performing chaos prediction includes:
[0120] exist In the dimensional phase space, the current state Located at the attractor On the other hand, using the constructed chaotic attractor model, we can determine The manifold structure of the attractor where it is located constrains In the future movement trajectory, in finding After finding the nearest neighbor points, the chaotic attractor model is used to consider only the trajectory points whose subsequent trajectories are located on the manifold structure of the same attractor, and local linear fitting is performed on these trajectory points to obtain the prediction equation.
[0121] The expression of the prediction equation is: ,in, Indicates at time The predicted state vector is the prediction result obtained by local linear fitting. , to Is the regression coefficient, estimated by the least squares method. The regression coefficient is used to represent the curve of local linear fitting. The regression coefficient determines the shape and trend of the fitting curve. is the time step of the prediction, expressed relative to the current time The offset of is the degree of the polynomial.
[0122] The trajectory predicted by the prediction equation based on the constraints of the chaotic attractor model is mapped back to the original state space to obtain the predicted distribution sequence of future states that conforms to the intrinsic dynamics of the chaotic system model.
[0123] It should be noted that by using the chaotic attractor model to constrain the prediction process, it can ensure that the prediction trajectory conforms to the long-term invariant manifold structure of the system, thereby improving the accuracy and rationality of the prediction. The chaotic attractor model plays a key role in capturing the intrinsic essential dynamics of the system.
[0124] Furthermore, the calculation method of the chaos uncertainty index includes:
[0125] Select the initial moment from the predicted future state distribution sequence Status point ,exist Construct a hypersphere nearby , the radius of the hypersphere is , using the prediction equation, the hypersphere Evolving to subsequent moments, in time Afterwards, due to the distortion of the attractor manifold, the hypersphere will be stretched into a ribbon structure, and the length of the ribbon structure is obtained. and width ,length Reflects the sensitivity, width It reflects the degree of convergence.
[0126] It should be explained that the construction methods of the hypersphere include:
[0127] First, an initial state point is selected in the phase space as the center of the sphere. This point can be a point in the predicted future state distribution sequence. The dimension of the phase space where the state point is located determines the dimension of the hypersphere to be constructed. For example, if the phase space is three-dimensional, a three-dimensional sphere is constructed, and a small positive number pw is set as the radius of the hypersphere. The size of the radius pw depends on the scale to be studied. It is usually a sufficiently small value. A hypersphere with pw as the radius is constructed around the center state point. This hypersphere contains all state points in a small neighborhood centered on the point.
[0128] Based on the length of the ribbon structure and width The chaos uncertainty index is calculated. .
[0129] The chaos uncertainty index reflects the time-dependent uncertainty of the chaotic system model. The ratio of the expansion in different directions is If it is positive, it means that the chaotic system model is chaotic and the uncertainty will increase exponentially with time. is negative, indicating that the chaotic system model is periodic or quasi-periodic. The size of reflects the degree of chaos in the system. The larger the value, the stronger the chaos. Using the predicted distribution of future states obtained from the attractor manifold, the chaos uncertainty index is defined and calculated. This index can well quantify and describe the chaotic characteristics of the system and provide a basis for decision-making such as task scheduling.
[0130] Furthermore, the current utilization rate of the memory resource data is calculated by:
[0131] The current utilization of CPU usage data ,in, For CPU load, is the unit time, It is the CPU waiting time;
[0132] Current utilization of memory usage data ,in, is the memory availability, Memory allocation rate.
[0133] Current utilization of stored data ,in, is the disk usage, is the disk I / O rate, It is an empirical coefficient used to control the impact of disk I / O rate on storage utilization and is obtained through least squares fitting.
[0134] The current utilization of the CPU utilization data, the current utilization of the memory utilization data, and the current utilization of the storage data are averaged to obtain the current utilization of the memory resource data.
[0135] System entropy index ,in, is the current utilization of memory resource data, is the weight coefficient, which is used to adjust the influence of the current utilization rate of memory resource data and the chaos uncertainty index on the system entropy index. When the current utilization rate of memory resource data is high and the uncertainty of future state is large, the system entropy index will be high, indicating that the system is more chaotic.
[0136] Furthermore, the data of the tasks to be scheduled include task resource requirements, task priority, task execution time, task dependency, task submission time and task type. The task resource requirements include CPU requirements, memory requirements and storage requirements, all of which are percentage values, for example, the required memory is 20%, etc. Task priorities include high priority tasks, medium priority tasks and low priority tasks, which are represented by encoding or numerical values, for example, low priority tasks are 1, and high priority tasks are 3. Task dependencies include predecessor tasks, successor tasks and parallel tasks. Task types include batch tasks, service tasks, data processing tasks, compute-intensive tasks and I / O-intensive tasks, all of which are replaced by numerical values to facilitate subsequent algorithm input and output.
[0137] Furthermore, the methods for outputting the optimal scheduling strategy include:
[0138] The task data to be scheduled is encoded into a task antigen vector as the input of the artificial immune algorithm. The task antigen vector = (CPU requirement, memory requirement, storage requirement, task priority, task execution time, task dependency, task submission time, task type).
[0139] The task scheduling algorithm initializes an antibody population, which contains U antibodies. Each antibody represents a scheduling strategy. The antibody is encoded as a permutation vector, which indicates the execution order of the task.
[0140] Define the goodness function of the task scheduling algorithm ;
[0141] ,in, is the maximum resource peak value, is the total resource capacity, For the The task priority of each task, For the The task execution time of each task, is the average waiting time, is the resource utilization efficiency weight parameter, is the priority weight parameter, is the waiting time weight parameter, is the weight parameter of the entropy index penalty term, and , the weight parameters are obtained by fitting experimental data multiple times.
[0142] Average waiting time , where For the The completion time of a task, For the The submission time of each task; is the total number of tasks.
[0143] The merit function reflects that when the resource utilization efficiency is high, the priority weight is high, the average waiting time is short, and the system entropy index is low, the value of the merit function will be higher and the adopted strategy will be preferred.
[0144] Calculate the function value of the merit function of each antibody in the antibody population, and add them up to get the total merit of the antibody population. Calculate the probability pi of each antibody being selected to enter the next generation antibody population, that is, the function value of the antibody merit function divided by the total merit. Perform M selections, and randomly select an antibody each time with probability pi. The selected antibody will be added to the next generation antibody population to obtain a new generation antibody population.
[0145] The new generation antibody population is mapped and crossed to obtain a new second generation antibody population. The new second generation antibody population is mutated to obtain a final antibody population. The function value of the merit function of each antibody in the final antibody population is calculated, and the scheduling strategy corresponding to the antibody with the highest function value of the merit function is taken as the optimal scheduling strategy.
[0146] The method of performing the mapping cross operation includes:
[0147] Step 101, randomly select two antibodies from the new generation antibody population as mapping cross objects, denoted as Parent1 and Parent2, and randomly select two different cutting points to divide Parent1 and Parent2 into three parts, for example: Parent1 is [1|5 2 7|4 6 3], and Parent2 is [6|3 5 1|2 4 7];
[0148] Step 102: exchange the middle parts of the two antibodies to obtain temporary offspring Offspring 1 and Offspring 2. For example, Offspring 1 is [1|3 5 1|4 6 3], and Offspring 2 is [6|2 7 6|2 4 7];
[0149] Step 103: For the repeated parts in the temporary offspring, repair them according to the rules of partial mapping. For example, in Offspring1, 5 and 1 appear repeatedly, then check their position indexes in Parent2. The position index of 5 in Parent2 is 2, and the position index of 1 in Parent2 is 3. Exchange the genes at positions 2 and 3 in Offspring1, that is, the repaired Offspring1 is [1|1 3 5|4 6 3];
[0150] Similarly, the repeated part in Offspring2 is repaired to finally obtain a progeny antibody without repeated parts, and Offspring1 and Offspring2 are added to the next generation population. All antibodies in the new generation antibody population are subjected to steps 101 to 103 to obtain a new second generation antibody population.
[0151] Keeping some of the ordered gene segments unchanged while introducing new combinations in the middle helps maintain the diversity and search ability of the antibody population.
[0152] The method of performing the mutation operation includes:
[0153] Step 201: Define the mutation rate of the mutation operation , determine whether to mutate the antibodies in the new second-generation antibody population based on the mutation rate, and randomly generate a number rand in the interval [0, 1]. If rand is greater than , then the antibody is mutated, otherwise the antibody is retained unchanged.
[0154] Step 202: If mutation is to be performed, insert mutation or exchange mutation is randomly selected, and a number rand2 in the interval [0, 1] is randomly generated. If rand2 is greater than 0.5, insert mutation is performed, otherwise exchange mutation is performed.
[0155] The method of performing insertion mutation includes:
[0156] Randomly select positions u1 and u2 of two different genes in the antibody, with u1 greater than or equal to 1 and u2 less than or equal to the total length of the antibody, temporarily save the gene at position u1, move the genes at position u2 and behind it as a whole one position toward u1, and insert the temporarily saved gene into position u2.
[0157] The method of performing the exchange mutation is: randomly selecting positions u1 and u2 of two different genes, where u1 is greater than or equal to 1 and u2 is less than or equal to the total length of the antibody, and exchanging the two genes at positions u1 and u2.
[0158] Step 203: Generate new antibodies and add them to the next generation population. Perform steps 201-202 on all antibodies in the new second generation antibody population to obtain the final antibody population.
[0159] In this embodiment, a prediction model for memory resource data is constructed through chaos theory, which can dynamically perceive changes in resource demand in the future, provide predictive guidance for scheduling decisions, and improve the prediction ability and stability of the system. Secondly, the generated scheduling strategy can comprehensively consider multiple factors such as the system's orderliness, resource utilization, and task characteristics, avoiding resource waste caused by local or static scheduling, and achieving a more globally optimal scheduling. Thirdly, it can quickly search for the optimal scheduling strategy, with better convergence speed and robustness. In addition, it can balance resource allocation, reduce resource contention during peak hours, improve system throughput, alleviate congestion, and improve user experience. While improving the system's predictability, adaptability, and robustness, it achieves balanced optimization of resource utilization and task performance.
[0160] Example 2
[0161] See also Figure 2 As shown, the part not described in detail in this embodiment is described in Example 1, which provides a method for parallel scheduling of memory resources at peak times, including:
[0162] S1, collect memory resource data, and build a chaotic system model based on the memory resource data;
[0163] S2, constructing a chaos attractor model to make chaos predictions on the future state of the chaotic system model, and calculating the chaos uncertainty index;
[0164] S3, calculating the current utilization rate of the memory resource data, and calculating the system entropy index based on the current utilization rate of the memory resource data and the chaos uncertainty index;
[0165] S4. Obtain the data of the tasks to be scheduled, and output the optimal scheduling strategy using the task scheduling algorithm based on artificial immunity based on the system entropy index and the data of the tasks to be scheduled.
[0166] Example 3
[0167] This embodiment discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the operation mode of the above-mentioned method for parallel scheduling of peak memory resources is implemented.
[0168] Since the electronic device introduced in this embodiment is an electronic device used to implement a method for parallel scheduling of memory resource peaks in the embodiment of this application, based on the method for parallel scheduling of memory resource peaks introduced in the embodiment of this application, a person skilled in the art can understand the specific implementation of the electronic device of this embodiment and its various variations, so how the electronic device implements the method in the embodiment of this application is not described in detail here. As long as a person skilled in the art implements the electronic device used in the method for parallel scheduling of memory resource peaks in the embodiment of this application, it belongs to the scope of protection of this application.
[0169] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters and thresholds in the formula are set by technicians in this field according to actual conditions.
[0170] The above is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiments. All technical solutions under the concept of the present invention belong to the protection scope of the present invention. It should be pointed out that for ordinary technical users in this technical field, some improvements and modifications without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A memory resource peak parallel scheduling system, characterized in that: include: A chaos building module is used to collect memory resource data and build a chaotic system model based on the memory resource data; An index determination module is used to construct a chaotic attractor model to make a chaotic prediction of the future state of the chaotic system model and calculate the chaotic uncertainty index; The system entropy module is used to calculate the current utilization rate of the memory resource data, and calculate the system entropy index based on the current utilization rate of the memory resource data and the chaos uncertainty index; The simulated immune module is used to obtain the data of the tasks to be scheduled, and output the optimal scheduling strategy based on the system entropy index and the data of the tasks to be scheduled using the task scheduling algorithm based on artificial immunity; each module is connected by wire and / or wireless means; The memory resource data includes CPU usage data, memory usage data and storage data; CPU usage data includes CPU load and CPU waiting time, memory usage data includes memory availability and memory allocation rate, and storage data includes disk I / O rate and disk usage rate; The memory resource data is collected by setting a data collection agent or probe monitoring, and defining the data collection interval of the data collection agent or probe monitoring; The method of constructing the chaotic system model includes: Clean and standardize the collected memory resource data, and align the memory resource data of different time scales to have the same time interval; Define the dynamic equation of the chaotic system model, the dynamic equation is: Among them, x is the CPU usage data, y is the memory usage data, z is the storage data, t is the time variable, σ, r and b are the target parameters to be fitted; Define the objective function F of the chaotic system model; F = ∑ [(x(t)-x obs (t)) 2 +(y(t)-y obs (t)) 2 +(z(t)-z obs (t)) 2 ], where x(t) represents the value of the CPU usage data x at time t, y(t) represents the value of the memory usage data y at time t, z(t) represents the value of the storage data z at time t, and x obs (t) represents the value of CPU usage data x at time t observed by the chaotic system model, and y obs (t) represents the value of memory usage data y observed by the chaotic system model at time t, z obs (t) represents the value of the stored data z observed by the chaotic system model at time t; According to the objective function, the genetic algorithm is used to solve and obtain the target parameters that need to be fitted. The target parameters that need to be fitted are substituted into the dynamic equation to perform numerical simulation on x, y and z to obtain the simulation results. The root mean square error is calculated between the simulation results and the real-time observed data. If the value of the root mean square error does not decrease for p consecutive times, the chaotic system model is built. The method of constructing the chaotic attractor model includes: The chaotic system model is mapped to the h-dimensional phase space using the time-delay coordinate method, that is, the time-delay vector of the state variable Y(t)=(x(t),x(t+τ),x(t+2τ),...,x(t+(h-1)τ)) is constructed, where τ is the time delay. The attractor of the chaotic system model in the h-dimensional phase space is denoted by A. In the h-dimensional phase space, a reference point Y(t0) is randomly selected, i.e., the current state, and Y(t0) is located on A. All other trajectory points Y(t j ) and the distance d from the reference point Y(t0) j =||Y(t j )-Y(t0)||, find the g points closest to the reference point Y(t0), which are the g nearest neighboring points; Obtain the invariant measure of the attractor based on the g nearest neighbor points, using the local nearest neighbor method or the point distance statistics method; According to the invariant measure of the attractor, the attractor A is parameterized and fitted using the wavelet basis function, and the obtained model is the chaotic attractor model. The method of performing parameterized fitting includes: Define Daubechies wavelet as wavelet basis and determine the order of wavelet basis. In h-dimensional phase space, construct the wavelet basis function according to the defined wavelet basis and its order. Where a represents the variable of the input signal, f is the displacement parameter, and H f is a set of high-pass filter coefficients, φ represents the scaling function; The wavelet basis function is used to perform wavelet decomposition on the set of trajectory points of attractor A in h-dimensional phase space, and the wavelet component coefficients at each scale are obtained; The wavelet component coefficients at each scale are used as parameters to fit the function form of the model Among them, c l,f is the wavelet component coefficient obtained by wavelet decomposition, which indicates the component size of the signal at the lth scale and the fth displacement. It is a scale function with a scale of l and a displacement of f, which completes the construction of the chaotic attractor model; The method for performing chaos prediction includes: In the h-dimensional phase space, the current state Y(t0) is located on the attractor A. The constructed chaotic attractor model is used to determine the manifold structure of the attractor where Y(t0) is located. The manifold structure constrains the movement trajectory of Y(t0) in the future. After finding the nearest neighbor point of Y(t0), the chaotic attractor model is used to only consider the trajectory points whose subsequent trajectories of the nearest neighbor points are located on the manifold structure of the same attractor. Local linear fitting is performed on these trajectory points to obtain the prediction equation. The expression of the prediction equation is: in, represents the predicted state vector at time t+s, that is, the prediction result obtained by local linear fitting, a0, a1 to a q is the regression coefficient, s is the time step of prediction, and q is the order of the polynomial; Map the trajectory predicted by the prediction equation based on the chaotic attractor model constraints back to the original state space to obtain the future state prediction distribution sequence; The calculation method of the chaos uncertainty index includes: Select the state point Y0 at the initial time t=0 from the predicted future state distribution sequence, and construct a hypersphere B around Y0 ε (Y0), the radius of the hypersphere is ε, and using the prediction equation, the hypersphere B ε (Y0) evolves to the subsequent moment. After time t, the hypersphere will be stretched into a ribbon structure. The length L(t) and width W(t) of the ribbon structure are obtained. The chaos uncertainty index is calculated based on the length L(t) and width W(t) of the ribbon structure. The current utilization rate of the memory resource data is calculated by: The current utilization of CPU usage data Among them, f cpu is the CPU load, Dt is the unit time, D cpu It is the CPU waiting time; Current utilization of memory usage data u mem (t) = (1-N ck )·N fp , where N ck is the memory availability, N fp is the memory allocation rate; Current utilization of storage data u disk (t) = C sy ·(1-α·C I / O ), where C sy is the disk usage, C I / O is the disk I / O rate, α is the empirical coefficient, which is used to control the influence of the disk I / O rate on the storage utilization and is obtained by the least squares fitting method; The current utilization of the CPU utilization data, the current utilization of the memory utilization data, and the current utilization of the storage data are averaged to obtain the current utilization of the memory resource data. The system entropy index XT=β·ZY(t)+(1-β)·Λ(t), wherein ZY(t) is the current utilization rate of memory resource data, and β is the weight coefficient.
2. The memory resource peak parallel scheduling system according to claim 1, characterized in that: The method of solving and obtaining the target parameters to be fitted includes: Encode the target parameter to be fitted into a chromosome, define the population size N of the genetic algorithm, and randomly generate chromosomes of N individuals as the initial population; The fitness function of the population is defined as the objective function of the chaotic system model. For each individual in the population, the parameter value corresponding to the chromosome encoded by it is used to solve x, y and z through the dynamic equation, and the value of the fitness function, i.e., the fitness, is calculated. According to the fitness, the tournament selection operator is used to select C individuals from the current population as the parent generation. According to the crossover probability, two individuals are randomly selected from the parent generation for uniform crossover operation to generate new individuals, i.e., the offspring. The individuals generated by the uniform crossover operation are merged with the individuals in the parent generation whose fitness is greater than the preset fitness threshold to form a new population; If the preset upper limit of iterations is not reached, the selection and uniform crossover operations will continue. When the upper limit of iterations is reached, the target parameters to be fitted corresponding to the individual with the highest fitness in the current population will be output.
3. The memory resource peak parallel scheduling system according to claim 2, characterized in that: The method of selecting C individuals includes: Set the tournament size k, set the number of parent individuals C, randomly select k individuals from the current population, calculate the fitness of these k individuals, and find the individual Pwin with the highest fitness as the parent; The method of performing the uniform crossover operation includes: Step 1: Randomly select two individuals from the parent generation as the parents P1 and P2. The length of the chromosomes of P1 and P2 is L, and P1 and P2 are encoded as real numbers, then P1 = [p11, p12, ..., p1 L], P2 = [p21, p22, ..., p2L]; Step 2: Create a 01 mask vector mask = [m1, m2, ..., mL] of length L. For each bit in the 01 mask vector mask, generate 0 or 1 with a crossover probability pc. Step 3. According to the 01 mask vector mask, copy the corresponding gene positions of P1 and P2 to the offspring C1 and C2. For the i-th gene position, if mi=1, then c1i=p1i, c2i=p2i. If mi=0, then c1i=p2i, c2i=p1i. Then two new offspring individuals C1 and C2 are generated, C1=[c11, c12, ..., c1L], C2=[c21, c22, ..., c2L]. Repeat steps 1-3 until all C individuals are used up.
4. The memory resource peak parallel scheduling system according to claim 3, characterized in that: The task data to be scheduled include task resource requirements, task priority, task execution time, task dependency, task submission time and task type. Task resource requirements include CPU requirements, memory requirements and storage requirements. Task priority includes high priority tasks, medium priority tasks and low priority tasks. Task dependency includes predecessor tasks, successor tasks and parallel tasks. Task types include batch tasks, service tasks, data processing tasks, compute-intensive tasks and I / O-intensive tasks.
5. The memory resource peak parallel scheduling system according to claim 4, characterized in that: The method of outputting the optimal scheduling strategy includes: The task data to be scheduled is encoded into a task antigen vector as the input of the artificial immune algorithm. The task scheduling algorithm initializes an antibody population, which contains U antibodies. Each antibody represents a scheduling strategy, and the antibody is encoded as a permutation vector. Define the goodness function Y of the task scheduling algorithm lhshu ; Among them, ZF is the maximum resource peak, ZR is the total resource capacity, RY is v is the task priority of the vth task, RS v is the task execution time of the vth task, is the average waiting time, w1 is the resource utilization efficiency weight parameter, w2 is the priority weight parameter, w3 is the waiting time weight parameter, w4 is the entropy index penalty item weight parameter, and w1+w2+w3+w4=1; Average waiting time Where TC v is the completion time of the vth task, TS v is the submission time of the vth task, TN is the total number of tasks; Calculate the function value of the merit function of each antibody in the antibody population, and add them up to get the total merit of the antibody population. Calculate the probability pi of each antibody being selected to enter the next generation antibody population, that is, the function value of the antibody merit function divided by the total merit. Perform M selections, and randomly select an antibody each time with probability pi. The selected antibody will be added to the next generation antibody population to obtain a new generation antibody population. The new generation antibody population is mapped and crossed to obtain a new second generation antibody population. The new second generation antibody population is mutated to obtain a final antibody population. The function value of the merit function of each antibody in the final antibody population is calculated, and the scheduling strategy corresponding to the antibody with the highest function value of the merit function is taken as the optimal scheduling strategy.
6. The memory resource peak parallel scheduling system according to claim 5, characterized in that: The method of performing the mapping cross operation includes: Step 101, randomly selecting two antibodies from the new generation antibody population as mapping cross objects, denoted as Parent1 and Parent2, and randomly selecting two different cutting points to divide Parent1 and Parent2 into three parts; Step 102, exchanging the middle parts of the two antibodies to obtain temporary offspring Offspring 1 and Offspring 2; Step 103: For the repeated parts in the temporary offspring, repair them according to the rules of partial mapping to obtain the repaired Offspring1 and Offspring2, and finally obtain offspring antibodies without repeated parts, and add Offspring1 and Offspring2 to the next generation population; Perform steps 101 to 103 on all antibodies in the new generation antibody population, thereby obtaining a new second generation antibody population; The method of performing the mutation operation includes: Step 201: Define the mutation rate of the mutation operation Determine whether to mutate the antibodies in the new second-generation antibody population based on the mutation rate, and randomly generate a number rand in the interval [0, 1]. If rand is greater than pm, the antibody is mutated, otherwise the antibody is kept unchanged; Step 202: If mutation is to be performed, randomly select insertion mutation or exchange mutation, randomly generate a number rand2 in the interval [0, 1], and if rand2 is greater than 0.5, perform insertion mutation, otherwise perform exchange mutation; The method of performing insertion mutation includes: Randomly select positions u1 and u2 of two different genes in the antibody, where u1 is greater than or equal to 1 and u2 is less than or equal to the total length of the antibody. Temporarily save the gene at position u1, move the genes at position u2 and behind it as a whole one position toward u1, and insert the temporarily saved gene into position u2. The method of performing the exchange mutation is: randomly selecting positions u1 and u2 of two different genes, where u1 is greater than or equal to 1 and u2 is less than or equal to the total length of the antibody, and exchanging the two genes at positions u1 and u2; Step 203: Generate new antibodies and add them to the next generation population. Perform steps 201-202 on all antibodies in the new second generation antibody population to obtain the final antibody population.
