CN114691368A - Resource allocation method, device, equipment and medium for edge computing terminal - Google Patents
Resource allocation method, device, equipment and medium for edge computing terminal Download PDFInfo
- Publication number
- CN114691368A CN114691368A CN202210336857.5A CN202210336857A CN114691368A CN 114691368 A CN114691368 A CN 114691368A CN 202210336857 A CN202210336857 A CN 202210336857A CN 114691368 A CN114691368 A CN 114691368A
- Authority
- CN
- China
- Prior art keywords
- sample data
- ram
- cpu
- application
- family
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000013468 resource allocation Methods 0.000 title claims abstract description 45
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000004422 calculation algorithm Methods 0.000 claims abstract description 16
- 239000011159 matrix material Substances 0.000 claims description 35
- 238000004364 calculation method Methods 0.000 claims description 12
- 230000006870 function Effects 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 239000013256 coordination polymer Substances 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 7
- 230000003287 optical effect Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 238000004458 analytical method Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 239000002699 waste material Substances 0.000 description 5
- 230000006399 behavior Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 3
- 238000005457 optimization Methods 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000007621 cluster analysis Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000004146 energy storage Methods 0.000 description 2
- 239000013307 optical fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000008569 process Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000005611 electricity Effects 0.000 description 1
- 238000004134 energy conservation Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 238000010248 power generation Methods 0.000 description 1
- 230000008707 rearrangement Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000001932 seasonal effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5061—Partitioning or combining of resources
- G06F9/5072—Grid computing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2209/00—Indexing scheme relating to G06F9/00
- G06F2209/50—Indexing scheme relating to G06F9/50
- G06F2209/502—Proximity
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Supply And Distribution Of Alternating Current (AREA)
Abstract
The embodiment of the invention discloses a resource allocation method and a resource allocation device of an edge computing terminal, electronic equipment and a storage medium, wherein the resource allocation method of the edge computing terminal comprises the following steps: acquiring a daily operation data sample set; dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm; respectively calculating the CPU resource demand and the RAM resource demand of the random access memory corresponding to each group of sample data; and acquiring first sample data and second sample data, and performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g-family sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g-family sample data. The invention can determine the resource allocation of the CPU and the RAM of each application, so that the terminal can provide sufficient computing power for the application in each time period, effectively cope with uncertainty in the operating environment, and realize effective control on the microgrid.
Description
Technical Field
The present invention relates to power control technologies, and in particular, to a method, an apparatus, a device, and a medium for resource allocation of an edge computing terminal.
Background
Nowadays, people pay more and more attention to the problem of energy conservation, and more renewable energy sources are connected to a low-voltage distribution network in a distributed power supply mode, so that part of the low-voltage distribution network is promoted to be changed into a micro-grid. The original low-voltage distribution network control system cannot cope with the pressure of concurrent increase of various kinds of applications such as control and transaction. Currently, micro-service technology and container technology have some applications in the fields of cloud computing, edge computing, and power system automation. The micro-service technology can divide each application into each micro-service, avoids repeated development and deployment of the same functional element, and has the characteristics of flexible deployment, high elasticity and easy expansion. The container technology provides support for the implementation of microservices. The micro-grid is complex in operation environment, and space-time uncertainty and imbalance exist in the application amount of each part in the control system.
In order to ensure the reliable operation of the control system, each part of the existing control system mostly adopts a redundancy configuration strategy, even blind configuration, and compensation investment is carried out after the configured resource amount can not meet the requirement, so that resource loss and waste are caused. And in the microgrid control system constructed by the edge computing, the uncertainty of each application causes the uncertainty of the time distribution of the computing load of the edge computing terminal.
Disclosure of Invention
The embodiment of the invention provides a resource allocation method, a resource allocation device, equipment and a medium of an edge computing terminal, wherein equipment type selection is carried out according to resource allocation conditions of a Central Processing Unit (CPU) and a Random Access Memory (RAM), and sufficient computing power is provided for the micro-grid edge computing terminal in each time period.
In a first aspect, an embodiment of the present invention provides a resource allocation method for an edge computing terminal, including:
acquiring a daily operation data sample set;
dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2;
respectively calculating the CPU resource demand and the RAM resource demand of the random access memory corresponding to each group of sample data;
acquiring first sample data and second sample data, and performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g-family sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g-family sample data.
In a second aspect, an embodiment of the present invention provides a resource allocation apparatus for an edge computing terminal, where the apparatus includes:
the first acquisition module is used for acquiring a daily operation data sample set;
the data classification module is used for dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2;
the resource demand calculation module is used for calculating the CPU resource demand and the RAM resource demand corresponding to each group of sample data respectively;
and the second acquisition module is used for performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g family of sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g family of sample data.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the resource allocation method of the edge computing terminal according to any one of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the resource allocation method of an edge computing terminal according to any one of the embodiments of the present invention.
In the embodiment of the invention, a daily operation data sample set is obtained; dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2; respectively calculating the CPU resource demand and the RAM resource demand of the random access memory corresponding to each group of sample data; and acquiring first sample data and second sample data, and performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g-family sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g-family sample data. In other words, in the embodiment of the invention, the resource allocation of the CPU and the RAM of each application can be determined by using the resource demand of each application to the CPU and the RAM, so that the terminal can provide sufficient computing power for the application in each time period, effectively cope with uncertainty in the running environment of the edge computing terminal, and realize effective control on the microgrid.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a schematic flowchart of a resource allocation method of an edge computing terminal according to an embodiment of the present invention;
FIG. 2 is a flowchart of resource allocation to CPU and RAM according to an embodiment of the present invention;
fig. 3 is another schematic flowchart of a resource allocation method of an edge computing terminal according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a resource allocation terminal of an edge computing terminal according to an embodiment of the present invention;
FIG. 5 is a block diagram of a resource allocation apparatus of an edge computing terminal according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Fig. 1 is a schematic flow chart of a resource allocation method for an edge computing terminal according to an embodiment of the present invention, where the method according to the embodiment of the present invention is applicable to device type selection according to resource allocation conditions of a CPU and a RAM, and provides sufficient computing power for the edge computing terminal of a microgrid at each time interval. The method can be executed by the resource configuration device of the edge computing terminal provided by the embodiment of the invention, and the device can be realized in a software and/or hardware manner. The following embodiments will be described by taking as an example that the apparatus is integrated in an electronic device, and referring to fig. 1, the method may specifically include the following steps:
The sample data is data generated when each application deployed on the microgrid edge computing terminal is triggered on a running day. The micro-grid is a small power generation and distribution system composed of a distributed power supply, an energy storage device, an energy conversion device, a load, a monitoring and protecting device and the like. The micro-grid can realize flexible and efficient application of the distributed power supply and solve the problem of grid connection of the distributed power supply with large quantity and various forms. The edge calculation is an open platform integrating network, calculation, storage and application core capabilities on one side close to an object or a data source, nearest-end service is provided nearby, and the basic requirements of the industry on real-time application, application intelligence, safety, privacy protection and the like are met. The daily operation data sample set is a set of data samples generated by triggering each application deployed on the micro-grid edge computing terminal on an operation dayAnd (6) mixing. In the embodiment of the invention, one operation day is divided into 96 time periods. Assume that n applications are deployed on a microgrid edge computing terminal: (A)1,A2,...An)TWith AiDenotes the ith application and denotes the period by k. By fiRepresents application AiFrequency of triggering over 96 periods of the day of operation, i.e. fi=(fi,1,fi,2,...,fi,k,...,fi,96). Further, with f ═ f (f)1,f2,...,fn)TRepresenting daily operating data. And collecting daily operation data F of each application to obtain a daily operation data sample set F of each application. Wherein, the data sample set F is composed of F, and has the same structure with F.
And 102, dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2.
The triggering frequency of each application on the operation day is influenced by season change, small probability events and the like, so that data generated by triggering each application presents certain fluctuation. For example, a load forecasting microservice is deployed on a microgrid terminal. In general, the electricity consumption of residents is more in summer than in winter, and the data generated by the load forecasting micro-service in different seasons may be different. Therefore, the daily operation sample data of each application needs to be clustered, and the daily operation sample data of each application is divided into g families. The cluster analysis is an analysis process for grouping a set of physical or abstract objects and dividing data into a plurality of classes composed of similar objects. In the embodiment of the scheme, the daily operation sample data of each application can be preprocessed by utilizing cluster analysis, so that the influence of seasonal change, small probability events and the like on the daily operation sample data of each application is avoided. In an embodiment, the value of g may be set according to actual needs or computing capability of the resource configuration device, for example, the value of g is 10, 50, or 100. In particular, the daily run data sample set may be divided into g-family sample data using a clustering algorithm such as k-means. Wherein, the k-means algorithm can judge the similar relations of different samples by calculating the distance between the different samplesThe neighbors are placed in the same category. By the aid of a clustering analysis algorithm, daily operation data of each application can be preprocessed once, and influences of small-probability burst time and the like on the daily operation data of each application are reduced. Specifically, each application day operation data sample set F is divided into g families. Wherein group i isWherein, Fj (i)Representing the jth day of operation data in family i.
And 103, respectively calculating the CPU resource demand and the RAM resource demand corresponding to each group of sample data.
Specifically, after g family sample data is acquired, a daily operation data sample of a certain family is acquired. Assuming that a daily run data sample of the i-th family is taken, further, an average of the daily run data samples of the family is calculated. The average of the daily run data samples of the family is used to estimate the overall expected value for the family. The expectation value is the probability of each possible result in the test multiplied by the sum of the results, and can reflect the average value of the random variables. Further, the expected triggering frequency of each application in each time interval on a typical day corresponding to the operation data sample of the ith family day is obtained from the total expected value. Wherein, by determining typical days in the power system, the line loss of each node in the system, the peak-valley period of each day and the distribution of loads in the system can be calculated. The resources occupied by each application in the edge computing terminal under certain conditions of the microgrid structure are known. Assuming that n applications are deployed on the edge computing terminal, resources occupied by each application in the edge computing terminal can be represented by a 2 × n matrix. With the 2 × n matrix × the expected trigger frequency for each period in the above description, an expected computation load matrix for each application can be obtained. And calculating the CPU resource demand corresponding to the first behavior sample data of each family in the matrix, and the RAM resource demand corresponding to the second behavior sample data of each family.
And 104, acquiring first sample data and second sample data, and performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g-family sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g-family sample data.
Specifically, after the load matrix is calculated for each application, the time period during which the maximum value occurs in the first and second rows in the matrix is obtained. Let k be the period during which the first row maximum in the matrix occurs1The period of time during which the second row maximum occurs in the matrix is k2. Then explain each application k1Time slot has the greatest demand for CPU resources, at k2The time period has the greatest demand on RAM resources. Further, for each application k1Time period and k2Analyzing the resource demand conditions of the CPU and the RAM in time intervals to obtain k1Time period and k2And (3) calculating resource demand curves of the CPU and the RAM when the applications are concurrent in the time interval. Further, get applications k1Time period and k2All subsets of the set of time period concurrent applications. Suppose at k1All subsets of the set of time period concurrent applications are nθ1At k, in2All subsets of the set of time period concurrent applications are nθ2. Further, for nθ1And nθ2Analyzing the resource demand conditions of the CPU and the RAM to obtain nθ1At k1Resource demand curve component of CPU of a time period, and nθ2At k is2Resource demand curve component of RAM for a time period. In obtaining nθ1And nθ2Are respectively at k1Time period and k2And adding constraint conditions to the two curve components for optimization after the resource demand curve components of the CPU and the RAM are subjected to time interval. Wherein, the constraint condition can be that each application does not exceed n for the maximum resource demand of CPU and RAM in actual operationθ1And nθ2The probability of resource demand on CPU and RAM is 99.99%. Suppose that for nθ1And nθ2Is optimized to obtainAndthenAndrespectively allocating R for the resources of CPUCPUAnd resource allocation R of RAMRAM. Further, sample data for each family is traversed. Fig. 2 is a flowchart of resource allocation to a CPU and a RAM according to an embodiment of the present invention. As shown in fig. 2, the sample data of the m-th family is denoted by m. When m is greater than or equal to g, it indicates that the sample data of each family has been traversed. Specifically, the resource configuration of each family of sample data to the CPU and the resource configuration of the RAM are obtained. Further, take the corresponding R of each groupCPUAnd RRAMMaximum value of (2). Wherein each group corresponds to RCPUThe maximum sample data in (1) is the first sample data, and R corresponding to each groupRAMThe sample data of the maximum value in (b) is the second sample data. Further, resource configuration is carried out according to the first sample data and the second sample data.
According to the technical scheme of the embodiment, a daily operation data sample set is obtained; dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2; respectively calculating the CPU resource demand and the RAM resource demand of the random access memory corresponding to each group of sample data; and acquiring first sample data and second sample data, and performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g-family sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g-family sample data. Through the technical scheme of the embodiment, the resource configuration of the CPU and the RAM of each application can be determined by utilizing the resource demand of each application to the CPU and the RAM. The terminal can provide sufficient computing power for application in each time period, effectively cope with uncertainty in the operating environment, and effectively control the micro-grid.
Fig. 3 is another schematic flow chart of a resource allocation method of an edge computing terminal according to an embodiment of the present invention, which is detailed based on the foregoing embodiment. A specific method can be shown in fig. 3, and the method can include the following steps:
The expectation value is the probability of each possible result in the test multiplied by the sum of the results, and can reflect the average value of the random variables. The calculation load matrix may represent the CPU resource demand and the RAM resource demand corresponding to each group of sample data.
In this embodiment, optionally, the application of the sample data of the ith group triggers the frequency matrix expectationFj (i)For the jth day of operation data in family i,/iThe number of samples included in the sample data of the i-th family.
Specifically, the data sample F is run on the day of the family i(i)Then, to F(i)Get the mean valueFurther, the overall expectation of daily running data samples is denoted by E, namely:
overall expectation of running data samples at the time of day of acquisition E (F)(i)) Then, by E (F)(i)) Calculating application trigger frequency matrix expectation P of i-family sample data(i). Wherein, P(i)Is a matrix of n × 96 dimensions, i.e.:
P(i)=E(F(i))
by aiRepresenting the number of samples contained in the i-th group of sample data, P can be obtained(i)Comprises the following steps:
under the condition determined by the micro-grid structure, the resources occupied by each application in the edge computing terminal are known. The resource occupation state is represented by a 2 × n-dimensional matrix C. Further, a desired computation load matrix L of the i-th family of sample data is defined based on the matrix C(i)Namely:
L(i)=CP(i)
wherein it is desired to calculate the load matrix L(i)The CPU resource demand and the RAM resource demand corresponding to the sample data of each family can be represented. And calculating the CPU resource demand corresponding to the first behavior sample data of each family in the matrix, and the RAM resource demand corresponding to the second behavior sample data of each family.
In this embodiment, optionally, the set n is appliedθ1In a period k1CPU demand curve component of (a):
set of applications nθ2In a period k2RAM demand curve component of (a):
where, i ═ 1, 2., n denotes that n applications are deployed on the edge computing terminal, and j ═ 1, 2., miRepresenting that the ith application contains miA micro service, ci,j,CPU、ci,j,RAMRespectively representing CPU and RAM resources occupied by jth micro service of ith application, epsilon (t) is step function, ti,j,startStarting execution time of jth microservice for ith application, di,j、βi,jRespectively, the data size and the computational complexity coefficient of the jth microservice for the ith application.
Specifically, the expected computation load matrix L is obtained(i)Then, the matrix L is divided into(i)Let the period of occurrence of the maximum in the first row be k1And the period of time when the maximum value appears in the second row is denoted as k2. Wherein, is composed of L(i)The computational resource demand curve of each application to the CPU and RAM can be obtained. In particular, is obtained at k1And k2And in the time period, calculating resource demand curves of the CPU and the RAM are generated when the applications are concurrent. Wherein each application is to k1The CPU resource demand curve component for a time period is:
each application is to k2The RAM resource demand curve components for a time period are:
where, i ═ 1, 2., n denotes that n applications are deployed on the edge computing terminal, and j ═ 1, 2., miRepresenting that the ith application contains miA micro service, ci,j,CPU、ci,j,RAMRespectively representing CPU and RAM resources occupied by jth micro service of ith application, epsilon (t) is step function, ti,j,startStarting execution time of jth microservice for ith application, di,j、βi,jRespectively, the data size and the computational complexity coefficient of the jth microservice for the ith application. The step function is a special continuous time function, and signal processing, integral conversion and the like can be performed by using the step function. Further, set at the period k1All subsets of the set of concurrent applications are nθ1In a period k2All subsets of the set of concurrent applications are nθ2. Then the set n of applicationsθ1In a period k1The CPU demand curve components of (1) are:
set of applications nθ2In a period k2The RAM demand curve components of (a):
direct utilization ofAndthe resource allocation is carried out on the CPU and the RAM, so that the resource allocation amount is excessively increased due to some extremely small probability events, and resource waste is caused. In the embodiment of the invention, the method is used for calculatingAndand then the CPU and the RAM are subjected to resource allocation, so that resource waste is avoided.
Specifically, the set n of applications is obtainedθ1In a period k1CPU demand curve component and application set nθ2In a period k2After the RAM demand curve components are obtained, constraint conditions are added to the two demand curve components for optimization to obtain a first reference application setAnd a second set of reference applications
In this embodiment, optionally, the first reference application setSatisfies the following conditions:
where min max represents the maximum-minimum criterion decision method, which is one of the decision criteria for an indeterminate decision. It may be shown that the decision maker should select the worst possible outcome in each scenario and then select the best one that provides the worst possible outcome. The minimum possible result can be maximized by min max. Wherein the constraint condition in s.t. is that the maximum resource demand of CPU and RAM is not more than n when each application is actually operatedθ1And nθ2The probability of resource demand on CPU and RAM is 99.99%.
Computing a first set of reference applications by the method described aboveAnd a second set of reference applicationsAnd toAndand the constraint and optimization are carried out, so that the accuracy of resource allocation is improved, and the edge computing terminal can provide sufficient computing power for each application in each time period.
In particular toGround, first reference application setAnd CPU resource demand RCPU,iCorresponding, second set of reference applicationsAnd RAM resource demand RRAM,iAnd (7) corresponding. By usingAndcan respectively calculate RCPU,iAnd RRAM,i。
In this embodiment, optionally, the CPU resource demand corresponding to the i-family sample data is:
the RAM resource demand corresponding to the sample data of the i family is as follows:
wherein alpha is1、α2And respectively configuring a margin coefficient for the CPU and a margin coefficient for the RAM.
In the power system, the margin coefficient can be used for measuring the stability of a negative feedback system and can be used for predicting the overshoot of the step response of the closed-loop system. In the development process of the micro-grid, new applications may appear to need to be deployed on the edge computing terminal. Therefore, before the equipment is selected, the equipment needs to be selectedAndrespectively multiplying the corresponding resource demand quantities of the CPU and the RAM by the corresponding configuration margin coefficients to obtain the CPU resource demand quantity R corresponding to the sample data of the ith groupCPUAnd RAM resource demand RRAM. Wherein R isCPUAnd RRAMAnd calculating resource allocation quantities of the edge calculation terminals defined by the micro-grid respectively. Further, R from each family of daily operating data is comparedCPUAnd RRAMAnd taking the maximum value as a calculation resource configuration result. And selecting the equipment by taking the resource configuration result as a reference.
By calculating RCPUAnd RRAMAnd the maximum value is taken as reference for equipment type selection, so that resource loss and waste caused by blind configuration can be avoided, and the efficiency of resource configuration is improved.
In the embodiment of the invention, a daily operation data sample set is obtained; dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm; application trigger frequency matrix expectation P for acquiring ith group of sample data(i)Expected calculation load matrix L of sample data of group i(i)Application set nθ1In a period k1CPU demand curve component ofAnd set of applications nθ2In a period k2Component of the RAM demand curveAccording to P(i)、L(i)、Andcomputing a first set of reference applicationsAnd a second set of reference applicationsWherein the first reference application setAnd CPU resource demand RCPU,iCorresponding, second set of reference applicationsAnd RAM resource demand RRAM,iCorresponding; wherein i is more than or equal to 1 and less than or equal to g; applying a set according to a first referenceCalculating the CPU resource demand R corresponding to the i-family sample dataCPUAnd according to the second reference application setCalculating the RAM resource demand R corresponding to the i-family sample dataRAM. By the technical scheme of the embodiment, resource waste caused by excessive increase of resource allocation amount due to some extremely-small-probability events is avoided, the accuracy of resource allocation is improved, and the edge computing terminal can provide sufficient computing power for each application in each time period. The uncertainty in the operation environment of the computing terminal can be effectively dealt with, and the effective control on the micro-grid is realized.
Fig. 4 is a schematic structural diagram of a resource allocation terminal of an edge computing terminal according to an embodiment of the present invention, as shown in fig. 4. The resource configuration terminal of the edge computing terminal comprises:
the container is used for providing a running environment for the functional microservice, wherein the functional microservice supports the realization of each application;
the data interaction interface is used for realizing data interaction among the applications;
and the network bridge is used for providing channels for data interaction of different containers.
The functional micro services include a message analysis micro service, a photovoltaic control micro service, a wind power control micro service, an energy storage control micro service, a breaker control micro service, a load flow calculation micro service, a topology analysis micro service, a harmonic analysis micro service, a load prediction micro service, a state estimation micro service and the like as shown in fig. 4.
Fig. 5 is a structural diagram of a resource allocation apparatus of an edge computing terminal according to an embodiment of the present invention, where the apparatus is adapted to execute a resource allocation method of the edge computing terminal according to the embodiment of the present invention. As shown in fig. 5, the apparatus may specifically include:
a first obtaining module 501, configured to obtain a daily operation data sample set;
a data classification module 502, configured to classify the daily operation data sample set into g groups of sample data according to a clustering algorithm, where g is an integer greater than or equal to 2;
a resource demand calculation module 503, configured to calculate the CPU resource demand and the RAM resource demand of the random access memory corresponding to each group of sample data respectively;
a second obtaining module 504, configured to perform resource configuration according to first sample data and second sample data, where the first sample data is sample data corresponding to a maximum CPU resource requirement in the g family of sample data, and the second sample data is sample data corresponding to a maximum RAM resource requirement in the g family of sample data.
Optionally, the second obtaining module 503 is specifically configured to:
for the sample data of the ith group, i is more than or equal to 1 and less than or equal to g;
calculating the CPU resource demand R corresponding to the i-family sample dataCPUAnd RAM resource demand RRAMThe method comprises the following steps:
an application set calculation unit: calculating a first reference application set corresponding to the i-family sample dataAnd a second set of reference applicationsWherein the first reference application setAnd CPU resource demand RCPU,iCorrespondingly, the second reference application setAnd RAM resource demand RRAM,iCorresponding;
applying the set according to the first referenceCalculating the CPU resource demand R corresponding to the i-family sample dataCPUAnd applying the set according to the second referenceCalculating the RAM resource demand R corresponding to the i-family sample dataRAM。
Optionally, the application set calculating unit is specifically configured to:
application trigger frequency matrix expectation P for acquiring ith group of sample data(i)I-family sample data expected computation load matrix L(i)Application set nθ1In a period k1CPU demand curve component ofAnd set of applications nθ2In a period k2Component of the RAM demand curve
According to P(i)、L(i)、Andcomputing the first set of reference applicationsAnd the second reference application set
Optionally, the application set calculating unit is further configured to:
application trigger frequency matrix expectation of i-family sample dataFj (i)For the jth day of operation data in family i,/iThe number of samples contained in the sample data of the ith family;
expected computation load matrix L of i-th group sample data(i)=CP(i)C is an application resource occupation matrix;
set of applications nθ1In a period k1CPU demand curve component ofSet of applications nθ2In a period k2Component of the RAM demand curve Where, i ═ 1, 2., n denotes that n applications are deployed on the edge computing terminal, and j ═ 1, 2., miRepresenting that the ith application contains miA micro service, ci,j,CPU、ci,j,RAMRespectively representing CPU and RAM resources occupied by jth micro service of ith application, epsilon (t) is step function, ti,j,startStarting execution time of jth microservice for ith application, di,j、βi,jRespectively, the data size and the computational complexity coefficient of the jth microservice for the ith application.
Optionally, the application set calculating unit is further configured to:
optionally, the second obtaining module 503 is further configured to:
the CPU resource demand corresponding to the i family sample dataThe RAM resource demand corresponding to the i family sample dataWherein alpha is1、α2And respectively configuring a margin coefficient for the CPU and a margin coefficient for the RAM.
The resource allocation device of the edge computing terminal provided by the embodiment of the invention can execute the resource allocation method of the edge computing terminal provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method. Reference may be made to the description of any method embodiment of the invention not specifically described in this embodiment.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, and referring to fig. 6, a schematic structural diagram of a computer system 12 suitable for implementing the electronic device according to the embodiment of the present invention is shown. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention. The components of electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that couples various system components including the system memory 28 and the processing unit 16.
The system memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)30 and/or cache memory 32. The electronic device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, and commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of the described embodiments of the invention.
The processing unit 16 executes various functional applications and resource allocation by running the program stored in the system memory 28, for example, implementing the resource allocation method of the edge computing terminal provided by the embodiment of the present invention: acquiring a daily operation data sample set; dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2; respectively calculating the CPU resource demand and the RAM resource demand of the random access memory corresponding to each group of sample data; and acquiring first sample data and second sample data, and performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g-family sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g-family sample data.
Embodiments of the present invention provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the resource allocation method of an edge computing terminal according to all embodiments of the present invention: acquiring a daily operation data sample set; dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2; respectively calculating the CPU resource demand and the RAM resource demand of the random access memory corresponding to each group of sample data; and acquiring first sample data and second sample data, and performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g-family sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g-family sample data. Any combination of one or more computer-readable media may be employed. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims (9)
1. A resource allocation method of an edge computing terminal is characterized by comprising the following steps:
acquiring a daily operation data sample set;
dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2;
respectively calculating the CPU resource demand and the RAM resource demand of the random access memory corresponding to each group of sample data;
acquiring first sample data and second sample data, and performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g-family sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g-family sample data.
2. The method of claim 1, wherein i is 1 ≦ g for the ith group of sample data; calculating the CPU resource demand R corresponding to the i-family sample dataCPUAnd RAM resource demand RRAMThe method comprises the following steps:
calculating a first reference application set corresponding to the i-family sample dataAnd a second set of reference applicationsWherein the first reference application setAnd CPU resource demand RCPU,iCorrespondingly, the second reference application setAnd RAM resource demand RRAM,iCorresponding;
3. The method of claim 2, wherein the computing the first reference application set corresponding to the i-th family of sample dataAnd a second set of reference applicationsThe method comprises the following steps:
application trigger frequency matrix expectation P for acquiring ith group of sample data(i)I-family sample data expected computation load matrix L(i)Application set nθ1In a period k1CPU demand curve component ofAnd set of applications nθ2In a period k2Component of the RAM demand curve
4. The resource allocation method of the edge computing terminal according to claim 3, wherein the application trigger frequency matrix expectation P for obtaining the ith group of sample data(i)I-family sample data expected computation load matrix L(i)Application set nθ1In a period k1CPU demand curve component ofAnd set of applications nθ2In a period k2Component of the RAM demand curveThe method comprises the following steps:
application trigger frequency matrix expectation for obtaining i-th group sample data For the jth day of operation data in family i,/iObtaining expected calculation load matrix L of the ith group of sample data for the number of samples contained in the ith group of sample data(i)=CP(i)And C is an application resource occupation matrix, and an application set n is obtainedθ1In a period k1CPU demand curve component of And obtaining a set of applications nθ2In a period k2Component of the RAM demand curve
Where, i ═ 1, 2., n denotes that n applications are deployed on the edge computing terminal, and j ═ 1, 2., miRepresenting that the ith application contains miA micro service, ci,j,CPU、ci,j,RAMRespectively representing CPU and RAM resources occupied by jth micro service of ith application, epsilon (t) is step function, ti,j,startStarting execution time of jth microservice for ith application, di,j、βi,jRespectively, the data size and the computational complexity coefficient of the jth microservice for the ith application.
5. The method of claim 4, wherein the P is a number of terms(i)、L(i)、Andcomputing the first set of reference applicationsAnd the second reference application setThe method comprises the following steps:
according to P(i)、L(i)、Andcomputing the first set of reference applicationsThe first set of reference applicationsSatisfies the following conditions:
according to P(i)、L(i)、Andcomputing the second set of reference applicationsThe second set of reference applicationsSatisfies the following conditions:
6. the method of claim 5, wherein the set of applications is applied according to the first referenceComputing group i sample dataCorresponding CPU resource demand RCPUAnd according to said second reference application setCalculating the RAM resource demand R corresponding to the i-family sample dataRAMThe method comprises the following steps:
applying the set according to the first referenceCalculating the CPU resource demand corresponding to the i-th group of sample dataAnd applying the set according to the second referenceCalculating the RAM resource demand corresponding to the sample data of the ith family
Wherein alpha is1、α2And respectively configuring a margin coefficient for the CPU and a margin coefficient for the RAM.
7. A resource allocation apparatus of an edge computing terminal, comprising:
the first acquisition module is used for acquiring a daily operation data sample set;
the data classification module is used for dividing the daily operation data sample set into g groups of sample data according to a clustering algorithm, wherein g is an integer greater than or equal to 2;
the resource demand calculation module is used for calculating the CPU resource demand and the RAM resource demand corresponding to each group of sample data respectively;
and the second acquisition module is used for performing resource configuration according to the first sample data and the second sample data, wherein the first sample data is sample data corresponding to the maximum CPU resource demand in the g family of sample data, and the second sample data is sample data corresponding to the maximum RAM resource demand in the g family of sample data.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the resource allocation method of the edge computing terminal according to any one of claims 1 to 6 when executing the program.
9. A computer-readable storage medium, on which a computer program is stored, the program, when executed by a processor, implementing a resource allocation method of an edge computing terminal according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210336857.5A CN114691368A (en) | 2022-03-31 | 2022-03-31 | Resource allocation method, device, equipment and medium for edge computing terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210336857.5A CN114691368A (en) | 2022-03-31 | 2022-03-31 | Resource allocation method, device, equipment and medium for edge computing terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114691368A true CN114691368A (en) | 2022-07-01 |
Family
ID=82140414
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210336857.5A Pending CN114691368A (en) | 2022-03-31 | 2022-03-31 | Resource allocation method, device, equipment and medium for edge computing terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114691368A (en) |
-
2022
- 2022-03-31 CN CN202210336857.5A patent/CN114691368A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20130013376A1 (en) | Method and system for intermediate to long-term forecasting of electric prices and energy demand for integrated supply-side energy planning | |
JP7161268B2 (en) | Quantifying the combined impact of interdependent and uncertain resources within the power grid | |
CN113743667A (en) | Method, device, equipment and storage medium for predicting power consumption of transformer area | |
CN115454650A (en) | Resource allocation method, device, terminal and medium for microgrid edge computing terminal | |
CN117435306A (en) | Cluster container expansion and contraction method, device, equipment and storage medium | |
CN116257324A (en) | Service cluster elastic telescoping method and device, electronic equipment and storage medium | |
Zhu et al. | Energy optimal dispatch of the data center microgrid based on stochastic model predictive control | |
Cai et al. | An improved sequential importance sampling method for reliability assessment of renewable power systems with energy storage | |
CN116502771B (en) | Power distribution method and system based on electric power material prediction | |
Yu | [Retracted] Research on Optimization Strategy of Task Scheduling Software Based on Genetic Algorithm in Cloud Computing Environment | |
CN112001578A (en) | Generalized energy storage resource optimization scheduling method and system | |
CN114691368A (en) | Resource allocation method, device, equipment and medium for edge computing terminal | |
CN113971504B (en) | Intelligent contract-based power rush-repair resource allocation method, device and equipment | |
CN116521358A (en) | Method and device for running power edge computing chip in real-time system | |
CN114841548A (en) | Power distribution network resource aggregation method, device, equipment and storage medium | |
CN114298741A (en) | Quotation scheme determination method and device, electronic equipment and storage medium | |
Du et al. | OctopusKing: A TCT-aware task scheduling on spark platform | |
CN109190789B (en) | Medium-and-long-term wind power prediction method and device, computer equipment and storage medium | |
Dong et al. | Image-based processing mechanism for peak load forecasting in smart grids | |
Swide et al. | Energy Demand Prediction Based on Deep Learning Techniques | |
CN113888051B (en) | Power planning method and device, electronic equipment and storage medium | |
Huang et al. | A simplification method for robust optimization of power system based on LMP | |
CN117691583B (en) | Power dispatching system and method for virtual power plant | |
TWI700596B (en) | Information integrating system and information integrating method | |
CN118503716B (en) | Multi-source power outage prediction model construction method, system, terminal and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |