CN111796940B - Resource allocation method and device and electronic equipment - Google Patents

Resource allocation method and device and electronic equipment Download PDF

Info

Publication number
CN111796940B
CN111796940B CN202010640962.9A CN202010640962A CN111796940B CN 111796940 B CN111796940 B CN 111796940B CN 202010640962 A CN202010640962 A CN 202010640962A CN 111796940 B CN111796940 B CN 111796940B
Authority
CN
China
Prior art keywords
target
electronic device
resource space
value
space
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.)
Active
Application number
CN202010640962.9A
Other languages
Chinese (zh)
Other versions
CN111796940A (en
Inventor
窦笠
邹勇
徐佳祥
万博
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Tower Co Ltd
Original Assignee
China Tower Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Tower Co Ltd filed Critical China Tower Co Ltd
Priority to CN202010640962.9A priority Critical patent/CN111796940B/en
Publication of CN111796940A publication Critical patent/CN111796940A/en
Application granted granted Critical
Publication of CN111796940B publication Critical patent/CN111796940B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request

Abstract

The application discloses a resource allocation method, a resource allocation device and electronic equipment. The resource allocation method is applied to the first electronic equipment and comprises the following steps: under the condition of receiving a job task, acquiring state information of a plurality of second electronic devices in a target area, wherein the state information comprises an idle resource space and historical access flow; screening at least one target electronic device from the plurality of second electronic devices based on the state information; and selecting a target resource space with a fixed size from the idle resource spaces of each target electronic device, and distributing the selected target resource space to the job task. The resource allocation method, the device and the electronic equipment can solve the problem of resource waste in the process of providing services for users by using the edge nodes in the prior art.

Description

Resource allocation method and device and electronic equipment
Technical Field
The present invention relates to the field of data transmission, and in particular, to a method and an apparatus for allocating resources, and an electronic device.
Background
In the prior art, in order to improve the efficiency of data transmission to users, different edge nodes are typically deployed to perform specified job tasks through the edge nodes. Different vendors generally need to deploy corresponding node equipment, and when the service is changed, the node equipment is directly discarded, so that the resource is wasted, and in the prior art, the problem of resource waste exists in the process of providing the service for the user by utilizing the edge node.
Disclosure of Invention
The embodiment of the application provides a resource allocation method, a resource allocation device and electronic equipment, which are used for solving the problem of resource waste in the process of providing services for users by utilizing edge nodes in the prior art.
In order to solve the technical problems, the application is realized as follows:
in a first aspect, an embodiment of the present application provides a resource allocation method, which is applied to a first electronic device, including:
under the condition of receiving a job task, acquiring state information of a plurality of second electronic devices in a target area, wherein the state information comprises an idle resource space and historical access flow;
screening at least one target electronic device from the plurality of second electronic devices based on the state information;
and selecting a target resource space with a fixed size from the idle resource spaces of each target electronic device, and distributing the selected target resource space to the job task.
Optionally, the idle resource space includes an idle storage resource space and an idle broadband resource space, and the screening at least one target electronic device from the plurality of second electronic devices based on the status information includes:
Respectively calculating a grading value of each second electronic device based on the idle storage resource space, the idle broadband resource space and a heat value, wherein the heat value is a value calculated based on the historical access flow;
and respectively determining the first N second electronic devices with higher scoring values in the plurality of second electronic devices as the target electronic device, wherein N is an integer greater than or equal to 1.
Optionally, the calculating the score value of each second electronic device based on the idle storage resource space, the idle broadband resource space and the heat value includes:
calculating a scoring value for each of the second electronic devices according to the following formula:
wherein S is the scoring value, lambda is the adjustment factor, andfor values between 0 and 1 obtained after normalization of the heat values, the +.>For values between 0 and 1 obtained after normalizing the size of the free memory resource space, the +.>And (3) obtaining a numerical value between 0 and 1 after normalizing the size of the idle broadband resource space.
Optionally, before calculating the score value of each of the second electronic devices based on the idle storage resource space, the idle broadband resource space and the heat value, the method further includes:
Determining a first target device set H, wherein the first target device set H comprises state information of first M second electronic devices with higher historical access flow in the plurality of second electronic devices;
acquiring position information of each of the plurality of second electronic devices;
calculating the heat value of each of the second electronic devices according to the following formula:
wherein the Hot e The target second electronic device is any one of the plurality of second electronic devices, and the |P is the heat value of the target second electronic device e -P h And I is the distance value between the target second electronic equipment and any second electronic equipment in the first target equipment set H.
Optionally, the method further comprises:
determining a second target electronic device, wherein the second target electronic device is a second electronic device which synchronously runs at least two different job tasks in the plurality of second electronic devices;
in the case that the at least two different job tasks include a first job task and a second job task, assigning a fixed-size first space in a first target resource space to the second job task;
The first job task is a job task of which the utilization rate of the target resource space in a first preset time period is smaller than a first preset value, the second job task is a job task of which the utilization rate of the target resource space in the first preset time period is larger than or equal to the first preset value, and the utilization rate of the target resource space in the first preset time period is continuously increased; the first target resource space is a job space of the first job task, and the second target resource space is a job space of the second job task.
Optionally, the method further comprises:
determining a third target electronic device, wherein the third target electronic device is a second electronic device running a third job task in the plurality of second electronic devices, and the third job task is a job task in which the utilization rate of the target resource space is smaller than a second preset value in a second preset time period;
determining a fourth target electronic device within a range of a preset distance from the third target electronic device, wherein the fourth target electronic device is a second electronic device with the value of the idle resource space being larger than a third preset value;
Selecting a fourth target resource space with a fixed size in the fourth target electronic equipment, and distributing the fourth target resource space to the third job task;
and allocating a third target resource space in the third target electronic device to an idle resource space of the third target electronic device, wherein the third target resource space is a job space of the third job task, and the score value of the third target electronic device is higher than the score value of the fourth target electronic device.
In a second aspect, the present application further provides a resource allocation apparatus, including:
the first acquisition module is used for acquiring state information of a plurality of second electronic devices in the target area under the condition of receiving a job task, wherein the state information comprises an idle resource space and historical access flow;
the screening module is used for screening at least one target electronic device from the second electronic devices based on the state information;
and the allocation module is used for selecting a target resource space with a fixed size from the idle resource spaces of each target electronic device and allocating the selected target resource space to the job task.
Optionally, the idle resource space includes an idle storage resource space and an idle broadband resource space, and the filtering module includes:
the computing sub-module is used for respectively computing the grading value of each second electronic device based on the idle storage resource space, the idle broadband resource space and the heat value, wherein the heat value is a value computed based on the historical access flow;
and the determining submodule is used for respectively determining the first N second electronic devices with higher scoring values in the plurality of second electronic devices as the target electronic device, wherein N is an integer greater than or equal to 1.
In a third aspect, the present application provides an electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the resource allocation method steps provided herein.
In a fourth aspect, the present application provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the resource allocation method steps provided herein.
According to the method and the system, the plurality of second electronic devices serving as the edge nodes are arranged in the target area in advance, when a certain manufacturer needs to provide services for users by utilizing the edge nodes, at least one target electronic device is selected from the plurality of second electronic devices, and a target resource space with a fixed size is selected from each target electronic device to serve as a working space of the manufacturer. When the vendor does not need to use the edge node any more due to service change, the target resource space in each target electronic device can be directly released to the idle resource space, so that the target resource space can be conveniently used as the operation space of other vendors. Therefore, when different manufacturers need to provide services for users by using the edge nodes, only a certain resource space is needed to be divided from the target electronic equipment, node equipment is not needed to be deployed each time, and when the services are changed, only the working space is needed to be released, and the problem that the node equipment is discarded is avoided, so that the problem of resource waste in the process of providing services for users by using the edge nodes is solved.
Drawings
FIG. 1 is one of the flowcharts of the resource allocation method provided in the embodiments of the present application;
FIG. 2 is a second flowchart of a resource allocation method according to an embodiment of the present disclosure;
Fig. 3 is a schematic structural diagram of a resource allocation device according to an embodiment of the present application;
fig. 4 is a block diagram of an electronic device of a resource allocation method provided in an embodiment of the present application.
Detailed Description
Exemplary embodiments of the present application are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present application to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present application. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Referring to fig. 1, fig. 1 is a resource allocation method provided in an embodiment of the present application, which is applied to a first electronic device, and includes:
step S101, under the condition that a job task is received, acquiring state information of a plurality of second electronic devices in a target area, wherein the state information comprises an idle resource space and historical access flow;
the first electronic device may be a server for communicating with each second electronic device, and the second electronic device may be an edge node device deployed at a different location from the target area, and the edge node device may also be a server. Job data for executing job tasks of different manufacturers can be transmitted to each second electronic device through the first electronic device. For example, when the manufacturer is an curiosity, the video resources can be stored in each second electronic device through the first electronic device, so that when the user accesses the curiosity application to play the video, the video playing service can be provided for the user through the second electronic device which is closer to the location of the user, that is, the video resources on the second electronic device are sent to the user, so that the smoothness of playing the video resources by the user is improved.
The target area may be an administrative area such as a county level, a city level, a provincial level, or a country level. The acquiring the status information of the plurality of second electronic devices in the target area may refer to acquiring the status information of all the second electronic devices in the target area.
The idle resource space may refer to a storage resource space, a broadband resource space, an interface resource, and the like of the second electronic device. The historical access flow may refer to a number of times a user accesses a second electronic device during a period of time, where the number of times the user accesses the second electronic device may be a sum of the number of times the user accesses different services on the second electronic device. For example, if a certain second electronic device is used as an edge node for jittering, alien, and vacation, the historical access flow of the second electronic device is: the sum of the number of all trembling users, lover users, vacating users accessing the second electronic device over a period of time.
The received job task may be a job task sent by a manufacturer when the edge node needs to be deployed in the target area. For example, many users in the target area need to watch the video through video software developed by company a, and company a does not deploy edge nodes in the target area, so that when users in the target area play the video through the video software of company a, the problem that the users cannot play the video due to insufficient resources often occurs. Therefore, the company a can provide services for users by means of the second electronic devices already deployed in the target area for the second electronic devices in the area a, namely, at least one target electronic device is selected from the second electronic devices in the target area, a target resource space with a fixed size is selected from the idle resource spaces of each target electronic device, and the selected target resource space is distributed to the company a, so that the company a can pre-store video resources in the target resource spaces of all the target electronic devices through the first electronic devices, and users in the subsequent area a can directly receive the video resources sent by the target electronic devices.
When the second electronic device is deployed for the first time in the target area, the second electronic device can be deployed according to the population distribution thermodynamic diagram in the target area, namely, more second electronic devices are deployed in the densely populated area, and less or even no second electronic devices are deployed in the sparsely populated area.
Step S102, screening at least one target electronic device from the second electronic devices based on the state information;
when a job task is received, because not all the second electronic devices are suitable for running the job task, for example, there may be a part of second electronic devices that cannot receive a new job task due to insufficient storage resource space. Or, there may be a portion of the second electronic device that has been deployed for a relatively long time, but the historical access flow is very small, that is, it is indicated that the surrounding of the second electronic device may be too weak, and even if the job task can be deployed on the second electronic device, that is, the video resource is stored on the second electronic device, because the surrounding of the second electronic device is too weak, the user may access the service through the second electronic device, and thus the access pressure of the background server cannot be shared through the second electronic device.
Therefore, in the embodiment of the present application, the second electronic device with more idle resources and more historical access traffic in the target area may be selected as the target electronic device.
Step S103, selecting a target resource space with a fixed size from the idle resource spaces of each target electronic device, and allocating the selected target resource space to the job task.
The resource space of each target electronic device can be divided into a plurality of target resource spaces in advance, and each target resource space can be used as a working space of a working task of one manufacturer, so that each target electronic device can be used as an edge node of a plurality of manufacturers at the same time.
The idle resource space may refer to a resource space that does not currently have a job task. It should be noted that, after a certain target resource space is used as a job space of a certain job task, if the target resource space is not reassigned to an idle space, the target resource space is no longer used as a job space of another job task, and even if the job task is not executed currently in the target resource space, the target resource space cannot be used as a job space of another job task. And executing the new job task by the target resource space until the target resource space is reassigned to the idle space and a new job task is reassigned to the target resource space.
The above-mentioned target resource space with a fixed size may refer to a resource space with a fixed size, such as a storage resource space of 100Mbps and a broadband resource space of 500G, that is, a space with a size of 100Mbps is divided from the remaining storage space of the target electronic device, and a space with a size of 500G is divided from the remaining broadband resource space of the target electronic device as the target resource space.
In this embodiment, by deploying a plurality of second electronic devices as edge nodes in the target area in advance, when a manufacturer needs to provide services to a user by using the edge nodes, it is only necessary to select at least one target electronic device from the plurality of second electronic devices, and select a target resource space with a fixed size from each target electronic device as a working space of the manufacturer. When the vendor does not need to use the edge node any more due to service change, the target resource space in each target electronic device can be directly released to the idle resource space, so that the target resource space can be conveniently used as the working space of other vendors. Therefore, when different manufacturers need to provide services for users by using the edge nodes, only a certain resource space is needed to be divided from the target electronic equipment, node equipment is not needed to be deployed each time, and when the services are changed, only the working space is needed to be released, and the problem that the node equipment is discarded is avoided, so that the problem of resource waste in the process of providing services for users by using the edge nodes is solved.
Optionally, the idle resource space includes an idle storage resource space and an idle broadband resource space, and the screening at least one target electronic device from the plurality of second electronic devices based on the status information includes:
respectively calculating a grading value of each second electronic device based on the idle storage resource space, the idle broadband resource space and a heat value, wherein the heat value is a value calculated based on the historical access flow;
and respectively determining the first N second electronic devices with higher scoring values in the plurality of second electronic devices as the target electronic device, wherein N is an integer greater than or equal to 1.
In this embodiment, each second electronic device is scored based on the idle storage resource space, the idle broadband resource space and the popularity value, and the first N second electronic devices with higher scoring values in the plurality of second electronic devices are respectively determined as the target electronic devices. Therefore, the screened target electronic equipment can be ensured to be the second electronic equipment with more residual storage resources, more residual broadband resources and more visitor numbers in the target area, so that the service effect for users is improved.
Optionally, the calculating the score value of each second electronic device based on the idle storage resource space, the idle broadband resource space and the heat value includes:
calculating a scoring value for each of the second electronic devices according to the following formula:
wherein S is the scoring value, lambda is the adjustment factor, andfor values between 0 and 1 obtained after normalization of the heat values, the +.>For values between 0 and 1 obtained after normalizing the size of the free memory resource space, the +.>And (3) obtaining a numerical value between 0 and 1 after normalizing the size of the idle broadband resource space.
The adjustment factor may be any value between 0 and 1, and may be selected empirically to determine the weight of the heat value in the scoring value. The numerical value between 0 and 1 obtained after normalizing the heat valueThe process of (2) may be: determining a distribution range of heat values of all second electronic devices in the target area, e.g. a distribution range of [ A1, A2 ]]Then, a certain second electronic device e is obtained A heat value A3, wherein A1 is less than or equal to A3 is less than or equal to A2, and the heat value of the second electronic equipment e is normalized to be a numerical value +.>
The above determinationThe process of (1) determining the total amount of storage resource space B1 of the second electronic equipment e, and then determining the current idle storage resource space size B2 of the second electronic equipment e, then->Similarly, the above->The determination process of (1) is as follows: firstly, determining the total amount T1 of broadband resource space of the second electronic equipment e, then determining the current idle broadband resource space size T2 of the second electronic equipment e, and then +.>
In addition, the calculating the score value of each of the second electronic devices based on the idle storage resource space, the idle broadband resource space and the heat value may further include:
calculating a scoring value for each of the second electronic devices according to the following formula:
wherein λ1, λ2 and λ3 are adjustment factors between 0 and 1, respectively.
The difference between this embodiment and the above embodiment is that weights are set for the idle storage resource space, the idle broadband resource space, and the heat value, respectively, and a more reasonable scoring value is calculated according to the importance of the idle storage resource space, the idle broadband resource space, and the heat value.
In addition, the calculating the score value of each of the second electronic devices based on the idle storage resource space, the idle broadband resource space and the heat value may further include:
calculating a scoring value for each of the second electronic devices according to the following formula:
this implementation differs from the above-described embodiment in that each second electronic device is scored taking into account only the free storage resource space and the free broadband resource space.
Optionally, before calculating the score value of each of the second electronic devices based on the idle storage resource space, the idle broadband resource space and the heat value, the method further includes:
determining a first target device set H, wherein the first target device set H comprises state information of first M second electronic devices with higher historical access flow in the plurality of second electronic devices;
acquiring position information of each of the plurality of second electronic devices;
calculating the heat value of each of the second electronic devices according to the following formula:
wherein the Hot e The target second electronic device is any one of the plurality of second electronic devices, and the |P is the heat value of the target second electronic device e -P h I is a distance value between the target second electronic device and any second electronic device in the first target device set H, and P is e -P h The units of l are kilometers.
Specifically, the plurality of second electronic devices may be ordered based on access traffic of the plurality of second electronic devices, so as to select first M second electronic devices with higher heat from the plurality of second electronic devices, and store state information of the selected first M second electronic devices into the first target device set H. After the plurality of second electronic devices are ranked, the state information of the first 10% of the second electronic devices ranked first is selected and stored in the first target device set H.
Because the second electronic devices in the first target device set H are edge nodes with higher heat, the second electronic devices in the first target device set H are likely to be located in areas with higher people flow density. Correspondingly, if the other second electronic devices f outside the first target device set H are closer to the second electronic devices in the first target device set H, the likelihood that the second electronic devices f are located in the area with higher people flow density is higher, and accordingly the heat value is higher. Conversely, if the second electronic device f is further away from the second electronic devices in the first target device set H, it is indicated that the second electronic device f is less likely to be located in the area with higher people flow density, and accordingly the heat value is lower.
Thus, in calculating the heat value of the plurality of second electronic devices, the heat value of the second electronic device c to be calculated may be determined based on the relative distance between the second electronic device c to be calculated and each second electronic device of the first target device set H. For example, when the second electronic device c to be calculated is a certain second electronic device in the first target device set H, the distance between the second electronic device c and itself approaches 0, soNecessarily there is an |P e -P h I approaches 0, at which time lg P e -P h I approaches negative infinity, therefore, after summation +.>Approaching infinity, illustrating the second power in the first target device set HThe heat value of the sub-device c approaches positive infinity, i.e. the higher the corresponding heat value. When the distance between a certain second electronic device f and each second electronic device in the first target device set H is relatively long, for example, the distance between the second electronic device f and each second electronic device in the first target device set H is more than 10 km, i.e. & lt & gt>All |P in (3) e -P h The I are all greater than 10, i.e. +.>All (-lg|P) e -P h I) are negative values, in which case the sum is then given by +.>And also negative, indicating that the lower the heat of the second electronic device f. Based on this, by the formula- >After the heat value of each second electronic device is calculated, the heat value of each second electronic device can be judged according to the magnitude of the value.
Optionally, the method further comprises:
determining a second target electronic device, wherein the second target electronic device is a second electronic device which synchronously runs at least two different job tasks in the plurality of second electronic devices;
in the case that the at least two different job tasks include a first job task and a second job task, assigning a fixed-size first space in a first target resource space to the second job task;
the first job task is a job task of which the utilization rate of the target resource space in a first preset time period is smaller than a first preset value, the second job task is a job task of which the utilization rate of the target resource space in the first preset time period is larger than or equal to the first preset value, and the utilization rate of the target resource space in the first preset time period is continuously increased; the first target resource space is a job space of the first job task, and the second target resource space is a job space of the second job task.
Wherein, the first preset time period may be a time period of the past week, the past half month, the past month, etc.
The first target resource space may be a storage resource space of 100Mbps, and a broadband resource space of a fixed size such as 500G. The second target resource space may be a storage resource space of 100Mbps, and a broadband resource space of a fixed size of 500G or the like.
The usage of the target resource space may include a usage x% of the storage resource and a usage y% of the broadband resource. The first job task is a job task in which the usage rate of the target resource space in the first preset time period is smaller than the first preset value, and may refer to: the utilization rate of the storage resource of the first job task in the past month is lower than 50%, and the utilization rate of the broadband resource is also lower than 50%. The second job task is a job task in which the usage rate of the target resource space in the first preset time period is greater than or equal to a first preset value, and the usage rate of the target resource space in the first preset time period is continuously increased, and may refer to: the utilization rate of the storage resource of the second job task in the past month is higher than 50%, the utilization rate of the broadband resource is also higher than 50%, the utilization rate of the storage resource in each day is higher than the utilization rate of the storage resource in the previous day, and the utilization rate of the broadband resource in each day is also higher than the utilization rate of the broadband resource in the previous day.
The usage of the storage resource of the first job task may refer to a ratio between a space actually occupied by executing the first job task and a first target resource space. The usage of the storage resources may be calculated every thirty minutes and then averaged for a day to obtain the storage resource usage for that day. Similarly, the calculation process of the utilization rate of the storage resources of the job tasks other than the first job task may be calculated according to the above-described method. In addition, the calculation process of the utilization rate of the broadband resource may also be calculated according to the above method.
The first space may be 10% of the first target resource space.
In this embodiment, by determining the second target electronic devices that simultaneously run at least two job tasks, then monitoring the usage rate of the target resource space of each job task in each second target electronic device, and transferring the space of the first job task whose usage rate of the target resource space is low to the second job task whose usage rate of the target resource space is high and whose usage rate of the target resource space is continuously rising. Therefore, the space occupied by each operation task in the second target electronic equipment is dynamically conditioned. And each job task is ensured to normally run on the second target electronic equipment, so that the utilization rate of resources is improved.
Optionally, the method further comprises:
determining a third target electronic device, wherein the third target electronic device is a second electronic device running a third job task in the plurality of second electronic devices, and the third job task is a job task in which the utilization rate of the target resource space is smaller than a second preset value in a second preset time period;
determining a fourth target electronic device within a range of a preset distance from the third target electronic device, wherein the fourth target electronic device is a second electronic device with the value of the idle resource space being larger than a third preset value;
selecting a fourth target resource space with a fixed size in the fourth target electronic equipment, and distributing the fourth target resource space to the third job task;
and distributing a third target resource space in the third target electronic equipment to an idle resource space of the third target electronic equipment, wherein the third target resource space is a job space of the third job task.
The third target resource space may be a storage resource space of 100Mbps, and a broadband resource space of a fixed size such as 500G.
The third target electronic device may execute other job tasks in addition to the third job task. The second preset time period may be a time period of the past week, the past half month, the past month, or the like. The second preset value may be 10% of the third target resource space. The predetermined distance may be in the range of 3 km to 5 km. In addition, the third target electronic device may be a second electronic device in the first target device set H, and the fourth target electronic device may be a second electronic device other than the first target device set H.
The fourth target resource space may be a storage resource space of 100Mbps, and a broadband resource space of a fixed size such as 500G.
In this embodiment, by determining the third job task with a low resource utilization rate in the third target electronic device and migrating the third job task to the fourth target electronic device with a low score value, the resource rate of the job task running on the edge node with a high score value is ensured to be relatively high, and the resource rate of the whole edge node with a high quality is fully utilized.
Referring to fig. 2, a resource allocation method provided in an embodiment of the present application includes the following specific processes: (1) Deploying a plurality of second electronic devices in the target area based on the position information and the people flow thermodynamic diagram; the second electronic equipment is deployed according to the people stream density of each position, and the higher the people stream density is, the denser the second electronic equipment is deployed. (2) And under the condition that the job task is received for the first time, at least one target electronic device is screened out from the plurality of second electronic devices based on the position information and the people flow thermodynamic diagram. That is, when the job task is received for the first time after the deployment of the second electronic devices is completed, the scoring values of the second electronic devices are identical, so that at least one target electronic device is selected from the plurality of second electronic devices based on the position information and the people flow thermodynamic diagram. (3) And screening at least one target electronic device from the plurality of second electronic devices based on the state information under the condition that the job task is subsequently received. After the first job task is deployed, the historical flow and the residual resource quantity of each second electronic device gradually differ, so that the scoring values of each second electronic device differ, and subsequently, the subsequently received job task can be deployed according to the resource allocation method. (3) The method comprises the steps of monitoring the utilization rate of a target resource space of a job task running on each second electronic device, and distributing a first space with a fixed size in a first target resource space to the second job task when at least two different job tasks of the second target electronic device are monitored, wherein the first job task is a job task with the utilization rate of the target resource space being smaller than a first preset value in a first preset time period, the second job task is a job task with the utilization rate of the target resource space being larger than or equal to the first preset value in the first preset time period, and the utilization rate of the target resource space is continuously increased in the first preset time period; the first target resource space is a job space of the first job task, and the second target resource space is a job space of the second job task. (4) And under the condition that the existence of the third target electronic equipment is detected, migrating a third job task from the third target electronic equipment to fourth target electronic equipment, wherein the third target electronic equipment is second electronic equipment running the third job task in the plurality of second electronic equipment, and the third job task is a job task with the use rate of the target resource space being smaller than a second preset value in a second preset time period. The migrating the third job task from the third target electronic device to the fourth target electronic device includes: determining a fourth target electronic device within a range of a preset distance from the third target electronic device, wherein the fourth target electronic device is a second electronic device with the value of the idle resource space being larger than a third preset value; selecting a fourth target resource space with a fixed size in the fourth target electronic equipment, and distributing the fourth target resource space to the third job task; and allocating a third target resource space in the third target electronic device to an idle resource space of the third target electronic device, wherein the third target resource space is a job space of the third job task, and the score value of the third target electronic device is higher than the score value of the fourth target electronic device.
Referring to fig. 3, fig. 3 is a resource allocation apparatus 300 provided in an embodiment of the present application, including:
the first obtaining module 301 is configured to obtain status information of a plurality of second electronic devices in a target area when a job task is received, where the status information includes an idle resource space and a historical access flow;
a screening module 302, configured to screen at least one target electronic device from the plurality of second electronic devices based on the status information;
an allocation module 303, configured to select a target resource space with a fixed size from the idle resource spaces of each of the target electronic devices, and allocate the selected target resource space to the job task.
Optionally, the free resource space includes a free storage resource space and a free broadband resource space, and the filtering module 302 includes:
the computing sub-module is used for respectively computing the grading value of each second electronic device based on the idle storage resource space, the idle broadband resource space and the heat value, wherein the heat value is a value computed based on the historical access flow;
and the determining submodule is used for respectively determining the first N second electronic devices with higher scoring values in the plurality of second electronic devices as the target electronic device, wherein N is an integer greater than or equal to 1.
Optionally, the computing submodule: the method is specifically used for calculating the scoring value of each second electronic device according to the following formula:
wherein S is the scoring value, lambda is the adjustment factor, andfor values between 0 and 1 obtained after normalization of the heat values, the +.>For values between 0 and 1 obtained after normalizing the size of the free memory resource space, the +.>And (3) obtaining a numerical value between 0 and 1 after normalizing the size of the idle broadband resource space.
Optionally, the apparatus further comprises:
the first determining module is used for determining a first target equipment set H, wherein the first target equipment set H comprises state information of first M second electronic equipment with higher historical access flow in the plurality of second electronic equipment;
the second acquisition module is used for acquiring the position information of each second electronic device in the plurality of second electronic devices;
a calculation module, configured to calculate the heat value of each of the second electronic devices according to the following formula:
wherein the Hot e The target second electronic device is any one of the plurality of second electronic devices, and the |P is the heat value of the target second electronic device e -P h And I is the distance value between the target second electronic equipment and any second electronic equipment in the first target equipment set H.
Optionally, the apparatus further comprises:
the second determining module is used for determining a second target electronic device, wherein the second target electronic device is a second electronic device which synchronously runs at least two different job tasks in the plurality of second electronic devices;
the allocating module 303 is further configured to, in a case where the at least two different job tasks include a first job task and a second job task, allocate a first space with a fixed size in a first target resource space to the second job task;
the first job task is a job task of which the utilization rate of the target resource space in a first preset time period is smaller than a first preset value, the second job task is a job task of which the utilization rate of the target resource space in the first preset time period is larger than or equal to the first preset value, and the utilization rate of the target resource space in the first preset time period is continuously increased; the first target resource space is a job space of the first job task, and the second target resource space is a job space of the second job task.
Optionally, the apparatus further comprises:
a third determining module, configured to determine a third target electronic device, where the third target electronic device is a second electronic device that runs a third job task in the plurality of second electronic devices, where the third job task is a job task in which usage rates of target resource spaces in a second preset time period are all smaller than a second preset value;
a fourth determining module, configured to determine a fourth target electronic device within a range of a preset distance from the third target electronic device, where the fourth target electronic device is a second electronic device whose value of the idle resource space is greater than a third preset value;
the allocation module 303 is further configured to select a fourth target resource space with a fixed size in the fourth target electronic device, and allocate the fourth target resource space to the third job task;
the allocation module 303 is further configured to allocate a third target resource space in the third target electronic device to an idle resource space of the third target electronic device, where the third target resource space is a job space of the third job task, and a score value of the third target electronic device is higher than a score value of the fourth target electronic device.
The resource allocation device 300 provided in this embodiment can implement each process in the method embodiment shown in fig. 1-2, and can achieve the same beneficial effects, and for avoiding repetition, the description is omitted here.
According to embodiments of the present application, an electronic device and a readable storage medium are also provided.
As shown in fig. 4, a block diagram of an electronic device according to a resource allocation method according to an embodiment of the present application is shown. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the application described and/or claimed herein.
As shown in fig. 4, the electronic device includes: one or more processors 401, memory 402, and interfaces for connecting the components, including a high-speed interface and a low-speed interface. The various components are interconnected using different buses and may be mounted on a common motherboard or in other manners as desired. The processor may process instructions executing within the electronic device, including instructions stored in or on memory to display graphical information of the GUI on an external input/output device, such as a display device coupled to the interface. In other embodiments, multiple processors and/or multiple buses may be used, if desired, along with multiple memories and multiple memories. Also, multiple electronic devices may be connected, each providing a portion of the necessary operations (e.g., as a server array, a set of blade servers, or a multiprocessor system). One processor 401 is illustrated in fig. 4.
Memory 402 is a non-transitory computer-readable storage medium provided herein. Wherein the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the resource allocation method provided herein. The non-transitory computer readable storage medium of the present application stores computer instructions for causing a computer to perform the resource allocation method provided by the present application.
The memory 402 is used as a non-transitory computer readable storage medium, and may be used to store a non-transitory software program, a non-transitory computer executable program, and modules, such as program instructions/modules (e.g., the first acquisition module 301, the screening module 302, and the allocation module 303 shown in fig. 3) corresponding to the resource allocation method in the embodiments of the present application. The processor 401 executes various functional applications of the server and data processing, i.e., implements the resource allocation method in the above-described method embodiments, by running non-transitory software programs, instructions, and modules stored in the memory 402.
Memory 402 may include a storage program area that may store an operating system, at least one application program required for functionality, and a storage data area; the storage data area may store data created according to the use of the electronic device of the resource allocation method, and the like. In addition, memory 402 may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory 402 may optionally include memory remotely located with respect to processor 401, which may be connected to the electronic device of the resource allocation method via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The electronic device of the resource allocation method may further include: an input device 403 and an output device 404. The processor 401, memory 402, input device 403, and output device 404 may be connected by a bus or otherwise, for example in fig. 4.
The input device 403 may receive input numeric or character information and generate key signal inputs related to user settings and function control of the electronic device of the resource allocation method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, a pointer stick, one or more mouse buttons, a track ball, a joystick, etc. input devices. The output device 404 may include a display apparatus, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors), among others. The display device may include, but is not limited to, a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display, and a plasma display. In some implementations, the display device may be a touch screen.
Various implementations of the systems and techniques described here can be realized in digital electronic circuitry, integrated circuitry, application specific ASIC (application specific integrated circuit), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
These computing programs (also referred to as programs, software applications, or code) include machine instructions for a programmable processor, and may be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and/or device (e.g., magnetic discs, optical disks, memory, programmable Logic Devices (PLDs)) used to provide machine instructions and/or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal used to provide machine instructions and/or data to a programmable processor.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other.
According to the technical scheme of the embodiment of the application, a plurality of second electronic devices serving as edge nodes are arranged in the target area in advance, when a manufacturer needs to provide services for a user by utilizing the edge nodes, at least one target electronic device is selected from the plurality of second electronic devices, and a target resource space with a fixed size is selected from each target electronic device to serve as a working space of the manufacturer. When the vendor does not need to use the edge node any more due to service change, the target resource space in each target electronic device can be directly released to the idle resource space, so that the target resource space can be conveniently used as the operation space of other vendors. Therefore, when different manufacturers need to provide services for users by using the edge nodes, only a certain resource space is needed to be divided from the target electronic equipment, node equipment is not needed to be deployed each time, and when the services are changed, only the working space is needed to be released, and the problem that the node equipment is discarded is avoided, so that the problem of resource waste in the process of providing services for users by using the edge nodes is solved.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present application may be performed in parallel, sequentially, or in a different order, provided that the desired results of the technical solutions disclosed in the present application can be achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (7)

1. A resource allocation method applied to a first electronic device, comprising:
under the condition of receiving a job task, acquiring state information of a plurality of second electronic devices in a target area, wherein the state information comprises an idle resource space and historical access flow;
screening at least one target electronic device from the plurality of second electronic devices based on the state information;
Selecting a target resource space with a fixed size from the idle resource spaces of each target electronic device, and distributing the selected target resource space to the job task;
the idle resource space comprises an idle storage resource space and an idle broadband resource space, and the screening at least one target electronic device from the plurality of second electronic devices based on the state information comprises the following steps:
respectively calculating a grading value of each second electronic device based on the idle storage resource space, the idle broadband resource space and a heat value, wherein the heat value is a value calculated based on the historical access flow;
respectively determining the first N second electronic devices with higher scoring values in the plurality of second electronic devices as the target electronic device, wherein N is an integer greater than or equal to 1;
before calculating the score value of each second electronic device based on the idle storage resource space, the idle broadband resource space and the heat value, the method further includes:
determining a first target device set H, wherein the first target device set H comprises state information of first M second electronic devices with higher historical access flow in the plurality of second electronic devices;
Acquiring position information of each of the plurality of second electronic devices;
calculating the heat value of each of the second electronic devices according to the following formula:
wherein the Hot e Is the object ofA heat value of a second electronic device, wherein the target second electronic device is any one of the plurality of second electronic devices, and the |p e -P h And I is the distance value between the target second electronic equipment and any second electronic equipment in the first target equipment set H.
2. The method of claim 1, wherein the calculating the scoring value for each of the second electronic devices based on the free storage resource space, the free broadband resource space, and the hot value, respectively, comprises:
calculating a scoring value for each of the second electronic devices according to the following formula:
wherein S is the scoring value, lambda is the adjustment factor, andfor values between 0 and 1 obtained after normalization of the heat values, the +.>For values between 0 and 1 obtained after normalizing the size of the free memory resource space, the +.>And (3) obtaining a numerical value between 0 and 1 after normalizing the size of the idle broadband resource space.
3. The method according to claim 1, wherein the method further comprises:
determining a second target electronic device, wherein the second target electronic device is a second electronic device which synchronously runs at least two different job tasks in the plurality of second electronic devices;
in the case that the at least two different job tasks include a first job task and a second job task, assigning a fixed-size first space in a first target resource space to the second job task;
the first job task is a job task of which the utilization rate of the target resource space in a first preset time period is smaller than a first preset value, the second job task is a job task of which the utilization rate of the target resource space in the first preset time period is larger than or equal to the first preset value, and the utilization rate of the target resource space in the first preset time period is continuously increased; the first target resource space is a job space of the first job task, and the second target resource space is a job space of the second job task.
4. The method according to claim 1, wherein the method further comprises:
Determining a third target electronic device, wherein the third target electronic device is a second electronic device running a third job task in the plurality of second electronic devices, and the third job task is a job task in which the utilization rate of the target resource space is smaller than a second preset value in a second preset time period;
determining a fourth target electronic device within a range of a preset distance from the third target electronic device, wherein the fourth target electronic device is a second electronic device with the value of the idle resource space being larger than a third preset value;
selecting a fourth target resource space with a fixed size in the fourth target electronic equipment, and distributing the fourth target resource space to the third job task;
and allocating a third target resource space in the third target electronic device to an idle resource space of the third target electronic device, wherein the third target resource space is a job space of the third job task, and the score value of the third target electronic device is higher than the score value of the fourth target electronic device.
5. A resource allocation apparatus, comprising:
the first acquisition module is used for acquiring state information of a plurality of second electronic devices in the target area under the condition of receiving a job task, wherein the state information comprises an idle resource space and historical access flow;
The screening module is used for screening at least one target electronic device from the second electronic devices based on the state information;
the allocation module is used for selecting a target resource space with a fixed size from the idle resource spaces of each target electronic device and allocating the selected target resource space to the job task;
the idle resource space comprises an idle storage resource space and an idle broadband resource space, and the screening module comprises:
the computing sub-module is used for respectively computing the grading value of each second electronic device based on the idle storage resource space, the idle broadband resource space and the heat value, wherein the heat value is a value computed based on the historical access flow;
a determining submodule, configured to determine first N second electronic devices with higher scoring values in the plurality of second electronic devices as the target electronic device, where N is an integer greater than or equal to 1;
the apparatus further comprises:
the first determining module is used for determining a first target equipment set H, wherein the first target equipment set H comprises state information of first M second electronic equipment with higher historical access flow in the plurality of second electronic equipment;
The second acquisition module is used for acquiring the position information of each second electronic device in the plurality of second electronic devices;
a calculation module, configured to calculate the heat value of each of the second electronic devices according to the following formula:
wherein the Hot e The target second electronic device is any one of the plurality of second electronic devices, and the |P is the heat value of the target second electronic device e -P h And I is the distance value between the target second electronic equipment and any second electronic equipment in the first target equipment set H.
6. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-4.
7. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-4.
CN202010640962.9A 2020-07-06 2020-07-06 Resource allocation method and device and electronic equipment Active CN111796940B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010640962.9A CN111796940B (en) 2020-07-06 2020-07-06 Resource allocation method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010640962.9A CN111796940B (en) 2020-07-06 2020-07-06 Resource allocation method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN111796940A CN111796940A (en) 2020-10-20
CN111796940B true CN111796940B (en) 2024-01-26

Family

ID=72811317

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010640962.9A Active CN111796940B (en) 2020-07-06 2020-07-06 Resource allocation method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN111796940B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491740B (en) * 2020-12-18 2024-02-20 中国卫通集团股份有限公司 Resource allocation method and device for satellite transponder
CN112506619B (en) * 2020-12-18 2023-08-04 北京百度网讯科技有限公司 Job processing method, job processing device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105850099A (en) * 2013-10-23 2016-08-10 英派尔科技开发有限公司 Local management for intermediary graphics rendition
CN106959983A (en) * 2016-01-08 2017-07-18 深圳市星电商科技有限公司 The method and apparatus of resource-sharing
WO2017133351A1 (en) * 2016-02-05 2017-08-10 华为技术有限公司 Resource allocation method and resource manager
WO2018121549A1 (en) * 2016-12-26 2018-07-05 腾讯科技(深圳)有限公司 Information analysis method, electronic device and storage medium
KR20190051878A (en) * 2017-11-07 2019-05-15 고려대학교 산학협력단 System of utilizing of idle computing resource, computing apparatus and method of the same

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105850099A (en) * 2013-10-23 2016-08-10 英派尔科技开发有限公司 Local management for intermediary graphics rendition
CN106959983A (en) * 2016-01-08 2017-07-18 深圳市星电商科技有限公司 The method and apparatus of resource-sharing
WO2017133351A1 (en) * 2016-02-05 2017-08-10 华为技术有限公司 Resource allocation method and resource manager
WO2018121549A1 (en) * 2016-12-26 2018-07-05 腾讯科技(深圳)有限公司 Information analysis method, electronic device and storage medium
KR20190051878A (en) * 2017-11-07 2019-05-15 고려대학교 산학협력단 System of utilizing of idle computing resource, computing apparatus and method of the same

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
边缘计算迁移研究综述;朱友康;乐光学;杨晓慧;刘建生;;电信科学(第04期);全文 *

Also Published As

Publication number Publication date
CN111796940A (en) 2020-10-20

Similar Documents

Publication Publication Date Title
CN111694646B (en) Resource scheduling method, device, electronic equipment and computer readable storage medium
JP7042897B2 (en) Model parameter update method and equipment
WO2021036936A1 (en) Method and apparatus for allocating resources and tasks in distributed system, and system
JP2022023769A (en) Method for allocating server resource, device, electronic device, computer readable storage medium and computer program
CN111796940B (en) Resource allocation method and device and electronic equipment
CN104246741A (en) Orchestrating hybrid cloud services
CN111240836A (en) Computing resource management method and device, electronic equipment and storage medium
CN111880914A (en) Resource scheduling method, resource scheduling apparatus, electronic device, and storage medium
CN106663012B (en) Hardware acceleration method and related equipment
CN112015521A (en) Configuration method and device of inference service, electronic equipment and storage medium
JP7170768B2 (en) Development machine operation task processing method, electronic device, computer readable storage medium and computer program
CN111970132B (en) Control method, device and server for OTA data packet issuing flow
CN111459645B (en) Task scheduling method and device and electronic equipment
CN110399213A (en) Determine method, apparatus, electronic equipment and the medium of the resource requirement of application program
CN111158909B (en) Cluster resource allocation processing method, device, equipment and storage medium
CN111625949A (en) Simulation engine system, simulation processing method, device and medium
JP7182836B2 (en) Automatic Diagonal Scaling of Workloads in Distributed Computing Environments
US20170315712A1 (en) Feature Switching In A Multi-Tenant Cloud Service
CN111176838B (en) Method and device for distributing embedded vector to node in bipartite graph
CN113760527A (en) Resource control method and device
CN111506414B (en) Resource scheduling method, device, equipment, system and readable storage medium
CN110889141A (en) Data distribution map privacy processing method and device and electronic equipment
CN112416593B (en) Resource management method and device, electronic equipment and computer readable medium
CN112532483A (en) Test method, test device, electronic equipment and storage medium
US10990434B2 (en) Increasing processing capacity of virtual machines for an abnormal event

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
CB02 Change of applicant information

Address after: Room 101, floors 1-3, building 14, North District, yard 9, dongran North Street, Haidian District, Beijing 100029

Applicant after: CHINA TOWER Co.,Ltd.

Address before: 100142 19th floor, 73 Fucheng Road, Haidian District, Beijing

Applicant before: CHINA TOWER Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant