WO2023134403A1 - Internet of things resource allocation method and system, terminal and storage medium - Google Patents

Internet of things resource allocation method and system, terminal and storage medium Download PDF

Info

Publication number
WO2023134403A1
WO2023134403A1 PCT/CN2022/140066 CN2022140066W WO2023134403A1 WO 2023134403 A1 WO2023134403 A1 WO 2023134403A1 CN 2022140066 W CN2022140066 W CN 2022140066W WO 2023134403 A1 WO2023134403 A1 WO 2023134403A1
Authority
WO
WIPO (PCT)
Prior art keywords
moth
flame
vector
resource
resource allocation
Prior art date
Application number
PCT/CN2022/140066
Other languages
French (fr)
Chinese (zh)
Inventor
吴嘉澍
王洋
金铭
叶可江
须成忠
Original Assignee
中国科学院深圳先进技术研究院
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 中国科学院深圳先进技术研究院 filed Critical 中国科学院深圳先进技术研究院
Publication of WO2023134403A1 publication Critical patent/WO2023134403A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application belongs to the field of Internet of Things application technology, and in particular relates to a resource allocation method, system, terminal and storage medium of the Internet of Things.
  • IoT devices With the rapid development of IoT technology and the rapid popularization of IoT devices in people's production and life, IoT devices have made many application scenarios more intelligent. For example, in smart medical care, patient health monitoring is performed through IoT devices, and in smart logistics, parcels are automatically delivered through IoT devices.
  • IoT devices are often heterogeneous. For example, different IoT devices may have different availability times and usage costs. Similarly, scenarios driven by IoT devices are also heterogeneous, such as scenarios with sufficient resources and scenarios with scarce resources.
  • each application task may request one or more types of IoT devices to complete this task. Also, each application task typically specifies a demand period for each resource required by the task.
  • IoT tasks how to efficiently allocate heterogeneous resources for these tasks with resource requirements, so as to maximize the benefits obtained by satisfying tasks and reduce the cost of satisfying tasks through more effective resource allocation. The cost has become an urgent problem to be solved.
  • the Internet of Things resource allocation scheme in the prior art mainly proceeds from two perspectives, specifically:
  • the above-mentioned IoT resource allocation models are only aimed at the allocation of IoT resources in a single scenario.
  • the above-mentioned IoT resource allocation models are aimed at the allocation of computing, storage, and communication resources in IoT devices, but do not regard IoT device resources as a whole and allocate resources at the IoT device level.
  • these allocation models do not take into account that the task's request for resources has a time limit, and do not adopt a reserved resource allocation method, which may cause resource deadlocks.
  • the above-mentioned IoT resource allocation models do not adopt any unified IoT device resource management framework.
  • IoT resource allocation model only optimizes a certain cost, without considering the cost of satisfying the service and the benefits of satisfying the service at the same time.
  • Moth-flame optimization algorithm A novel nature-inspired heuristic compassion. Knowledge-based systems 89, 228–249.], which simulates the moth The flight navigation mechanism of the moth guides the optimal search in the solution space. Among the above-mentioned optimization methods, the moth-flame algorithm has the best performance. However, the moth-flame algorithm still has the following disadvantages:
  • the moth-flame algorithm uses a purely random moth initialization mechanism that does not use additional information at all, and does not take any additional model information into account, so its effect is not good.
  • each moth only matches one flame, which is easy to cause a local optimal solution dilemma, so that the algorithm cannot effectively approach the optimal solution.
  • the moth flame-fighting algorithm adopts a matching mechanism that uniformly matches the worst survival flame for all moths whose corresponding flames have been eliminated.
  • the matching mechanism for matching the worst survival flame is unreasonable, and the worst survival flame is often far from the optimal solution. Using multiple moths to match the same flame will also cause the algorithm to fall into a local optimal solution to a large extent, thus damaging the optimization effect of the algorithm.
  • the present application provides an Internet of Things resource allocation method, system, terminal and storage medium, aiming to solve one of the above-mentioned technical problems in the prior art at least to a certain extent.
  • a method for allocating Internet of Things resources comprising:
  • the target and density-aware algorithm is used to initialize the moth vector set of the moth-flaming algorithm, and the initialized moth vector set is obtained;
  • the resource abstraction architecture of the Internet of Things based on digital objects uses a resource scheduling and allocation algorithm to execute the resource allocation plan, and performs resource scheduling and allocation for the task request.
  • the technical solution adopted in the embodiment of the present application also includes: the initialization of the moth vector set of the moth-flaming algorithm by using the target and density-sensing algorithm is specifically:
  • the resource scenario includes a resource-sufficient scenario and a resource-poor scenario
  • the technical solution adopted in the embodiment of the present application also includes: based on the new flame vector, using the progressive class flame matching algorithm and the exploratory moth flame matching algorithm to calculate the class flame corresponding to the moth includes:
  • the exploratory moth flame matching algorithm is used to calculate the class flame according to the progressive coefficient, and the moth is matched with the corresponding class flame.
  • the technical solution adopted in the embodiment of the present application also includes: the stepwise flame matching algorithm is used to calculate the class flame according to the progressive coefficient, and the moth is matched with the corresponding class flame, specifically:
  • the matching method is:
  • flame matching is performed based on the flame corresponding to the moth and the three flames with the highest health values:
  • w is a progressive coefficient that increases linearly from 0 to 1 as the iteration progresses
  • F i is the flame corresponding to the moth
  • F 1 , F 2 , and F 3 are the three flames with the highest health values
  • F 1 , F 2 , and F 3 are given weights of 0.15, 0.1, and 0.05 respectively, and the flame with the highest health value has the highest weight
  • the matching method is:
  • the technical solution adopted in the embodiment of the present application also includes: using the exploratory moth flame matching algorithm, calculating the class flame according to the progressive coefficient, and matching the moth with the corresponding class flame, specifically:
  • the matching method is:
  • moth-flame matching is performed based on the randomly selected surviving flames and the three flames with the highest health values:
  • the moth position is updated according to the flame matching result.
  • the technical solution adopted in the embodiment of the present application also includes: the abstract architecture of the Internet of Things resources based on digital objects, and the resource allocation model adopts the resource scheduling and allocation algorithm to execute the resource allocation scheme, which is specifically:
  • the resource allocation model transmits the task request to the digital object of the IoT device, the digital object includes an API module and a communication module, and the API module is used to judge whether the IoT device can meet the task request, and if it can be satisfied, the Satisfied task request information is sent back to the resource allocation model; if the IoT device cannot satisfy the task request, it communicates with other similar IoT devices through the communication module, and sends the task request to other similar IoT devices.
  • the technical solution adopted in the embodiment of the present application also includes: the resource allocation model adopts a resource scheduling and allocation algorithm to implement a resource allocation plan, specifically:
  • the lengths of the moth vector and the flame vector are the quantity requested by the task;
  • the assigned task request judge whether all the required resources of the task request in the assigned resource scenario can be satisfied on demand, and if it can be satisfied on demand, the task request in the assigned resource scenario is allocated on demand and on time
  • the requested resources update the resource availability in the assigned resource scenario, and calculate the benefits, costs and optimization goals of meeting the task in the assigned resource scenario; otherwise, if it cannot be satisfied on demand, make the task request Lost.
  • an Internet of Things resource allocation system including:
  • Initialization module used to initialize the moth vector set of the moth-flaming algorithm by using the target and density-aware algorithm based on the received resource allocation task request, and obtain the initialized moth vector set;
  • Health value evaluation module used to evaluate the health value of each moth in the initialized moth vector set, and select the top k moths with the highest health value as new flame vectors;
  • Moth-flame matching module used to calculate the class flame corresponding to the moth by using the progressive class flame matching algorithm and the exploratory moth flame matching algorithm based on the new flame vector, and match the moth with the corresponding class flame, And when there is only one surviving flame, generate a resource allocation plan for the task request according to the surviving flame;
  • Resource allocation module used for the resource abstraction architecture of the Internet of Things based on digital objects, adopting resource scheduling and allocation algorithms to implement the resource allocation plan, and performing resource scheduling and allocation for the task requests.
  • a terminal includes a processor and a memory coupled to the processor, wherein,
  • the memory stores program instructions for realizing the resource allocation method of the Internet of Things
  • the processor is configured to execute the program instructions stored in the memory to control resource allocation of the Internet of Things.
  • a storage medium storing program instructions executable by a processor, and the program instructions are used to execute the method for allocating resources of the Internet of Things.
  • the beneficial effect of the embodiment of the present application is that: the Internet of Things resource allocation method, system, terminal, and storage medium of the embodiment of the present application introduce an abstract framework of Internet of Things resources based on digital objects in the resource allocation model, Using the concept of digital objects, heterogeneous IoT devices form a digital object architecture, which facilitates the management of IoT device resources and the coordination between resources in resource allocation.
  • the resource allocation model simultaneously optimizes the benefits generated by satisfying the tasks and the costs caused by satisfying the tasks. The optimization goal considers both benefits and costs, which is more practical .
  • the moth-flame optimizer with multiple improvements is used for optimization, so as to meet the profit and cost of the task as the common optimization goal, and optimize the allocation of the proposed resource allocation model, so as to obtain a better resource allocation plan for IoT devices .
  • the present application has at least the following beneficial effects:
  • the target and density-sensing algorithm are introduced for initialization, which can eliminate the relatively dense moth vectors in the initialization moth vector set, thereby enhancing the performance of the swarm-based algorithm, so that the initialization process can optimize the target Under the guidance of , it becomes more refined and solves the damage to the effect of the optimization algorithm caused by random initialization.
  • the exploration and excavation can be better balanced in the training process, thereby better approaching the optimal solution, avoiding a single matching mechanism, and making the algorithm It is less likely to fall into a local optimal solution.
  • the abstract framework of Internet of Things resources based on digital objects uses the concept of digital objects to manage and dispatch a variety of Internet of Things devices in a unified manner, covering up the diversity of various Internet of Things devices, thus making the Internet of Things devices.
  • the management of resources and the coordination between resources in resource allocation become more convenient, which solves the resource management difficulties caused by the heterogeneity of IoT devices.
  • Fig. 1 is the flowchart of the Internet of Things resource allocation method of the embodiment of the present application
  • Fig. 2 is a schematic diagram of the initialization process based on the target and density sensing algorithm in the embodiment of the present application;
  • Fig. 3 is a schematic diagram of the asymptotic class flame matching algorithm in the embodiment of the present application.
  • Fig. 4 is the schematic diagram of the exploratory moth flame matching algorithm of the embodiment of the present application.
  • FIG. 5 is a schematic diagram of a resource scheduling and allocation algorithm in an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an Internet of Things resource allocation system according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of a storage medium according to an embodiment of the present application.
  • FIG. 1 is a flowchart of a method for allocating resources of the Internet of Things according to an embodiment of the present application.
  • the Internet of Things resource allocation method in the embodiment of the present application includes the following steps:
  • S10 Receive a task request requesting resource allocation through the resource allocation model, and based on the received task request, use the target and density sensing algorithm to initialize the moth vector set of the moth-flaming algorithm, and obtain the initialized moth vector set;
  • the moth-to-flame algorithm is a population-based genetic algorithm, by using multiple searchers, it has a greater possibility of approaching the global optimal solution. Therefore, in the initial stage of the algorithm, a set of moth vectors needs to be initialized to generate a set number of moth vectors.
  • the present invention initializes the moth vector set of the moth flame attack algorithm based on the target and density sensing algorithm.
  • the algorithm uses the optimization target as prior knowledge to guide the initialization, and increases the alienation of the initialized moth vectors according to its density sensing characteristics. to improve the performance of the algorithm.
  • Figure 2 it is a schematic diagram of the initialization process based on the target and density-aware algorithm in the embodiment of the present application, and the initialization process includes the following steps:
  • the embodiment of the present application includes two kinds of resource scenarios with resource heterogeneity, that is, the scenario R with sufficient resources and the scenario S with scarce resources, so as to reflect the uneven resource allocation that usually occurs in real application scenarios.
  • the scenario R with sufficient resources a large hospital is a scenario with sufficient resources
  • a community clinic is a scenario with scarce resources
  • a central warehouse is a scenario with sufficient resources
  • a regional post office is a scenario with scarce resources.
  • a mobile health monitor starts to be available at 9:00 am and ends at 6:00 pm, then its available period is from 9:00 am to 6:00 pm. If the mobile health monitor is requested to be occupied between 10:00 am and 11:00 am, the available time period of the device is updated as 9:00 am to 10:00 am, and 11:00 am to 6:00 pm.
  • each resource request will specify the start time and end use time, recorded as and
  • the resource request of a certain task is: to use an IoT device from 9:00 am to 9:30 am, that is, the request specifies a start time of 9:00 am and an end time of 9:30 am.
  • each IoT device will generate a cost per unit time, which is denoted as Define the usage period length len of each resource as: Therefore, the total cost generated under the allocation scheme A is defined as:
  • the usage cost may also include other costs such as energy usage overhead, making the definition of heterogeneous cost universal.
  • the optimization objective of the resource allocation model in the embodiment of the present application takes into account both the cost and the income generated by satisfying the task, so the final optimization objective is to minimize the cost while optimizing the income.
  • the final optimization goal is:
  • w is the trade-off coefficient, which is a negative value, Represents the optimized resource allocation scheme.
  • the embodiment of the present application guides the initialization process of initializing the moth vector set by using the income, the cost and the optimization objective, so that the initialization method is more reasonable, thereby effectively improving the efficiency of the algorithm.
  • S12 Determine whether the number of initialized moth vectors in the initialized moth vector set has reached the set multiple of the set number, if not, execute S13; otherwise, execute S14;
  • the length of each initialization moth vector is the number of tasks to be allocated resources.
  • the initialized moth vectors When generating the initialized moth vectors, generate 1.5 times more initialized moth vectors than the set number, and the specific multiple can be set according to the actual application.
  • S14 Use the target and density sensing algorithm to find out the two initialization moth vectors with the smallest distance (that is, the closest distance) from the initialization moth vector set, and use the mean vector of the two initialization moth vectors as a new moth vector.
  • the moth vector is added to the set of initialized moth vectors, and the two initialized moth vectors are deleted from the set of initialized moth vectors;
  • the embodiment of the present application continuously finds two initialization moth vectors with the smallest distance from the generated initialization moth vector set by using the target and density sensing algorithm, and adds the mean vector of the two to the initialization moth vector set , and delete the two from the set, so as to detect the initialized moth vector group with higher density and closer distance, and merge and remove them until the moth vector in the initialized moth vector set reaches the set value number, so that the moth vectors in the final initialization moth vector set are as far away from each other as possible, thereby enhancing the exploration ability of the algorithm.
  • S30 update the number of flame vectors, and judge whether there is only one surviving flame, if there are multiple surviving flames, execute S40; if there is only one surviving flame vector, execute S70;
  • S50 Use the progressive class flame matching algorithm to calculate the class flame corresponding to the moth according to the progressive coefficient, match the moth with the corresponding class flame, and re-execute S30;
  • FIG. 3 it is a schematic diagram of the asymptotic class flame matching algorithm in the embodiment of the present application, which specifically includes the following steps:
  • the embodiment of the present invention adopts an asymptotic hierarchical flame matching method, and the specific matching method is:
  • the flame matching is performed according to the flame corresponding to the moth and the three flames with the highest health values.
  • the matching formula is:
  • w is the asymptotic coefficient
  • F i is the flame corresponding to the moth
  • F 1 , F 2 , and F 3 are the three flames with the highest health values, respectively
  • F 1 , F 2 , and F 3 are assigned 0.15, 0.1
  • With a weight of 0.05, the flame with the highest health value has the highest weight (ie influence) to represent the class level that each flame has.
  • the asymptotic coefficient w is a coefficient that increases linearly from 0 to 1 as the iteration progresses.
  • the use of the asymptotic coefficient makes the influence of the top three flames with the health value on the moth matching Grow incrementally as iterations progress. The reason is as follows: at the initial stage of the iteration, the top three flames in terms of health value may not be very close to the global optimal solution. Therefore, using a small asymptotic coefficient w at this time can reduce the difficulty of matching the moths and flames for these three flames. , which encourages moths to explore the search space more. As the iteration continues, the top three flames with the health value will become closer to the optimal solution.
  • the asymptotic coefficient that increases with the iteration will gradually strengthen the three flames for the moth flame matching process. Therefore, the algorithm is gradually transformed from the exploration stage to the excavation stage. Therefore, the use of the asymptotic coefficient w enables the algorithm to effectively balance exploration and excavation when using the asymptotic class flame matching algorithm, and better approach the optimal solution.
  • the algorithm calculates which class flame each moth is matched to and matches the moth to it.
  • S60 using an exploratory moth flame matching algorithm, calculating the class flame corresponding to the moth according to the progressive coefficient, and matching the moth with the corresponding class flame;
  • the embodiment of this application adopts an exploratory method to randomly select the surviving flames as the flames corresponding to the moths that have lost their flames, record for F I .
  • the embodiment of the present invention adopts an exploratory hierarchical flame matching method, which is similar to the asymptotic hierarchical flame matching algorithm.
  • the exploratory hierarchical flame matching algorithm uses randomly explored flames , with the effect of the asymptotic class flame, and being the corresponding matching flame of the moth.
  • the specific matching method is:
  • moth-flame matching will be performed based on the randomly selected surviving flames and the three flames with the highest health values.
  • the matching formula is:
  • the algorithm will continue to repeat the above operations.
  • the parameter k of the number of flames will gradually decrease, and finally reduce to 1, that is, only one flame vector can survive, then the algorithm outputs the final surviving flame vector, and uses It guides the resource scheduling and allocation module to perform resource scheduling and allocation.
  • S70 A resource allocation scheme according to the final surviving flame generation task request
  • S80 The resource abstraction architecture of the Internet of Things based on digital objects, the resource allocation model uses resource scheduling and allocation algorithms to implement resource allocation plans, and performs resource scheduling and allocation for received task requests;
  • the Internet of Things devices with different characteristics are digitized and unified, so as to facilitate communication and distribution with Internet of Things devices, as well as collaboration and cooperation between devices.
  • the abstract architecture of IoT devices based on digital objects is as follows: abstract each IoT device into a digital object, thereby transforming the management and collaboration of IoT devices into the management and collaboration of digital objects with a unified architecture.
  • the abstraction of objects masks the heterogeneity inherent in IoT devices. For IoT devices in different resource scenarios, when they communicate with the resource allocation algorithm as an IoT device, the resource allocation algorithm communicates with the abstract architecture of the digital object of the IoT device and will not be affected by the IoT device itself. have a differential impact.
  • each digital object there are two modules, namely API module and collaboration module.
  • the API module is responsible for reflecting the current status of each IoT device, including whether the device is available, and the information generated by using the device. The cost and whether the specified task request is acceptable, etc.
  • the collaboration module is responsible for the cooperative communication between the IoT device and other similar IoT devices.
  • the resource allocation model receives a task request, it transmits the task request to the digital object of the IoT device. It is judged through the API module of the digital object whether the IoT device can meet the task request, and if it can be satisfied, the task request information is sent back to the resource allocation model through the digital object.
  • the IoT device Conversely, if the IoT device cannot satisfy the task request, the IoT device communicates with other IoT devices of the same type through the communication module of its digital object, and sends the task request to other IoT devices of the same type to try to satisfy the task Requests enable collaboration between similar IoT devices in the process of resource allocation.
  • FIG. 5 it is a schematic diagram of the resource scheduling and allocation algorithm in the embodiment of the present application, which specifically includes the following steps:
  • S82 Allocate each task sequentially according to the resource allocation scheme in the moth vector and the flame vector;
  • the resource allocation scheme specifically includes: setting a constant ub so that all values in the moth vector and the flame vector are between 0-ub, and the lengths of the moth vector and the flame vector are equal to the number of tasks.
  • Each value in the moth vector and the flame vector is regarded as the allocation method of the task. If the value in the moth vector and the flame vector is between [0, ub/2], the task is assigned to In a scenario with sufficient resources; if the value in the moth vector and the flame vector is between (ub/2,ub], then assign the task to a resource-poor scenario.
  • Each value in the moth vector and flame vector The order of determines the order in which the corresponding tasks are assigned.
  • ub 10 and the moth vector is [3,7,2,9], it means that the value corresponding to task 1 is 3, the value corresponding to task 2 is 7, and the value corresponding to task 3 The corresponding value is 2, and the value corresponding to task 4 is 9. Since the values of task 1 and task 3 are between [0,10/2], assign task 1 and task 3 to the scene with sufficient resources; and Since the values of task 2 and task 4 are between (10/2,10], assign task 2 and task 4 to the resource-poor scenario. After the scenario assignment, since the value corresponding to task 3 is smaller than task 1 , so task 3 will be executed before task 1. Because tasks have strict time requirements for resource requests, if task 3 is executed, task 1 cannot be executed within the time requirement because the requested resources are occupied by task 3, Then task 1 will be defeated. Similarly, task 2 will be executed before task 4.
  • S83 Determine whether the task is assigned to a scene with sufficient resources or a scene with insufficient resources, if the task is assigned to a scene with sufficient resources, execute S84; if the task is assigned to a scene with scarce resources, execute S87;
  • S85 Allocate the requested resources for the task on demand and on time in the resource-sufficient scene, update the resource availability in the resource-sufficient scene, and calculate the benefit, cost and optimization goal of satisfying the task in the resource-sufficient scene;
  • S88 Allocate the requested resources for the task on demand and on time in the resource-poor scenario, update the resource availability in the resource-poor scenario, and calculate the benefit, cost and optimization goal of meeting the task in the resource-poor scenario.
  • the embodiment of the present application adopts the reserved allocation method.
  • the requested resources are allocated to the task on time as needed, otherwise, the task will be out of service, effectively avoiding resource deadlocks caused by a certain task receiving only part of the resource allocation.
  • After allocating resources to a task update the resource availability in the scenario, and calculate the benefits, costs and optimization goals that meet the task. Finally, the optimization goal under this resource allocation scheme is returned.
  • the Internet of Things resource allocation method of the embodiment of the present application introduces an abstract framework of Internet of Things resources based on digital objects in the resource allocation model, and uses the concept of digital objects to form a digital object architecture with heterogeneous Internet of Things devices, so that It facilitates the management of IoT device resources and the coordination between resources in resource allocation.
  • the resource allocation model simultaneously optimizes the benefits generated by satisfying the tasks and the costs caused by satisfying the tasks. The optimization goal considers both benefits and costs, which is more practical .
  • the moth-flame optimizer with multiple improvements is used for optimization, so as to meet the profit and cost of the task as the common optimization goal, and optimize the allocation of the proposed resource allocation model, so as to obtain a better resource allocation plan for IoT devices .
  • the present application has at least the following beneficial effects:
  • the target and density-sensing algorithm are introduced for initialization, which can eliminate the relatively dense moth vectors in the initialization moth vector set, thereby enhancing the performance of the swarm-based algorithm, so that the initialization process can optimize the target Under the guidance of , it becomes more refined and solves the damage to the effect of the optimization algorithm caused by random initialization.
  • the exploration and excavation can be better balanced in the training process, thereby better approaching the optimal solution, avoiding a single matching mechanism, and making the algorithm It is less likely to fall into a local optimal solution.
  • the abstract framework of Internet of Things resources based on digital objects uses the concept of digital objects to manage and dispatch a variety of Internet of Things devices in a unified manner, covering up the diversity of various Internet of Things devices, thus making the Internet of Things devices.
  • the management of resources and the coordination between resources in resource allocation become more convenient, which solves the resource management difficulties caused by the heterogeneity of IoT devices.
  • FIG. 6 is a schematic structural diagram of an IoT resource allocation system according to an embodiment of the present application.
  • the Internet of Things resource allocation system 40 of the embodiment of the present application includes:
  • Initialization module 41 used to initialize the moth vector set of the moth-flaming algorithm by using the target and density sensing algorithm based on the received resource allocation task request, to obtain the initialized moth vector set;
  • Health value evaluation module 42 used to evaluate the health value of each moth in the initial moth vector set, and select the top k moths with the highest health values as new flame vectors;
  • Moth-flame matching module 43 used to calculate the class flame corresponding to the moth based on the new flame vector, using the progressive class flame matching algorithm and the exploratory moth flame matching algorithm, matching the moth with the corresponding class flame, and When there is only one surviving flame, generate the resource allocation plan requested by the task according to the surviving flame;
  • Resource allocation module 44 used for the resource abstraction architecture of the Internet of Things based on digital objects, adopting resource scheduling and allocation algorithms to implement resource allocation schemes, and performing resource scheduling and allocation for task requests.
  • FIG. 7 is a schematic diagram of a terminal structure according to an embodiment of the present application.
  • the terminal 50 includes a processor 51 and a memory 52 coupled to the processor 51 .
  • the memory 52 stores program instructions for realizing the above-mentioned Internet of Things resource allocation method.
  • the processor 51 is used to execute the program instructions stored in the memory 52 to control resource allocation of the Internet of Things.
  • the processor 51 may also be referred to as a CPU (Central Processing Unit, central processing unit).
  • the processor 51 may be an integrated circuit chip with signal processing capabilities.
  • the processor 51 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components .
  • a general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
  • FIG. 8 is a schematic structural diagram of a storage medium according to an embodiment of the present application.
  • the storage medium of the embodiment of the present application stores a program file 61 capable of realizing all the above-mentioned methods, wherein the program file 61 can be stored in the above-mentioned storage medium in the form of a software product, and includes several instructions to make a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the methods in various embodiments of the present invention.
  • a computer device which can It is a personal computer, a server, or a network device, etc.
  • processor processor
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. , or terminal devices such as computers, servers, mobile phones, and tablets.

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The present application relates to an Internet of Things resource allocation method and system, a terminal and a storage medium. The method comprises: on the basis of a received resource allocation task request, initializing a moth vector set of a moth-flame optimization algorithm by means of using an object and density-aware algorithm, thus obtaining an initialized moth vector set; evaluating a health value of each moth in the initialized moth vector set, and selecting as new flame vectors the first k moths having the highest health value; on the basis of the new flame vectors, by means of using an asymptotic step flame matching algorithm and an exploratory moth-flame matching algorithm, calculating step flames corresponding to the moths and matching the moths with the corresponding step flames; when there is only one survival flame, generating a resource allocation scheme for the task request according to the survival flame; and on the basis of the Internet of Things resource abstract architecture of a digital object, executing the resource allocation scheme by means of using a resource scheduling and allocation algorithm. The present application may better approximate an optimum, and prevents the algorithm from getting stuck in local optimums.

Description

一种物联网资源分配方法、系统、终端以及存储介质A method, system, terminal and storage medium for Internet of Things resource allocation 技术领域technical field
本申请属于物联网应用技术领域,特别涉及一种物联网资源分配方法、系统、终端以及存储介质。The present application belongs to the field of Internet of Things application technology, and in particular relates to a resource allocation method, system, terminal and storage medium of the Internet of Things.
背景技术Background technique
随着物联网技术的迅猛发展以及物联网设备在人们生产生活中的快速普及,物联网设备将许多应用场景变得更加智能化。例如在智慧医疗当中通过物联网设备进行病人健康监测、在智慧物流中通过物联网设备进行包裹自动投递等。With the rapid development of IoT technology and the rapid popularization of IoT devices in people's production and life, IoT devices have made many application scenarios more intelligent. For example, in smart medical care, patient health monitoring is performed through IoT devices, and in smart logistics, parcels are automatically delivered through IoT devices.
在现实生活中,物联网设备通常具有异构性。例如,不同的物联网设备可能拥有不同的可用时间以及使用代价。同样的,物联网设备驱动的场景也具有异构性,例如资源充足的场景以及资源匮乏的场景等。在实际的物联网应用任务中,每一个应用任务可能会请求一种或多种物联网设备以完成此任务。并且,每个应用任务通常会指定任务所需的每种资源的需求时段。随着物联网任务的激增,如何高效的为这些拥有资源需求的任务分配具有异构性的资源,从而在最大化满足任务所获得的收益的同时通过更有效的资源分配方式减少满足任务所产生的代价,成为了一个亟待解决的问题。In real life, IoT devices are often heterogeneous. For example, different IoT devices may have different availability times and usage costs. Similarly, scenarios driven by IoT devices are also heterogeneous, such as scenarios with sufficient resources and scenarios with scarce resources. In actual IoT application tasks, each application task may request one or more types of IoT devices to complete this task. Also, each application task typically specifies a demand period for each resource required by the task. With the proliferation of IoT tasks, how to efficiently allocate heterogeneous resources for these tasks with resource requirements, so as to maximize the benefits obtained by satisfying tasks and reduce the cost of satisfying tasks through more effective resource allocation. The cost has become an urgent problem to be solved.
现有技术中的物联网资源分配方案主要从两个角度出发,具体为:The Internet of Things resource allocation scheme in the prior art mainly proceeds from two perspectives, specifically:
一、物联网资源分配模型角度;例如,Zhao等人在[Zhao,L.,Wang,J.,Liu,J.,Kato,N.,2019.Optimal edge resource allocation in iot-based smart cities.IEEE Network 33,30–35.]中提出了EOERA和CHERA两种算法,以此在智慧城市的场景下优化物联网设备的计算资源,从而优化平均服务响应时间。Sangaiah等人在[Sangaiah,A.K.,Hosseinabadi,A.A.R.,Shareh,M.B.,Bozorgi Rad,S.Y.,Zolfagharian,A.,Chilamkurti,N.,2020.Iot resource allocation and optimization based on heuristic algorithm.Sensors 20,539.]中提出利用鲸鱼优化算法对物联网计算资源进行优化分配,从而最小化通讯代价。Tsai等人在[Tsai,C.W.,2018.Seira:An effective algorithm for iot resource allocation problem.Computer Communications 119,156–166.]中提出了SEIRA算法,该方法同样着眼于对物联网计算及通讯资源的优化,从而优化总体通讯代价。然而,上述的物联网资源分配模型存在以下缺点:1. From the perspective of the resource allocation model of the Internet of Things; for example, Zhao et al. Network 33,30–35.] proposed two algorithms, EOERA and CHERA, to optimize the computing resources of IoT devices in the smart city scenario, thereby optimizing the average service response time. Sangaiah et al. in [Sangaiah, A.K., Hosseinabadi, A.A.R., Shareh, M.B., Bozorgi Rad, S.Y., Zolfagharian, A., Chilamkurti, N., 2020. Iot resource allocation and optimization based on heuristic algorithm. Sensors 20,53 9.] proposed in The whale optimization algorithm is used to optimize the allocation of computing resources of the Internet of Things, thereby minimizing the communication cost. Tsai et al proposed the SEIRA algorithm in [Tsai, C.W., 2018. Seira: An effective algorithm for iot resource allocation problem. Computer Communications 119, 156–166.], which also focuses on the optimization of computing and communication resources in the Internet of Things. Thereby optimizing the overall communication cost. However, the above-mentioned IoT resource allocation model has the following disadvantages:
首先,上述的物联网资源分配模型都只针对在单一场景中的物联网资源分配。其次,上述的物联网资源分配模型都是针对物联网设备中的计算、存储以及通讯资源的分配,而并未将物联网设备资源视作一个整体,在物联网设备层面进行资源分配。与此同时,这些分配模型并没有考虑到任务对资源的请求是带有时间限制的,也没有采用预留式的资源分配方式,可能造成资源死锁的发生。此外,上述的物联网资源分配模型均没有采用任何统一的物联网设备资源管理框架,随着物联网技术以及物联网设备的快速发展和演变,对多种多样的物联网设备资源的管理将会变得十分困难。最后,上述的物联网资源分配模型仅仅优化某一种代价,没有考虑同时优化满足服务所产生的代价以及满足服务所带来的收益。First of all, the above-mentioned IoT resource allocation models are only aimed at the allocation of IoT resources in a single scenario. Secondly, the above-mentioned IoT resource allocation models are aimed at the allocation of computing, storage, and communication resources in IoT devices, but do not regard IoT device resources as a whole and allocate resources at the IoT device level. At the same time, these allocation models do not take into account that the task's request for resources has a time limit, and do not adopt a reserved resource allocation method, which may cause resource deadlocks. In addition, the above-mentioned IoT resource allocation models do not adopt any unified IoT device resource management framework. With the rapid development and evolution of IoT technology and IoT devices, the management of various IoT device resources will change. very difficult. Finally, the above-mentioned IoT resource allocation model only optimizes a certain cost, without considering the cost of satisfying the service and the benefits of satisfying the service at the same time.
二、优化方法角度;例如:Yang在[Yang,X.,2010.Firefly algorithm in engineering optimization.]中提出了萤火虫算法,该算法模拟了萤火虫的闪光模式以及其相互吸引的行为,从而指导萤火虫在搜索空间中的移动方式。Mirjalili等人在[Mirjalili,S.,Lewis,A.,2016.The whale optimization algorithm.Advances in engineering software 95,51–67.]中提出了鲸鱼优化算法。该算法模仿了鲸鱼在捕食过程中的气泡网行为,从而指导鲸鱼在解空间中搜索到更优的解。Mirjalili等人在[Mirjalili,S.,2015.Moth-flame optimization algorithm:A novel nature-inspired heuristic paradigm.Knowledge-based systems 89,228–249.]中提出了飞蛾扑火算法,该算法模拟了飞蛾的飞行导航机制,从而引导飞蛾在解空间中进行优化搜索。上述的优化方法中,性能最佳的是飞蛾扑火算法,然而飞蛾扑火算法仍存在以下缺点:2. The perspective of optimization methods; for example: Yang proposed the firefly algorithm in [Yang, X., 2010.Firefly algorithm in engineering optimization.], which simulates the flashing mode of fireflies and their mutual attraction behavior, so as to guide fireflies in How to move in the search space. Mirjalili et al proposed the whale optimization algorithm in [Mirjalili, S., Lewis, A., 2016. The whale optimization algorithm. Advances in engineering software 95, 51–67.]. The algorithm imitates the bubble net behavior of whales in the process of predation, so as to guide the whales to search for a better solution in the solution space. Mirjalili et al. proposed the moth-flame optimization algorithm in [Mirjalili, S., 2015. Moth-flame optimization algorithm: A novel nature-inspired heuristic paradise. Knowledge-based systems 89, 228–249.], which simulates the moth The flight navigation mechanism of the moth guides the optimal search in the solution space. Among the above-mentioned optimization methods, the moth-flame algorithm has the best performance. However, the moth-flame algorithm still has the following disadvantages:
首先,飞蛾扑火算法采用了完全不利用额外信息的纯随机飞蛾初始化机制,没有将任何额外模型信息考虑进去,因此,其效果欠佳。此外,每个飞蛾仅匹配一个火焰,容易造成局部最优解困境,从而使得算法无法有效地逼近最优解。最后,飞蛾扑火算法对于所有其对应火焰已经淘汰的飞蛾,采用了统一匹配最差生存火焰的匹配机制。匹配最差生存火焰的匹配机制并不合理,最差生存火焰离最优解往往差距很大。令多个飞蛾去匹配同一个火焰也会很大程度的导致算法陷入局部最优解,从而损坏算法的优化效果。First of all, the moth-flame algorithm uses a purely random moth initialization mechanism that does not use additional information at all, and does not take any additional model information into account, so its effect is not good. In addition, each moth only matches one flame, which is easy to cause a local optimal solution dilemma, so that the algorithm cannot effectively approach the optimal solution. Finally, the moth flame-fighting algorithm adopts a matching mechanism that uniformly matches the worst survival flame for all moths whose corresponding flames have been eliminated. The matching mechanism for matching the worst survival flame is unreasonable, and the worst survival flame is often far from the optimal solution. Using multiple moths to match the same flame will also cause the algorithm to fall into a local optimal solution to a large extent, thus damaging the optimization effect of the algorithm.
发明内容Contents of the invention
本申请提供了一种物联网资源分配方法、系统、终端以及存储介质,旨在至少在一定程度上解决现有技术中的上述技术问题之一。The present application provides an Internet of Things resource allocation method, system, terminal and storage medium, aiming to solve one of the above-mentioned technical problems in the prior art at least to a certain extent.
为了解决上述问题,本申请提供了如下技术方案:In order to solve the above problems, the application provides the following technical solutions:
一种物联网资源分配方法,包括:A method for allocating Internet of Things resources, comprising:
基于接收到的资源分配任务请求,采用目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化,得到初始化飞蛾向量集合;Based on the received resource allocation task request, the target and density-aware algorithm is used to initialize the moth vector set of the moth-flaming algorithm, and the initialized moth vector set is obtained;
对所述初始化飞蛾向量集合中每个飞蛾的健康值进行评估,并选出健康值最高的前k个飞蛾作为新的火焰向量;Evaluate the health value of each moth in the initialized moth vector set, and select the top k moths with the highest health value as new flame vectors;
基于所述新的火焰向量,采用渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法计算飞蛾对应的阶级火焰,将飞蛾与对应的阶级火焰进行匹配;Based on the new flame vector, using a progressive class flame matching algorithm and an exploratory moth flame matching algorithm to calculate the class flame corresponding to the moth, and matching the moth with the corresponding class flame;
当仅有一个存活火焰时,根据所述存活火焰生成所述任务请求的资源分配方案;When there is only one surviving flame, generating a resource allocation plan for the task request according to the surviving flame;
基于数字对象的物联网资源抽象架构,采用资源调度与分配算法执行所述资源分配方案,对所述任务请求进行资源调度与分配。The resource abstraction architecture of the Internet of Things based on digital objects uses a resource scheduling and allocation algorithm to execute the resource allocation plan, and performs resource scheduling and allocation for the task request.
本申请实施例采取的技术方案还包括:所述采用目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化具体为:The technical solution adopted in the embodiment of the present application also includes: the initialization of the moth vector set of the moth-flaming algorithm by using the target and density-sensing algorithm is specifically:
对于接收到的任务请求,分别计算每个任务在不同资源场景下的收益、代价和优化目标;所述资源场景包括资源充足的场景和资源匮乏的场景;For the received task request, calculate the income, cost and optimization goal of each task in different resource scenarios; the resource scenario includes a resource-sufficient scenario and a resource-poor scenario;
判断初始化飞蛾向量集合中的初始化飞蛾向量是否达到设定数量的设定倍数,如果没有达到设定数量的设定倍数,根据所述优化目标大小对每个任务请求进行分配,并重复判断;如果达到设定数量的设定倍数,采用目标与密度感知算法从所述初始化飞蛾向量集合中找出间距最小的两个初始化飞蛾 向量,将所述两个初始化飞蛾向量的均值向量作为新的飞蛾向量加入所述初始化飞蛾向量集合中,并从所述初始化飞蛾向量集合中删除所述的两个初始化飞蛾向量;其中,每个初始化飞蛾向量的长度为待分配资源的任务请求个数;Judging whether the initialized moth vectors in the initialized moth vector set have reached the set multiple of the set number, if not reached the set multiple of the set number, assign each task request according to the size of the optimization target, and repeat the judgment ; If the set multiple of the set number is reached, the target and density-aware algorithm is used to find out the two initialization moth vectors with the smallest distance from the set of initialization moth vectors, and the mean vector of the two initialization moth vectors Add in the initialization moth vector collection as new moth vector, and delete described two initialization moth vectors from described initialization moth vector collection; Wherein, the length of each initialization moth vector is to be allocated The number of task requests for resources;
判断初始化飞蛾向量集合中的初始化飞蛾向量是否达到设定数量,如果没有达到设定数量,继续执行目标与密度感知算法;如果达到设定数量,输出初始化飞蛾向量集合。Determine whether the initialized moth vectors in the initialized moth vector set reach the set number, if not, continue to execute the target and density sensing algorithm; if reach the set number, output the initialized moth vector set.
本申请实施例采取的技术方案还包括:所述基于所述新的火焰向量,采用渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法计算飞蛾对应的阶级火焰包括:The technical solution adopted in the embodiment of the present application also includes: based on the new flame vector, using the progressive class flame matching algorithm and the exploratory moth flame matching algorithm to calculate the class flame corresponding to the moth includes:
判断飞蛾所对应的火焰向量是否被淘汰,如果飞蛾所对应的火焰向量未被淘汰,采用渐进阶级火焰匹配算法,根据渐进系数计算阶级火焰,将飞蛾与对应的阶级火焰进行匹配;Judging whether the flame vector corresponding to the moth is eliminated, if the flame vector corresponding to the moth is not eliminated, adopt the progressive class flame matching algorithm, calculate the class flame according to the progressive coefficient, and match the moth with the corresponding class flame;
如果飞蛾所对应的火焰向量已被淘汰,采用探索式飞蛾火焰匹配算法,根据渐进系数计算阶级火焰,将飞蛾与对应的阶级火焰进行匹配。If the flame vector corresponding to the moth has been eliminated, the exploratory moth flame matching algorithm is used to calculate the class flame according to the progressive coefficient, and the moth is matched with the corresponding class flame.
本申请实施例采取的技术方案还包括:所述采用渐进阶级火焰匹配算法,根据渐进系数计算阶级火焰,将飞蛾与对应的阶级火焰进行匹配具体为:The technical solution adopted in the embodiment of the present application also includes: the stepwise flame matching algorithm is used to calculate the class flame according to the progressive coefficient, and the moth is matched with the corresponding class flame, specifically:
从k个新的火焰向量中选取健康值最高的三个火焰;Select the three flames with the highest health values from the k new flame vectors;
更新渐进系数;update asymptotic coefficient;
结合渐进系数以及健康值最高的三个火焰计算阶级火焰,并将飞蛾与对应的阶级火焰进行匹配;所述匹配方式为:Combining the gradual coefficient and the three flames with the highest health value to calculate the class flame, and matching the moth with the corresponding class flame; the matching method is:
如果当前的存活火焰数量≥3,则根据飞蛾所对应的火焰以及健康值最高的三个火焰进行火焰匹配:If the current number of surviving flames is greater than or equal to 3, flame matching is performed based on the flame corresponding to the moth and the three flames with the highest health values:
(1-0.3*ω)×F i+0.15×ω×F 1+0.1×ω×F 2+0.05×ω×F 3 (1-0.3*ω)×F i +0.15×ω×F 1 +0.1×ω×F 2 +0.05×ω×F 3
其中,w为一个随着迭代的进行从0线性增长为1的渐进系数,F i为飞蛾所对应的火焰,F 1、F 2、F 3分别为健康值最高的三个火焰,F 1、F 2、F 3分别被赋予0.15、0.1和0.05的权重,健康值最高的火焰拥有最高的权重; Among them, w is a progressive coefficient that increases linearly from 0 to 1 as the iteration progresses, F i is the flame corresponding to the moth, F 1 , F 2 , and F 3 are the three flames with the highest health values, and F 1 , F 2 , and F 3 are given weights of 0.15, 0.1, and 0.05 respectively, and the flame with the highest health value has the highest weight;
当健康值最高的三个火焰中只有两个火焰存在时,匹配方式为:When only two flames exist among the three flames with the highest health value, the matching method is:
(1-0.25*ω)×F i+0.15×ω×F 1+0.1×ω×F 2 (1-0.25*ω)×F i +0.15×ω×F 1 +0.1×ω×F 2
根据火焰匹配结果更新飞蛾位置。Update the moth position based on the flame matching result.
本申请实施例采取的技术方案还包括:所述采用探索式飞蛾火焰匹配算法,根据渐进系数计算阶级火焰,将飞蛾与对应的阶级火焰进行匹配具体为:The technical solution adopted in the embodiment of the present application also includes: using the exploratory moth flame matching algorithm, calculating the class flame according to the progressive coefficient, and matching the moth with the corresponding class flame, specifically:
从k个新的火焰向量中选取健康值最高的三个火焰;Select the three flames with the highest health values from the k new flame vectors;
随机选取存活火焰F IRandomly select the surviving flame F I ;
更新渐进系数;update asymptotic coefficient;
结合渐进系数以及选取的存活火焰计算阶级火焰,并将飞蛾与对应的阶级火焰进行匹配;所述匹配方式为:Combining the gradual coefficient and the selected surviving flames to calculate the class flames, and matching the moths with the corresponding class flames; the matching method is:
如果当前的存活火焰数量≥3,则根据随机选取的存活火焰以及健康值最高的三个火焰进行飞蛾-火焰匹配:If the current number of surviving flames is ≥ 3, moth-flame matching is performed based on the randomly selected surviving flames and the three flames with the highest health values:
Figure PCTCN2022140066-appb-000001
Figure PCTCN2022140066-appb-000001
当健康值最高的三个火焰中只有两个火焰存在时,匹配公式为:When only two flames exist among the three flames with the highest health value, the matching formula is:
Figure PCTCN2022140066-appb-000002
Figure PCTCN2022140066-appb-000002
根据所述火焰匹配结果更新飞蛾位置。The moth position is updated according to the flame matching result.
本申请实施例采取的技术方案还包括:所述基于数字对象的物联网资源抽象架构,资源分配模型采用资源调度与分配算法执行资源分配方案具体为:The technical solution adopted in the embodiment of the present application also includes: the abstract architecture of the Internet of Things resources based on digital objects, and the resource allocation model adopts the resource scheduling and allocation algorithm to execute the resource allocation scheme, which is specifically:
所述资源分配模型将任务请求传送给物联网设备的数字对象,所述数字对象包括API模块和通信模块,所述API模块用于判断该物联网设备是否可以满足任务请求,如果可以满足,将满足任务请求信息回传至资源分配模型;如果该物联网设备无法满足任务请求,则通过所述通信模块与其他同类物联网设备进行通信,将所述任务请求发送给其他同类物联网设备。The resource allocation model transmits the task request to the digital object of the IoT device, the digital object includes an API module and a communication module, and the API module is used to judge whether the IoT device can meet the task request, and if it can be satisfied, the Satisfied task request information is sent back to the resource allocation model; if the IoT device cannot satisfy the task request, it communicates with other similar IoT devices through the communication module, and sends the task request to other similar IoT devices.
本申请实施例采取的技术方案还包括:所述资源分配模型采用资源调度与分配算法执行资源分配方案具体为:The technical solution adopted in the embodiment of the present application also includes: the resource allocation model adopts a resource scheduling and allocation algorithm to implement a resource allocation plan, specifically:
获取飞蛾向量和火焰向量;所述飞蛾向量和火焰向量的长度均为任务请求的数量;Obtain the moth vector and the flame vector; the lengths of the moth vector and the flame vector are the quantity requested by the task;
设定一个常数ub,使得所述飞蛾向量和火焰向量中的所有数值都介于0-ub之间,如果飞蛾向量和火焰向量中的值介于[0,ub/2]范围之间,则将该任务请求分配至资源充足的场景下;如果飞蛾向量和火焰向量中的值介于(ub/2,ub]之间,则将该任务请求分配至资源匮乏的场景下;所述飞蛾向量和火焰向量中每个值的顺序决定对应任务被分配的顺序;Set a constant ub so that all the values in the moth vector and flame vector are between 0-ub, if the values in the moth vector and flame vector are between [0, ub/2] , assign the task request to a scenario with sufficient resources; if the values in the moth vector and flame vector are between (ub/2,ub], assign the task request to a scenario with scarce resources; The order of each value in the above moth vector and flame vector determines the order in which the corresponding tasks are assigned;
对于被分配后任务请求,判断所述任务请求在被分配的资源场景中所有所需资源是否均可按需满足,如果可以按需满足,被分配的资源场景中为该任务请求按需按时分配所请求的资源,更新被分配的资源场景中的资源可用情况,并计算在被分配的资源场景中满足该任务的收益、代价与优化目标;否则,如果不可以按需满足,使该任务请求失服。For the assigned task request, judge whether all the required resources of the task request in the assigned resource scenario can be satisfied on demand, and if it can be satisfied on demand, the task request in the assigned resource scenario is allocated on demand and on time For the requested resources, update the resource availability in the assigned resource scenario, and calculate the benefits, costs and optimization goals of meeting the task in the assigned resource scenario; otherwise, if it cannot be satisfied on demand, make the task request Lost.
本申请实施例采取的另一技术方案为:一种物联网资源分配系统,包括:Another technical solution adopted by the embodiment of the present application is: an Internet of Things resource allocation system, including:
初始化模块:用于基于接收到的资源分配任务请求,采用目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化,得到初始化飞蛾向量集合;Initialization module: used to initialize the moth vector set of the moth-flaming algorithm by using the target and density-aware algorithm based on the received resource allocation task request, and obtain the initialized moth vector set;
健康值评估模块:用于对所述初始化飞蛾向量集合中每个飞蛾的健康值进行评估,并选出健康值最高的前k个飞蛾作为新的火焰向量;Health value evaluation module: used to evaluate the health value of each moth in the initialized moth vector set, and select the top k moths with the highest health value as new flame vectors;
飞蛾-火焰匹配模块:用于基于所述新的火焰向量,采用渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法计算飞蛾对应的阶级火焰,将飞蛾与对应的阶级火焰进行匹配,并当仅有一个存活火焰时,根据所述存活火焰生成所述任务请求的资源分配方案;Moth-flame matching module: used to calculate the class flame corresponding to the moth by using the progressive class flame matching algorithm and the exploratory moth flame matching algorithm based on the new flame vector, and match the moth with the corresponding class flame, And when there is only one surviving flame, generate a resource allocation plan for the task request according to the surviving flame;
资源分配模块:用于基于数字对象的物联网资源抽象架构,采用资源调度与分配算法执行所述资源分配方案,对所述任务请求进行资源调度与分配。Resource allocation module: used for the resource abstraction architecture of the Internet of Things based on digital objects, adopting resource scheduling and allocation algorithms to implement the resource allocation plan, and performing resource scheduling and allocation for the task requests.
本申请实施例采取的又一技术方案为:一种终端,所述终端包括处理器、与所述处理器耦接的存储器,其中,Another technical solution adopted by the embodiment of the present application is: a terminal, the terminal includes a processor and a memory coupled to the processor, wherein,
所述存储器存储有用于实现所述物联网资源分配方法的程序指令;The memory stores program instructions for realizing the resource allocation method of the Internet of Things;
所述处理器用于执行所述存储器存储的所述程序指令以控制物联网资源分配。The processor is configured to execute the program instructions stored in the memory to control resource allocation of the Internet of Things.
本申请实施例采取的又一技术方案为:一种存储介质,存储有处理器可运行的程序指令,所述程序指令用于执行所述物联网资源分配方法。Another technical solution adopted by the embodiment of the present application is: a storage medium storing program instructions executable by a processor, and the program instructions are used to execute the method for allocating resources of the Internet of Things.
相对于现有技术,本申请实施例产生的有益效果在于:本申请实施例的物联网资源分配方法、系统、终端以及存储介质在资源分配模型中引入了基于数字对象的物联网资源抽象框架,利用数字对象的概念,具有异构性的物联网设备构成数字对象架构,从而方便对于物联网设备资源的管理与资源之间在资源分配时的协同配合。在进行资源分配时,利用预留式的资源分配方式,资源分配模型对满足任务所产生的收益与满足任务所造成的代价进行了同时优化,优化目标同时考虑了收益与代价,更具有实用性。并采用了具有多项改进的飞蛾扑火优化器进行优化,以满足任务的收益与代价为共同优化目标,对所提资源分配模型进行优化分配,从而得到更优的物联网设备资源分配方案。相对于现有技术,本申请至少具有以下有益效果:Compared with the prior art, the beneficial effect of the embodiment of the present application is that: the Internet of Things resource allocation method, system, terminal, and storage medium of the embodiment of the present application introduce an abstract framework of Internet of Things resources based on digital objects in the resource allocation model, Using the concept of digital objects, heterogeneous IoT devices form a digital object architecture, which facilitates the management of IoT device resources and the coordination between resources in resource allocation. When performing resource allocation, using the reserved resource allocation method, the resource allocation model simultaneously optimizes the benefits generated by satisfying the tasks and the costs caused by satisfying the tasks. The optimization goal considers both benefits and costs, which is more practical . And the moth-flame optimizer with multiple improvements is used for optimization, so as to meet the profit and cost of the task as the common optimization goal, and optimize the allocation of the proposed resource allocation model, so as to obtain a better resource allocation plan for IoT devices . Compared with the prior art, the present application has at least the following beneficial effects:
一、在飞蛾扑火算法的基础上引入目标与密度感知算法进行初始化,可以排除初始化飞蛾向量集合中较为密集的飞蛾向量,从而增强基于群体算法的效能,使得初始化过程可以在优化目标的指导下变得更加细化,解决了随机初始化所带来的优化算法效果受损。1. On the basis of the moth-flame algorithm, the target and density-sensing algorithm are introduced for initialization, which can eliminate the relatively dense moth vectors in the initialization moth vector set, thereby enhancing the performance of the swarm-based algorithm, so that the initialization process can optimize the target Under the guidance of , it becomes more refined and solves the damage to the effect of the optimization algorithm caused by random initialization.
二、通过引入渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法,在训练的过程中可以更好的平衡探索与发掘,从而更好地逼近最优解,避免了单一的匹配机制,使得算法更不容易陷入局部最优解。2. By introducing the progressive flame matching algorithm and the exploratory moth flame matching algorithm, the exploration and excavation can be better balanced in the training process, thereby better approaching the optimal solution, avoiding a single matching mechanism, and making the algorithm It is less likely to fall into a local optimal solution.
三、基于数字对象的物联网资源抽象框架,利用数字对象的概念对多种物联网设备进行统一的管理与调度,掩盖多种多样的物联网设备所具有的多样性,从而使得对于物联网设备资源的管理以及资源之间在资源分配时的协同配合变得更加方便,解决了因为物联网设备具有的异构性所带来的资源管理困难。3. The abstract framework of Internet of Things resources based on digital objects uses the concept of digital objects to manage and dispatch a variety of Internet of Things devices in a unified manner, covering up the diversity of various Internet of Things devices, thus making the Internet of Things devices The management of resources and the coordination between resources in resource allocation become more convenient, which solves the resource management difficulties caused by the heterogeneity of IoT devices.
四、通过在具有特异性的物联网多场景模式下,采用预留式的物联网设备资源分配方式,可以在具有资源异构性的多种物联网场景下对资源进行合理分配,在进行资源分配时,考虑了任务对于所请求资源所具有的时间要求,具有更强的实用性,并可以避免在资源分配中出现资源死锁。4. By adopting the reserved IoT device resource allocation method in the specific IoT multi-scenario mode, resources can be allocated reasonably in various IoT scenarios with resource heterogeneity. When allocating, the time requirements of the tasks on the requested resources are taken into consideration, which is more practical and can avoid resource deadlocks in resource allocation.
五、在优化满足任务所产生的代价的同时,也对满足任务所产生的收益进行了优化,使得优化目标更加全面,更具有实用性。5. While optimizing the cost of satisfying the task, it also optimizes the income generated by satisfying the task, making the optimization goal more comprehensive and practical.
附图说明Description of drawings
图1是本申请实施例的物联网资源分配方法的流程图;Fig. 1 is the flowchart of the Internet of Things resource allocation method of the embodiment of the present application;
图2为本申请实施例中基于目标与密度感知算法的初始化过程示意图;Fig. 2 is a schematic diagram of the initialization process based on the target and density sensing algorithm in the embodiment of the present application;
图3为本申请实施例中渐近阶级火焰匹配算法示意图;Fig. 3 is a schematic diagram of the asymptotic class flame matching algorithm in the embodiment of the present application;
图4为本申请实施例的探索式飞蛾火焰匹配算法示意图;Fig. 4 is the schematic diagram of the exploratory moth flame matching algorithm of the embodiment of the present application;
图5为本申请实施例中资源调度与分配算法示意图;FIG. 5 is a schematic diagram of a resource scheduling and allocation algorithm in an embodiment of the present application;
图6为本申请实施例的物联网资源分配系统结构示意图;FIG. 6 is a schematic structural diagram of an Internet of Things resource allocation system according to an embodiment of the present application;
图7为本申请实施例的终端结构示意图;FIG. 7 is a schematic structural diagram of a terminal according to an embodiment of the present application;
图8为本申请实施例的存储介质的结构示意图。FIG. 8 is a schematic structural diagram of a storage medium according to an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, not to limit the present application.
请参阅图1,是本申请实施例的物联网资源分配方法的流程图。本申请实施例的物联网资源分配方法包括以下步骤:Please refer to FIG. 1 , which is a flowchart of a method for allocating resources of the Internet of Things according to an embodiment of the present application. The Internet of Things resource allocation method in the embodiment of the present application includes the following steps:
S10:通过资源分配模型接收请求分配资源的任务请求,并基于接收到的任务请求,采用目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化,得到初始化飞蛾向量集合;S10: Receive a task request requesting resource allocation through the resource allocation model, and based on the received task request, use the target and density sensing algorithm to initialize the moth vector set of the moth-flaming algorithm, and obtain the initialized moth vector set;
本步骤中,由于飞蛾扑火算法是一种基于群体的基因遗传算法,通过使用多个搜索者,从而具备更大的逼近全局最优解的可能性。因此,在算法初始阶段,需要初始化一个飞蛾向量集合,生成设定数量的飞蛾向量。本发明基于目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化,该算法利用优化目标作为先验知识指导初始化,并根据其密度感知的特性,增大初始化飞蛾向量的疏远程度,从而提升算法的效能。具体如图2所示,为本申请实施例中基于目标与密度感知算法的初始化过程示意图,其初始化过程包括以下步骤:In this step, since the moth-to-flame algorithm is a population-based genetic algorithm, by using multiple searchers, it has a greater possibility of approaching the global optimal solution. Therefore, in the initial stage of the algorithm, a set of moth vectors needs to be initialized to generate a set number of moth vectors. The present invention initializes the moth vector set of the moth flame attack algorithm based on the target and density sensing algorithm. The algorithm uses the optimization target as prior knowledge to guide the initialization, and increases the alienation of the initialized moth vectors according to its density sensing characteristics. to improve the performance of the algorithm. Specifically, as shown in Figure 2, it is a schematic diagram of the initialization process based on the target and density-aware algorithm in the embodiment of the present application, and the initialization process includes the following steps:
S11:对于接收到的任务请求,分别计算每个任务在不同资源场景下的收益、代价和优化目标;S11: For the received task requests, calculate the benefits, costs and optimization goals of each task under different resource scenarios;
其中,本申请实施例中包括两种具有资源异构性的资源场景,即资源充足的场景R与资源匮乏的场景S,以此来反映现实应用场景中的通常会出现的资源分配不均的情况。例如,在智慧医疗场景中,大型医院为资源充足的场景,社区诊所为资源匮乏的场景;在智慧物流场景中,中央仓库为资源充足的场景,而地区邮局则为资源匮乏的场景。Among them, the embodiment of the present application includes two kinds of resource scenarios with resource heterogeneity, that is, the scenario R with sufficient resources and the scenario S with scarce resources, so as to reflect the uneven resource allocation that usually occurs in real application scenarios. Condition. For example, in a smart medical scenario, a large hospital is a scenario with sufficient resources, while a community clinic is a scenario with scarce resources; in a smart logistics scenario, a central warehouse is a scenario with sufficient resources, while a regional post office is a scenario with scarce resources.
进一步地,任务在不同资源场景下的收益、代价和优化目标计算方式具体为:Further, the calculation method of the income, cost and optimization goal of the task in different resource scenarios is as follows:
在资源分配模型中,共考虑M种不同的资源,定义为:In the resource allocation model, a total of M different resources are considered, defined as:
Figure PCTCN2022140066-appb-000003
Figure PCTCN2022140066-appb-000003
其中,
Figure PCTCN2022140066-appb-000004
代表在场景X中的第m种资源。每种资源都有
Figure PCTCN2022140066-appb-000005
个资源副本,资源
Figure PCTCN2022140066-appb-000006
的第j个副本为:
in,
Figure PCTCN2022140066-appb-000004
Represents the mth resource in scene X. Each resource has
Figure PCTCN2022140066-appb-000005
resource copies, resource
Figure PCTCN2022140066-appb-000006
The jth copy of is:
Figure PCTCN2022140066-appb-000007
Figure PCTCN2022140066-appb-000007
对于每个资源副本而言,其都有其开始可用时间与结束可用时间,分别记为
Figure PCTCN2022140066-appb-000008
Figure PCTCN2022140066-appb-000009
每个资源副本的可用时段记为
Figure PCTCN2022140066-appb-000010
其初始表示为:
For each resource copy, it has its start time and end time, which are recorded as
Figure PCTCN2022140066-appb-000008
and
Figure PCTCN2022140066-appb-000009
The availability period of each resource copy is recorded as
Figure PCTCN2022140066-appb-000010
Its initial representation is:
Figure PCTCN2022140066-appb-000011
Figure PCTCN2022140066-appb-000011
例如,一个移动式健康监测仪的开始可用时间为早9点,结束可用时间为晚6点,则其可用时段为早9点至晚6点。若该移动式健康监测仪在早10点至11点之间被请求占用,则该设备的可用时段更新为早9点至10点,以及早11点至晚6点。For example, if a mobile health monitor starts to be available at 9:00 am and ends at 6:00 pm, then its available period is from 9:00 am to 6:00 pm. If the mobile health monitor is requested to be occupied between 10:00 am and 11:00 am, the available time period of the device is updated as 9:00 am to 10:00 am, and 11:00 am to 6:00 pm.
假设资源分配模型考虑N个任务,记为S n,每个任务可以请求最多K种物联网设备,将
Figure PCTCN2022140066-appb-000012
记为任务S n所请求的资源集合,
Figure PCTCN2022140066-appb-000013
记为任务
Figure PCTCN2022140066-appb-000014
中的第i个资源请求,
Figure PCTCN2022140066-appb-000015
表示任务S n请求的资源个数。因此有:
Assuming that the resource allocation model considers N tasks, denoted as S n , and each task can request at most K types of IoT devices, the
Figure PCTCN2022140066-appb-000012
Denote as the set of resources requested by task S n ,
Figure PCTCN2022140066-appb-000013
record as task
Figure PCTCN2022140066-appb-000014
The i-th resource request in
Figure PCTCN2022140066-appb-000015
Indicates the number of resources requested by task S n . So there are:
Figure PCTCN2022140066-appb-000016
Figure PCTCN2022140066-appb-000016
在任务S n中,其每个资源请求
Figure PCTCN2022140066-appb-000017
都会指定开始使用时间和结束使用时间,记为
Figure PCTCN2022140066-appb-000018
Figure PCTCN2022140066-appb-000019
例如,某一个任务的资源请求为:在早9点至9点半使用某物联网设备,即该请求指定的开始使用时间为早9点,结束使用时间为9点半。
In task S n , each resource request
Figure PCTCN2022140066-appb-000017
will specify the start time and end use time, recorded as
Figure PCTCN2022140066-appb-000018
and
Figure PCTCN2022140066-appb-000019
For example, the resource request of a certain task is: to use an IoT device from 9:00 am to 9:30 am, that is, the request specifies a start time of 9:00 am and an end time of 9:30 am.
每种任务在场景X中被满足时会产生一个收益,记为
Figure PCTCN2022140066-appb-000020
故在分配方案A下,产生的总收益定义为:
Each task will generate a benefit when it is satisfied in scenario X, denoted as
Figure PCTCN2022140066-appb-000020
Therefore, under the distribution plan A, the total income generated is defined as:
Figure PCTCN2022140066-appb-000021
Figure PCTCN2022140066-appb-000021
使用每种物联网设备单位时间都会产生一个代价,记为
Figure PCTCN2022140066-appb-000022
定义每种资源的使用时段长度len为:
Figure PCTCN2022140066-appb-000023
故在分配方案A下产生的总代价定义为:
Using each IoT device will generate a cost per unit time, which is denoted as
Figure PCTCN2022140066-appb-000022
Define the usage period length len of each resource as:
Figure PCTCN2022140066-appb-000023
Therefore, the total cost generated under the allocation scheme A is defined as:
Figure PCTCN2022140066-appb-000024
Figure PCTCN2022140066-appb-000024
其中,
Figure PCTCN2022140066-appb-000025
在任务S n被分配在资源充足的场景R中时等于1,否则等于0。
in,
Figure PCTCN2022140066-appb-000025
It is equal to 1 when the task S n is allocated in the scene R with sufficient resources, otherwise it is equal to 0.
由于物联网设备具有异构性,即物联网设备具有不同的可用数量与可用时间,因此,不同的物联网设备有不同的使用代价。该使用代价还可以包括能源使用开销等其他代价,使得异构代价定义具有普遍性。Due to the heterogeneity of IoT devices, that is, IoT devices have different available quantities and available time, therefore, different IoT devices have different usage costs. The usage cost may also include other costs such as energy usage overhead, making the definition of heterogeneous cost universal.
本申请实施例中的资源分配模型的优化目标同时考虑了满足任务所产生的代价及收益,故最终的优化目标为优化收益的同时最小化代价。最终优化目标为:The optimization objective of the resource allocation model in the embodiment of the present application takes into account both the cost and the income generated by satisfying the task, so the final optimization objective is to minimize the cost while optimizing the income. The final optimization goal is:
Figure PCTCN2022140066-appb-000026
Figure PCTCN2022140066-appb-000026
其中,w为权衡系数,为负值,
Figure PCTCN2022140066-appb-000027
代表优化后的资源分配方案。
Among them, w is the trade-off coefficient, which is a negative value,
Figure PCTCN2022140066-appb-000027
Represents the optimized resource allocation scheme.
本申请实施例通过利用收益、代价以及优化目标指导初始化飞蛾向量集合的初始化过程,使得初始化方式更加合理,从而可以有效的提高算法的效能。The embodiment of the present application guides the initialization process of initializing the moth vector set by using the income, the cost and the optimization objective, so that the initialization method is more reasonable, thereby effectively improving the efficiency of the algorithm.
S12:判断初始化飞蛾向量集合中的初始化飞蛾向量数量是否达到设定数量的设定倍数,如果没有达到设定数量的设定倍数,执行S13;否则,执行S14;S12: Determine whether the number of initialized moth vectors in the initialized moth vector set has reached the set multiple of the set number, if not, execute S13; otherwise, execute S14;
其中,每个初始化飞蛾向量的长度为待分配资源的任务个数。在生成初始化飞蛾向量时,生成比设定数量多1.5倍的初始化飞蛾向量,具体倍数可根据实际应用进行设定。Among them, the length of each initialization moth vector is the number of tasks to be allocated resources. When generating the initialized moth vectors, generate 1.5 times more initialized moth vectors than the set number, and the specific multiple can be set according to the actual application.
S13:根据场景优化目标大小对每个任务请求进行分配,并重新执行S12;S13: Allocate each task request according to the size of the scene optimization target, and re-execute S12;
S14:采用目标与密度感知算法从初始化飞蛾向量集合中找出间距最小(即距离最相近)的两个初始化飞蛾向量,将所述的两个初始化飞蛾向量的均值向量作为新的飞蛾向量加入到初始化飞蛾向量集合中,并从初始化飞蛾向量集合中删除所述的两个初始化飞蛾向量;S14: Use the target and density sensing algorithm to find out the two initialization moth vectors with the smallest distance (that is, the closest distance) from the initialization moth vector set, and use the mean vector of the two initialization moth vectors as a new moth vector. The moth vector is added to the set of initialized moth vectors, and the two initialized moth vectors are deleted from the set of initialized moth vectors;
S15:判断初始化飞蛾向量集合中的初始化飞蛾向量是否达到设定数量,如果没有达到设定数量,重新执行S14;如果达到设定数量,执行S16;S15: Determine whether the initialized moth vectors in the initialized moth vector set have reached the set number, if not, execute S14 again; if reach the set number, execute S16;
S16:输出初始化飞蛾向量集合。S16: Output the initialized moth vector set.
基于上述,本申请实施例通过采用目标与密度感知算法不断的从生成的初始化飞蛾向量集合中找出间距最小的两个初始化飞蛾向量,将二者的均值向量加入初始化飞蛾向量集合中,并从集合中删除二者,从而侦测到密度较大、距离较近的初始化飞蛾向量组,并对其进行合并与移除,直到初始化飞 蛾向量集合中的飞蛾向量达到设定数量,使得最终的初始化飞蛾向量集合中的飞蛾向量尽可能彼此疏远,从而增强算法的探索能力。Based on the above, the embodiment of the present application continuously finds two initialization moth vectors with the smallest distance from the generated initialization moth vector set by using the target and density sensing algorithm, and adds the mean vector of the two to the initialization moth vector set , and delete the two from the set, so as to detect the initialized moth vector group with higher density and closer distance, and merge and remove them until the moth vector in the initialized moth vector set reaches the set value number, so that the moth vectors in the final initialization moth vector set are as far away from each other as possible, thereby enhancing the exploration ability of the algorithm.
S20:对初始化飞蛾向量集合中每个飞蛾的健康值进行评估,并选出健康值最高的前k个飞蛾作为新的火焰向量;S20: Evaluate the health value of each moth in the initialized moth vector set, and select the top k moths with the highest health values as new flame vectors;
S30:更新火焰向量数量,并判断是否仅有一个存活火焰,如果还有多个存活火焰,则执行S40;如果仅有一个存活火焰向量,执行S70;S30: update the number of flame vectors, and judge whether there is only one surviving flame, if there are multiple surviving flames, execute S40; if there is only one surviving flame vector, execute S70;
S40:判断飞蛾所对应的火焰向量是否被淘汰,如果飞蛾所对应的火焰向量未被淘汰,执行S50;否则,执行S60;S40: Determine whether the flame vector corresponding to the moth is eliminated, if the flame vector corresponding to the moth is not eliminated, execute S50; otherwise, execute S60;
S50:使用渐进阶级火焰匹配算法,根据渐进系数计算飞蛾对应的阶级火焰,将飞蛾与对应的阶级火焰进行匹配,并重新执行S30;S50: Use the progressive class flame matching algorithm to calculate the class flame corresponding to the moth according to the progressive coefficient, match the moth with the corresponding class flame, and re-execute S30;
本步骤中,如图3所示,为本申请实施例中渐近阶级火焰匹配算法示意图,其具体包括以下步骤:In this step, as shown in Figure 3, it is a schematic diagram of the asymptotic class flame matching algorithm in the embodiment of the present application, which specifically includes the following steps:
S51:从k个新的火焰向量中选取健康值最高的三个火焰;S51: Select three flames with the highest health value from the k new flame vectors;
S52:更新渐进系数;S52: update the gradual coefficient;
S53:结合渐进系数以及健康值最高的三个火焰计算阶级火焰,并将飞蛾与对应的阶级火焰进行匹配;S53: Combining the gradual coefficient and the three flames with the highest health value to calculate the class flame, and matching the moth with the corresponding class flame;
其中,为了解决原始飞蛾扑火算法存在的陷入局部最优解问题,本发明实施例采用渐近阶级火焰匹配方式,具体匹配方式为:Among them, in order to solve the problem of falling into a local optimal solution existing in the original moth-flaming algorithm, the embodiment of the present invention adopts an asymptotic hierarchical flame matching method, and the specific matching method is:
如果当前的存活火焰数量≥3,则根据飞蛾所对应的火焰以及健康值最高的三个火焰进行火焰匹配,匹配公式为:If the current number of surviving flames is greater than or equal to 3, the flame matching is performed according to the flame corresponding to the moth and the three flames with the highest health values. The matching formula is:
(1-0.3*ω)×F i+0.15×ω×F 1+0.1×ω×F 20.05×ω×F 3     (8) (1-0.3*ω)×F i +0.15×ω×F 1 +0.1×ω×F 2 0.05×ω×F 3 (8)
其中,w为渐进系数,F i为飞蛾所对应的火焰,F 1、F 2、F 3分别为健康值最高的三个火焰,F 1、F 2、F 3分别被赋予0.15、0.1和0.05的权重,健康值最高的火焰拥有最高的权重(即影响力),以表示每个火焰具有的阶级层次。 Among them, w is the asymptotic coefficient, F i is the flame corresponding to the moth, F 1 , F 2 , and F 3 are the three flames with the highest health values, respectively, and F 1 , F 2 , and F 3 are assigned 0.15, 0.1, and With a weight of 0.05, the flame with the highest health value has the highest weight (ie influence) to represent the class level that each flame has.
当健康值最高的三个火焰中只有两个火焰存在时,匹配公式如下:When only two flames exist among the three flames with the highest health value, the matching formula is as follows:
(1-0.25*ω)×F i+0.15×ω×F 1+0.1×ω×F 2    (9) (1-0.25*ω)×F i +0.15×ω×F 1 +0.1×ω×F 2 (9)
在渐近阶级火焰匹配算法中,渐近系数w是一个随着迭代的进行从0线性增长为1的一个系数,渐近系数的使用使得健康值排名前三的火焰对于飞蛾匹配的影响力随着迭代的进行而逐步增长。原因如下:由于在迭代进行的初期,健康值排名前三的火焰未必会十分接近全局最优解,因此,此时使用一个较小的渐进系数w可以降低这三个火焰对于飞蛾与火焰匹配的影响程度,从而更加鼓励飞蛾对于搜索空间的探索。而随着迭代的不断进行,健康值排名前三的火焰会变得更加接近最优解,这时,随迭代进行而不断增大的渐进系数会逐步加强这三个火焰对于飞蛾火焰匹配过程的影响程度,从而将算法从探索阶段渐近地转换为发掘阶段。因此,渐近系数w的使用使得算法可以在采用渐近阶级火焰匹配算法时有效的权衡探索与发掘,更好的逼近最优解。在更新完渐近系数之后,算法会计算每个飞蛾所匹配的阶级火焰,并将飞蛾与之匹配。In the asymptotic class flame matching algorithm, the asymptotic coefficient w is a coefficient that increases linearly from 0 to 1 as the iteration progresses. The use of the asymptotic coefficient makes the influence of the top three flames with the health value on the moth matching Grow incrementally as iterations progress. The reason is as follows: at the initial stage of the iteration, the top three flames in terms of health value may not be very close to the global optimal solution. Therefore, using a small asymptotic coefficient w at this time can reduce the difficulty of matching the moths and flames for these three flames. , which encourages moths to explore the search space more. As the iteration continues, the top three flames with the health value will become closer to the optimal solution. At this time, the asymptotic coefficient that increases with the iteration will gradually strengthen the three flames for the moth flame matching process. Therefore, the algorithm is gradually transformed from the exploration stage to the excavation stage. Therefore, the use of the asymptotic coefficient w enables the algorithm to effectively balance exploration and excavation when using the asymptotic class flame matching algorithm, and better approach the optimal solution. After updating the asymptotic coefficients, the algorithm calculates which class flame each moth is matched to and matches the moth to it.
S54:根据火焰匹配结果更新飞蛾位置。S54: Update the moth position according to the flame matching result.
S60:使用探索式飞蛾火焰匹配算法,根据渐进系数计算飞蛾对应的阶级火焰,将飞蛾与对应的阶级火焰进行匹配;S60: using an exploratory moth flame matching algorithm, calculating the class flame corresponding to the moth according to the progressive coefficient, and matching the moth with the corresponding class flame;
本步骤中,如图4所示,为本申请实施例的探索式飞蛾火焰匹配算法示意图,具体包括以下步骤:In this step, as shown in Figure 4, it is a schematic diagram of the exploratory moth flame matching algorithm of the embodiment of the present application, which specifically includes the following steps:
S61:从k个新的火焰向量中选取健康值最高的三个火焰;S61: Select three flames with the highest health values from the k new flame vectors;
S62:随机选取存活火焰;S62: Randomly select surviving flames;
其中,为了防止所有已失去对应火焰的飞蛾统一匹配最差存活飞蛾,本申请实施例采用一种探索式的方式,随机选取存活的火焰作为已失去火焰的飞蛾所对应的火焰,记为F IAmong them, in order to prevent all moths that have lost their corresponding flames from uniformly matching the worst surviving moths, the embodiment of this application adopts an exploratory method to randomly select the surviving flames as the flames corresponding to the moths that have lost their flames, record for F I .
S63:更新渐进系数;S63: update the gradual coefficient;
S64:结合渐进系数以及选取的存活火焰计算阶级火焰,并将飞蛾与对应的阶级火焰进行匹配;S64: Combining the progressive coefficient and the selected surviving flames to calculate class flames, and matching the moths with the corresponding class flames;
其中,为了解决原始飞蛾扑火算法存在的陷入局部最优解问题,本发明实施例采用探索阶级火焰匹配方式,与渐近阶级火焰匹配算法类似,探索阶级火焰匹配算法利用随机探索到的火焰,加以渐近阶级火焰的影响,共同作为飞蛾所对应的匹配火焰。具体匹配方式为:Among them, in order to solve the problem of falling into the local optimal solution existing in the original moth-to-flame algorithm, the embodiment of the present invention adopts an exploratory hierarchical flame matching method, which is similar to the asymptotic hierarchical flame matching algorithm. The exploratory hierarchical flame matching algorithm uses randomly explored flames , with the effect of the asymptotic class flame, and being the corresponding matching flame of the moth. The specific matching method is:
如果当前的存活火焰数量≥3,则根据随机选取的存活火焰以及健康值最高的三个火焰进行飞蛾-火焰匹配,匹配公式为:If the current number of surviving flames is ≥ 3, moth-flame matching will be performed based on the randomly selected surviving flames and the three flames with the highest health values. The matching formula is:
Figure PCTCN2022140066-appb-000028
Figure PCTCN2022140066-appb-000028
当健康值最高的三个火焰中只有两个火焰存在时,匹配公式如下:When only two flames exist among the three flames with the highest health value, the matching formula is as follows:
Figure PCTCN2022140066-appb-000029
Figure PCTCN2022140066-appb-000029
S65:根据火焰匹配结果更新飞蛾位置。S65: Update the position of the moth according to the flame matching result.
上述中,算法会不断重复上述操作,在迭代的过程中,火焰数量参数k会逐渐减少,并最终减少为1,即只有一个火焰向量能够得以生存,则算法 输出最终存活的火焰向量,并利用其指导资源调度与分配模块进行资源调度与分配。In the above, the algorithm will continue to repeat the above operations. During the iterative process, the parameter k of the number of flames will gradually decrease, and finally reduce to 1, that is, only one flame vector can survive, then the algorithm outputs the final surviving flame vector, and uses It guides the resource scheduling and allocation module to perform resource scheduling and allocation.
S70:根据最终的存活火焰生成任务请求的资源分配方案;S70: A resource allocation scheme according to the final surviving flame generation task request;
S80:基于数字对象的物联网资源抽象架构,资源分配模型采用资源调度与分配算法执行资源分配方案,对接收到的任务请求进行资源调度与分配;S80: The resource abstraction architecture of the Internet of Things based on digital objects, the resource allocation model uses resource scheduling and allocation algorithms to implement resource allocation plans, and performs resource scheduling and allocation for received task requests;
本步骤中,通过采用基于数字对象的物联网资源抽象架构,将特性各异的物联网设备数字化、统一化,方便与物联网设备的通讯与分配,以及设备之间的协作与配合。基于数字对象的物联网设备抽象架构具体为:将每一个物联网设备都抽象为一个数字对象,从而将对物联网设备的管理与协作转变为对架构统一的数字对象的管理与协作,通过数字对象的抽象掩盖了物联网设备所具有的异构性。对于不同资源场景下的物联网设备,在其作为物联网设备与资源分配算法进行沟通时,资源分配算法都是在与物联网设备的数字对象抽象架构进行沟通,不会受到物联网设备自身所具备的差异性影响。In this step, by adopting the abstract structure of Internet of Things resources based on digital objects, the Internet of Things devices with different characteristics are digitized and unified, so as to facilitate communication and distribution with Internet of Things devices, as well as collaboration and cooperation between devices. The abstract architecture of IoT devices based on digital objects is as follows: abstract each IoT device into a digital object, thereby transforming the management and collaboration of IoT devices into the management and collaboration of digital objects with a unified architecture. The abstraction of objects masks the heterogeneity inherent in IoT devices. For IoT devices in different resource scenarios, when they communicate with the resource allocation algorithm as an IoT device, the resource allocation algorithm communicates with the abstract architecture of the digital object of the IoT device and will not be affected by the IoT device itself. have a differential impact.
具体的,对于每一个数字对象而言,都具备两种模块,分别为API模块和协作模块,其中,API模块负责反映每个物联网设备的当前状态,包括设备是否可用、使用该设备所产生的代价以及是否可接受指定任务请求等。协作模块用于负责物联网设备与其他同类物联网设备之间的协作通信。当资源分配模型接收到一个任务请求时,将该任务请求传送给物联网设备的数字对象。通过数字对象的API模块判断该物联网设备是否可以满足任务请求,如果可以满足,通过数字对象将满足任务请求信息回传至资源分配模型。反之,如果该物联网设备无法满足任务请求,则该物联网设备通过其数字对象 的通信模块与其他同类物联网设备进行通信,将该任务请求发送给其他同类物联网设备,以尝试满足该任务请求,使得同类物联网设备之间在资源分配的过程中进行协作配合。Specifically, for each digital object, there are two modules, namely API module and collaboration module. Among them, the API module is responsible for reflecting the current status of each IoT device, including whether the device is available, and the information generated by using the device. The cost and whether the specified task request is acceptable, etc. The collaboration module is responsible for the cooperative communication between the IoT device and other similar IoT devices. When the resource allocation model receives a task request, it transmits the task request to the digital object of the IoT device. It is judged through the API module of the digital object whether the IoT device can meet the task request, and if it can be satisfied, the task request information is sent back to the resource allocation model through the digital object. Conversely, if the IoT device cannot satisfy the task request, the IoT device communicates with other IoT devices of the same type through the communication module of its digital object, and sends the task request to other IoT devices of the same type to try to satisfy the task Requests enable collaboration between similar IoT devices in the process of resource allocation.
进一步地,如图5所示,为本申请实施例中资源调度与分配算法示意图,其具体包括以下步骤:Further, as shown in FIG. 5, it is a schematic diagram of the resource scheduling and allocation algorithm in the embodiment of the present application, which specifically includes the following steps:
S81:获取飞蛾向量和火焰向量;S81: Acquiring moth vectors and flame vectors;
S82:根据飞蛾向量和火焰向量中的资源分配方案顺序分配每个任务;S82: Allocate each task sequentially according to the resource allocation scheme in the moth vector and the flame vector;
其中,资源分配方案具体为:设定一个常数ub,使得飞蛾向量和火焰向量中的所有数值都介于0-ub之间,飞蛾向量和火焰向量的长度均为任务的数量。将飞蛾向量和火焰向量中的每个值视作对该任务的分配方式,如果飞蛾向量和火焰向量中的值介于[0,ub/2]范围之间,则将该任务分配至资源充足的场景下;若飞蛾向量和火焰向量中的值介于(ub/2,ub]之间,则将该任务分配至资源匮乏的场景下。飞蛾向量和火焰向量中每个值的顺序决定对应任务被分配的顺序。例如,如果ub为10,飞蛾向量为[3,7,2,9],表示任务1对应的值为3,任务2对应的值为7,任务3对应的值为2,任务4对应的值为9,由于任务1和任务3的值介于[0,10/2]之间,则将任务1和任务3分配至资源充足的场景下;而由于任务2和任务4的值介于(10/2,10]之间,则将任务2和任务4分配至资源匮乏的场景下。在进行场景分配后,由于任务3对应的值小于任务1,因此任务3会先于任务1被执行。因为任务对资源的请求有严格时间要求的,如果任务3被执行后,任务1由于所请求资源被任务3占用而无法在时间要求内被执行,则使任务1失服。同理,任务2会先于任务4被执行。Among them, the resource allocation scheme specifically includes: setting a constant ub so that all values in the moth vector and the flame vector are between 0-ub, and the lengths of the moth vector and the flame vector are equal to the number of tasks. Each value in the moth vector and the flame vector is regarded as the allocation method of the task. If the value in the moth vector and the flame vector is between [0, ub/2], the task is assigned to In a scenario with sufficient resources; if the value in the moth vector and the flame vector is between (ub/2,ub], then assign the task to a resource-poor scenario. Each value in the moth vector and flame vector The order of determines the order in which the corresponding tasks are assigned. For example, if ub is 10 and the moth vector is [3,7,2,9], it means that the value corresponding to task 1 is 3, the value corresponding to task 2 is 7, and the value corresponding to task 3 The corresponding value is 2, and the value corresponding to task 4 is 9. Since the values of task 1 and task 3 are between [0,10/2], assign task 1 and task 3 to the scene with sufficient resources; and Since the values of task 2 and task 4 are between (10/2,10], assign task 2 and task 4 to the resource-poor scenario. After the scenario assignment, since the value corresponding to task 3 is smaller than task 1 , so task 3 will be executed before task 1. Because tasks have strict time requirements for resource requests, if task 3 is executed, task 1 cannot be executed within the time requirement because the requested resources are occupied by task 3, Then task 1 will be defeated. Similarly, task 2 will be executed before task 4.
S83:判断任务被分配在资源充足的场景还是资源匮乏的场景,如果任务被分配在资源充足的场景,执行S84;如果任务被分配在资源匮乏的场景,执行S87;S83: Determine whether the task is assigned to a scene with sufficient resources or a scene with insufficient resources, if the task is assigned to a scene with sufficient resources, execute S84; if the task is assigned to a scene with scarce resources, execute S87;
S84:判断该任务在资源充足的场景中所有所需资源是否均可按需满足,如果可以按需满足,执行S85;否则,执行S86;S84: Judging whether all required resources of the task can be met on demand in the resource-sufficient scenario, if it can be met on demand, execute S85; otherwise, execute S86;
S85:在资源充足的场景中为该任务按需按时分配所请求的资源,更新资源充足的场景中的资源可用情况,并计算在资源充足的场景中满足该任务的收益、代价与优化目标;S85: Allocate the requested resources for the task on demand and on time in the resource-sufficient scene, update the resource availability in the resource-sufficient scene, and calculate the benefit, cost and optimization goal of satisfying the task in the resource-sufficient scene;
S86:为避免死锁,使该任务失服;S86: In order to avoid deadlock, make the task out of service;
S87:判断该任务在资源匮乏的场景中所有所需资源是否均可按需满足,如果可以按需满足,执行S88;否则,执行S86;S87: Judging whether all required resources of the task can be met on demand in resource-poor scenarios, and if so, go to S88; otherwise, go to S86;
S88:在资源匮乏的场景中为该任务按需按时分配所请求的资源,更新资源匮乏的场景中的资源可用情况,并计算在资源匮乏的场景中满足该任务的收益、代价与优化目标。S88: Allocate the requested resources for the task on demand and on time in the resource-poor scenario, update the resource availability in the resource-poor scenario, and calculate the benefit, cost and optimization goal of meeting the task in the resource-poor scenario.
基于上述,本申请实施例采用预留式的分配方式,对于被分配在不同场景中的任务,需要判断在该场景下该任务所请求的全部资源是否可以按需按时分配,如果可以,才会在该场景下为该任务按需按时分配所请求资源,否则,则使该任务失服,有效避免了由于某一个任务只得到部分资源分配而导致的资源死锁情况的出现。在对任务进行资源分配后,更新该场景中的资源可用情况,并计算满足该任务的收益、代价与优化目标。最终,返回在此种资源分配方案下的优化目标。Based on the above, the embodiment of the present application adopts the reserved allocation method. For tasks assigned in different scenarios, it is necessary to judge whether all resources requested by the task in this scenario can be allocated on demand and on time. In this scenario, the requested resources are allocated to the task on time as needed, otherwise, the task will be out of service, effectively avoiding resource deadlocks caused by a certain task receiving only part of the resource allocation. After allocating resources to a task, update the resource availability in the scenario, and calculate the benefits, costs and optimization goals that meet the task. Finally, the optimization goal under this resource allocation scheme is returned.
基于上述,本申请实施例的物联网资源分配方法在资源分配模型中引入了基于数字对象的物联网资源抽象框架,利用数字对象的概念,具有异构性的物联网设备构成数字对象架构,从而方便对于物联网设备资源的管理与资源之间在资源分配时的协同配合。在进行资源分配时,利用预留式的资源分配方式,资源分配模型对满足任务所产生的收益与满足任务所造成的代价进行了同时优化,优化目标同时考虑了收益与代价,更具有实用性。并采用了具有多项改进的飞蛾扑火优化器进行优化,以满足任务的收益与代价为共同优化目标,对所提资源分配模型进行优化分配,从而得到更优的物联网设备资源分配方案。相对于现有技术,本申请至少具有以下有益效果:Based on the above, the Internet of Things resource allocation method of the embodiment of the present application introduces an abstract framework of Internet of Things resources based on digital objects in the resource allocation model, and uses the concept of digital objects to form a digital object architecture with heterogeneous Internet of Things devices, so that It facilitates the management of IoT device resources and the coordination between resources in resource allocation. When performing resource allocation, using the reserved resource allocation method, the resource allocation model simultaneously optimizes the benefits generated by satisfying the tasks and the costs caused by satisfying the tasks. The optimization goal considers both benefits and costs, which is more practical . And the moth-flame optimizer with multiple improvements is used for optimization, so as to meet the profit and cost of the task as the common optimization goal, and optimize the allocation of the proposed resource allocation model, so as to obtain a better resource allocation plan for IoT devices . Compared with the prior art, the present application has at least the following beneficial effects:
一、在飞蛾扑火算法的基础上引入目标与密度感知算法进行初始化,可以排除初始化飞蛾向量集合中较为密集的飞蛾向量,从而增强基于群体算法的效能,使得初始化过程可以在优化目标的指导下变得更加细化,解决了随机初始化所带来的优化算法效果受损。1. On the basis of the moth-flame algorithm, the target and density-sensing algorithm are introduced for initialization, which can eliminate the relatively dense moth vectors in the initialization moth vector set, thereby enhancing the performance of the swarm-based algorithm, so that the initialization process can optimize the target Under the guidance of , it becomes more refined and solves the damage to the effect of the optimization algorithm caused by random initialization.
二、通过引入渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法,在训练的过程中可以更好的平衡探索与发掘,从而更好地逼近最优解,避免了单一的匹配机制,使得算法更不容易陷入局部最优解。2. By introducing the progressive flame matching algorithm and the exploratory moth flame matching algorithm, the exploration and excavation can be better balanced in the training process, thereby better approaching the optimal solution, avoiding a single matching mechanism, and making the algorithm It is less likely to fall into a local optimal solution.
三、基于数字对象的物联网资源抽象框架,利用数字对象的概念对多种物联网设备进行统一的管理与调度,掩盖多种多样的物联网设备所具有的多样性,从而使得对于物联网设备资源的管理以及资源之间在资源分配时的协同配合变得更加方便,解决了因为物联网设备具有的异构性所带来的资源管理困难。3. The abstract framework of Internet of Things resources based on digital objects uses the concept of digital objects to manage and dispatch a variety of Internet of Things devices in a unified manner, covering up the diversity of various Internet of Things devices, thus making the Internet of Things devices The management of resources and the coordination between resources in resource allocation become more convenient, which solves the resource management difficulties caused by the heterogeneity of IoT devices.
四、通过在具有特异性的物联网多场景模式下,采用预留式的物联网设备资源分配方式,可以在具有资源异构性的多种物联网场景下对资源进行合理分配,在进行资源分配时,考虑了任务对于所请求资源所具有的时间要求,具有更强的实用性,并可以避免在资源分配中出现资源死锁。4. By adopting the reserved IoT device resource allocation method in the specific IoT multi-scenario mode, resources can be allocated reasonably in various IoT scenarios with resource heterogeneity. When allocating, the time requirements of the tasks on the requested resources are taken into consideration, which is more practical and can avoid resource deadlocks in resource allocation.
五、在优化满足任务所产生的代价的同时,也对满足任务所产生的收益进行了优化,使得优化目标更加全面,更具有实用性。5. While optimizing the cost of satisfying the task, it also optimizes the income generated by satisfying the task, making the optimization goal more comprehensive and practical.
请参阅图6,为本申请实施例的物联网资源分配系统结构示意图。本申请实施例的物联网资源分配系统40包括:Please refer to FIG. 6 , which is a schematic structural diagram of an IoT resource allocation system according to an embodiment of the present application. The Internet of Things resource allocation system 40 of the embodiment of the present application includes:
初始化模块41:用于基于接收到的资源分配任务请求,采用目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化,得到初始化飞蛾向量集合;Initialization module 41: used to initialize the moth vector set of the moth-flaming algorithm by using the target and density sensing algorithm based on the received resource allocation task request, to obtain the initialized moth vector set;
健康值评估模块42:用于对初始化飞蛾向量集合中每个飞蛾的健康值进行评估,并选出健康值最高的前k个飞蛾作为新的火焰向量;Health value evaluation module 42: used to evaluate the health value of each moth in the initial moth vector set, and select the top k moths with the highest health values as new flame vectors;
飞蛾-火焰匹配模块43:用于基于新的火焰向量,采用渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法计算飞蛾对应的阶级火焰,将飞蛾与对应的阶级火焰进行匹配,并当仅有一个存活火焰时,根据存活火焰生成任务请求的资源分配方案;Moth-flame matching module 43: used to calculate the class flame corresponding to the moth based on the new flame vector, using the progressive class flame matching algorithm and the exploratory moth flame matching algorithm, matching the moth with the corresponding class flame, and When there is only one surviving flame, generate the resource allocation plan requested by the task according to the surviving flame;
资源分配模块44:用于基于数字对象的物联网资源抽象架构,采用资源调度与分配算法执行资源分配方案,对任务请求进行资源调度与分配。Resource allocation module 44: used for the resource abstraction architecture of the Internet of Things based on digital objects, adopting resource scheduling and allocation algorithms to implement resource allocation schemes, and performing resource scheduling and allocation for task requests.
请参阅图7,为本申请实施例的终端结构示意图。该终端50包括处理器51、与处理器51耦接的存储器52。Please refer to FIG. 7 , which is a schematic diagram of a terminal structure according to an embodiment of the present application. The terminal 50 includes a processor 51 and a memory 52 coupled to the processor 51 .
存储器52存储有用于实现上述物联网资源分配方法的程序指令。The memory 52 stores program instructions for realizing the above-mentioned Internet of Things resource allocation method.
处理器51用于执行存储器52存储的程序指令以控制物联网资源分配。The processor 51 is used to execute the program instructions stored in the memory 52 to control resource allocation of the Internet of Things.
其中,处理器51还可以称为CPU(Central Processing Unit,中央处理单元)。处理器51可能是一种集成电路芯片,具有信号的处理能力。处理器51还可以是通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。Wherein, the processor 51 may also be referred to as a CPU (Central Processing Unit, central processing unit). The processor 51 may be an integrated circuit chip with signal processing capabilities. The processor 51 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components . A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
请参阅图8,为本申请实施例的存储介质的结构示意图。本申请实施例的存储介质存储有能够实现上述所有方法的程序文件61,其中,该程序文件61可以以软件产品的形式存储在上述存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本发明各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质,或者是计算机、服务器、手机、平板等终端设备。Please refer to FIG. 8 , which is a schematic structural diagram of a storage medium according to an embodiment of the present application. The storage medium of the embodiment of the present application stores a program file 61 capable of realizing all the above-mentioned methods, wherein the program file 61 can be stored in the above-mentioned storage medium in the form of a software product, and includes several instructions to make a computer device (which can It is a personal computer, a server, or a network device, etc.) or a processor (processor) that executes all or part of the steps of the methods in various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disc, etc., which can store program codes. , or terminal devices such as computers, servers, mobile phones, and tablets.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本申请中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本申请所示的这些实施例,而是要符合与本申请所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined in this application may be implemented in other embodiments without departing from the spirit or scope of the application. Therefore, the present application will not be limited to the embodiments shown in the present application, but is to be accorded the widest scope consistent with the principles and novel features disclosed in the present application.

Claims (10)

  1. 一种物联网资源分配方法,其特征在于,包括:A resource allocation method for the Internet of Things, characterized in that, comprising:
    基于接收到的资源分配任务请求,采用目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化,得到初始化飞蛾向量集合;Based on the received resource allocation task request, the target and density-aware algorithm is used to initialize the moth vector set of the moth-flaming algorithm, and the initialized moth vector set is obtained;
    对所述初始化飞蛾向量集合中每个飞蛾的健康值进行评估,并选出健康值最高的前k个飞蛾作为新的火焰向量;Evaluate the health value of each moth in the initialized moth vector set, and select the top k moths with the highest health value as new flame vectors;
    基于所述新的火焰向量,采用渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法计算飞蛾对应的阶级火焰,将飞蛾与对应的阶级火焰进行匹配;Based on the new flame vector, using a progressive class flame matching algorithm and an exploratory moth flame matching algorithm to calculate the class flame corresponding to the moth, and matching the moth with the corresponding class flame;
    当仅有一个存活火焰时,根据所述存活火焰生成所述任务请求的资源分配方案;When there is only one surviving flame, generating a resource allocation plan for the task request according to the surviving flame;
    基于数字对象的物联网资源抽象架构,采用资源调度与分配算法执行所述资源分配方案,对所述任务请求进行资源调度与分配。The resource abstraction architecture of the Internet of Things based on digital objects uses a resource scheduling and allocation algorithm to execute the resource allocation plan, and performs resource scheduling and allocation for the task request.
  2. 根据权利要求1所述的物联网资源分配方法,其特征在于,所述采用目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化具体为:The resource allocation method of the Internet of Things according to claim 1, wherein the initialization of the moth vector set of the moth-flaming algorithm by using the target and density sensing algorithm is specifically:
    对于接收到的任务请求,分别计算每个任务在不同资源场景下的收益、代价和优化目标;所述资源场景包括资源充足的场景和资源匮乏的场景;For the received task request, calculate the income, cost and optimization goal of each task in different resource scenarios; the resource scenario includes a resource-sufficient scenario and a resource-poor scenario;
    判断初始化飞蛾向量集合中的初始化飞蛾向量是否达到设定数量的设定倍数,如果没有达到设定数量的设定倍数,根据所述优化目标大小对每个任务请求进行分配并重复判断;如果达到设定数量的设定倍数,采用目标与密度感知算法从所述初始化飞蛾向量集合中找出间距最小的两个初始化飞蛾向量,将所述两个初始化飞蛾向量的均值向量作为新的飞蛾向量加入所述初始化飞蛾向量集合中,并从所述初始化飞蛾向量集合中删除所述的两个初始化 飞蛾向量;其中,每个初始化飞蛾向量的长度为待分配资源的任务请求个数;Judging whether the initialized moth vectors in the initialized moth vector set have reached the set multiple of the set number, if not reached the set multiple of the set number, assigning each task request according to the size of the optimization target and repeating the judgment; If the set multiple of the set number is reached, the target and density-aware algorithm is used to find two initialized moth vectors with the smallest distance from the set of initialized moth vectors, and the mean vector of the two initialized moth vectors is used as A new moth vector is added to the set of initialized moth vectors, and the two initialized moth vectors are deleted from the set of initialized moth vectors; wherein, the length of each initialized moth vector is the resource to be allocated The number of task requests;
    判断初始化飞蛾向量集合中的初始化飞蛾向量是否达到设定数量,如果没有达到设定数量,继续执行目标与密度感知算法;如果达到设定数量,输出初始化飞蛾向量集合。Determine whether the initialized moth vectors in the initialized moth vector set reach the set number, if not, continue to execute the target and density sensing algorithm; if reach the set number, output the initialized moth vector set.
  3. 根据权利要求2所述的物联网资源分配方法,其特征在于,所述基于所述新的火焰向量,采用渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法计算飞蛾对应的阶级火焰包括:The resource allocation method for the Internet of Things according to claim 2, wherein the calculation of the class flame corresponding to moths using the progressive class flame matching algorithm and the exploratory moth flame matching algorithm based on the new flame vector includes:
    判断飞蛾所对应的火焰向量是否被淘汰,如果飞蛾所对应的火焰向量未被淘汰,采用渐进阶级火焰匹配算法,根据渐进系数计算阶级火焰,将飞蛾与对应的阶级火焰进行匹配;Judging whether the flame vector corresponding to the moth is eliminated, if the flame vector corresponding to the moth is not eliminated, adopt the progressive class flame matching algorithm, calculate the class flame according to the progressive coefficient, and match the moth with the corresponding class flame;
    如果飞蛾所对应的火焰向量已被淘汰,采用探索式飞蛾火焰匹配算法,根据渐进系数计算阶级火焰,将飞蛾与对应的阶级火焰进行匹配。If the flame vector corresponding to the moth has been eliminated, the exploratory moth flame matching algorithm is used to calculate the class flame according to the progressive coefficient, and the moth is matched with the corresponding class flame.
  4. 根据权利要求3所述的物联网资源分配方法,其特征在于,所述采用渐进阶级火焰匹配算法,根据渐进系数计算阶级火焰,将飞蛾与对应的阶级火焰进行匹配具体为:The resource allocation method of the Internet of Things according to claim 3, wherein the stepwise flame matching algorithm is used to calculate the stage flame according to the gradual coefficient, and matching the moth with the corresponding stage flame is specifically as follows:
    从k个新的火焰向量中选取健康值最高的三个火焰;Select the three flames with the highest health values from the k new flame vectors;
    更新渐进系数;update asymptotic coefficient;
    结合渐进系数以及健康值最高的三个火焰计算阶级火焰,并将飞蛾与对应的阶级火焰进行匹配;所述匹配方式为:Combining the gradual coefficient and the three flames with the highest health value to calculate the class flame, and matching the moth with the corresponding class flame; the matching method is:
    如果当前的存活火焰数量≥3,则根据飞蛾所对应的火焰以及健康值最高的三个火焰进行火焰匹配:If the current number of surviving flames is greater than or equal to 3, flame matching is performed based on the flame corresponding to the moth and the three flames with the highest health values:
    Figure PCTCN2022140066-appb-100001
    Figure PCTCN2022140066-appb-100001
    其中,w为一个随着迭代的进行从0线性增长为1的渐进系数,F i为飞蛾所对应的火焰,F 1、F 2、F 3分别为健康值最高的三个火焰,F 1、F 2、F 3分别被赋予0.15、0.1和0.05的权重,健康值最高的火焰拥有最高的权重; Among them, w is a progressive coefficient that increases linearly from 0 to 1 as the iteration progresses, F i is the flame corresponding to the moth, F 1 , F 2 , and F 3 are the three flames with the highest health values, and F 1 , F 2 , and F 3 are given weights of 0.15, 0.1, and 0.05 respectively, and the flame with the highest health value has the highest weight;
    当健康值最高的三个火焰中只有两个火焰存在时,匹配方式为:When only two flames exist among the three flames with the highest health value, the matching method is:
    Figure PCTCN2022140066-appb-100002
    Figure PCTCN2022140066-appb-100002
    根据火焰匹配结果更新飞蛾位置。Update the moth position based on the flame matching results.
  5. 根据权利要求4所述的物联网资源分配方法,其特征在于,所述采用探索式飞蛾火焰匹配算法,根据渐进系数计算阶级火焰,将飞蛾与对应的阶级火焰进行匹配具体为:The resource allocation method of the Internet of Things according to claim 4, characterized in that, using the exploratory moth flame matching algorithm, calculating the class flame according to the gradual coefficient, and matching the moth with the corresponding class flame is specifically:
    从k个新的火焰向量中选取健康值最高的三个火焰;Select the three flames with the highest health values from the k new flame vectors;
    随机选取存活火焰F IRandomly select the surviving flame F I ;
    更新渐进系数;update asymptotic coefficient;
    结合渐进系数以及选取的存活火焰计算阶级火焰,并将飞蛾与对应的阶级火焰进行匹配;所述匹配方式为:Combining the gradual coefficient and the selected surviving flames to calculate the class flames, and matching the moths with the corresponding class flames; the matching method is:
    如果当前的存活火焰数量≥3,则根据随机选取的存活火焰以及健康值最高的三个火焰进行飞蛾-火焰匹配:If the current number of surviving flames is ≥ 3, moth-flame matching is performed based on the randomly selected surviving flames and the three flames with the highest health values:
    Figure PCTCN2022140066-appb-100003
    Figure PCTCN2022140066-appb-100003
    当健康值最高的三个火焰中只有两个火焰存在时,匹配公式为:When only two flames exist among the three flames with the highest health value, the matching formula is:
    Figure PCTCN2022140066-appb-100004
    Figure PCTCN2022140066-appb-100004
    根据所述火焰匹配结果更新飞蛾位置。The moth position is updated according to the flame matching result.
  6. 根据权利要求1至5任一项所述的物联网资源分配方法,其特征在于,所述基于数字对象的物联网资源抽象架构,资源分配模型采用资源调度与分配算法执行资源分配方案具体为:According to the resource allocation method of the Internet of Things according to any one of claims 1 to 5, it is characterized in that, the resource abstraction framework of the Internet of Things based on digital objects, and the resource allocation model adopts resource scheduling and allocation algorithms to execute the resource allocation plan as follows:
    所述资源分配模型将任务请求传送给物联网设备的数字对象,所述数字对象包括API模块和通信模块,所述API模块用于判断该物联网设备是否可以满足任务请求,如果可以满足,将满足任务请求信息回传至资源分配模型;如果该物联网设备无法满足任务请求,则通过所述通信模块与其他同类物联网设备进行通信,将所述任务请求发送给其他同类物联网设备。The resource allocation model transmits the task request to the digital object of the IoT device, the digital object includes an API module and a communication module, and the API module is used to judge whether the IoT device can meet the task request, and if it can be satisfied, the Satisfied task request information is sent back to the resource allocation model; if the IoT device cannot satisfy the task request, it communicates with other similar IoT devices through the communication module, and sends the task request to other similar IoT devices.
  7. 根据权利要求6所述的物联网资源分配方法,其特征在于,所述资源分配模型采用资源调度与分配算法执行资源分配方案具体为:The resource allocation method for the Internet of Things according to claim 6, wherein the resource allocation model uses a resource scheduling and allocation algorithm to execute a resource allocation plan specifically as follows:
    获取飞蛾向量和火焰向量;所述飞蛾向量和火焰向量的长度均为任务请求的数量;Obtain the moth vector and the flame vector; the lengths of the moth vector and the flame vector are the quantity requested by the task;
    设定一个常数ub,使得所述飞蛾向量和火焰向量中的所有数值都介于0-ub之间,如果飞蛾向量和火焰向量中的值介于[0,ub/2]范围之间,则将该任务请求分配至资源充足的场景下;如果飞蛾向量和火焰向量中的值介于(ub/2,ub]之间,则将该任务请求分配至资源匮乏的场景下;所述飞蛾向量和火焰向量中每个值的顺序决定对应任务被分配的顺序;Set a constant ub so that all the values in the moth vector and flame vector are between 0-ub, if the values in the moth vector and flame vector are between [0, ub/2] , assign the task request to a scenario with sufficient resources; if the values in the moth vector and flame vector are between (ub/2,ub], assign the task request to a scenario with scarce resources; The order of each value in the above moth vector and flame vector determines the order in which the corresponding tasks are assigned;
    对于被分配后任务请求,判断所述任务请求在被分配的资源场景中所有所需资源是否均可按需满足,如果可以按需满足,被分配的资源场景中为该任务请求按需按时分配所请求的资源,更新被分配的资源场景中的资源可用情况,并计算在被分配的资源场景中满足该任务的收益、代价与优化目标;否则,如果不可以按需满足,使该任务请求失服。For the assigned task request, judge whether all the required resources of the task request in the assigned resource scenario can be satisfied on demand, and if it can be satisfied on demand, the task request in the assigned resource scenario is allocated on demand and on time For the requested resources, update the resource availability in the assigned resource scenario, and calculate the benefits, costs and optimization goals of meeting the task in the assigned resource scenario; otherwise, if it cannot be satisfied on demand, make the task request Lost.
  8. 一种物联网资源分配系统,其特征在于,包括:An Internet of Things resource allocation system is characterized in that it comprises:
    初始化模块:用于基于接收到的资源分配任务请求,采用目标与密度感知算法对飞蛾扑火算法的飞蛾向量集合进行初始化,得到初始化飞蛾向量集合;Initialization module: used to initialize the moth vector set of the moth-flaming algorithm by using the target and density-aware algorithm based on the received resource allocation task request, and obtain the initialized moth vector set;
    健康值评估模块:用于对所述初始化飞蛾向量集合中每个飞蛾的健康值进行评估,并选出健康值最高的前k个飞蛾作为新的火焰向量;Health value evaluation module: used to evaluate the health value of each moth in the initialized moth vector set, and select the top k moths with the highest health value as new flame vectors;
    飞蛾-火焰匹配模块:用于基于所述新的火焰向量,采用渐进阶级火焰匹配算法以及探索式飞蛾火焰匹配算法计算飞蛾对应的阶级火焰,将飞蛾与对应的阶级火焰进行匹配,并当仅有一个存活火焰时,根据所述存活火焰生成所述任务请求的资源分配方案;Moth-flame matching module: used to calculate the class flame corresponding to the moth by using the progressive class flame matching algorithm and the exploratory moth flame matching algorithm based on the new flame vector, and match the moth with the corresponding class flame, And when there is only one surviving flame, generate a resource allocation plan for the task request according to the surviving flame;
    资源分配模块:用于基于数字对象的物联网资源抽象架构,采用资源调度与分配算法执行所述资源分配方案,对所述任务请求进行资源调度与分配。Resource allocation module: used for the resource abstraction architecture of the Internet of Things based on digital objects, adopting resource scheduling and allocation algorithms to implement the resource allocation plan, and performing resource scheduling and allocation for the task requests.
  9. 一种终端,其特征在于,所述终端包括处理器、与所述处理器耦接的存储器,其中,A terminal, characterized in that the terminal includes a processor and a memory coupled to the processor, wherein,
    所述存储器存储有用于实现权利要求1-7任一项所述的物联网资源分配方法的程序指令;The memory stores program instructions for implementing the resource allocation method of the Internet of Things according to any one of claims 1-7;
    所述处理器用于执行所述存储器存储的所述程序指令以控制物联网资源分配。The processor is configured to execute the program instructions stored in the memory to control resource allocation of the Internet of Things.
  10. 一种存储介质,其特征在于,存储有处理器可运行的程序指令,所述程序指令用于执行权利要求1至7任一项所述物联网资源分配方法。A storage medium, characterized in that it stores program instructions executable by a processor, and the program instructions are used to execute the method for allocating resources of the Internet of Things according to any one of claims 1 to 7.
PCT/CN2022/140066 2022-01-11 2022-12-19 Internet of things resource allocation method and system, terminal and storage medium WO2023134403A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210026373.0 2022-01-11
CN202210026373.0A CN114390102B (en) 2022-01-11 2022-01-11 Internet of things resource allocation method, system, terminal and storage medium

Publications (1)

Publication Number Publication Date
WO2023134403A1 true WO2023134403A1 (en) 2023-07-20

Family

ID=81201951

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/140066 WO2023134403A1 (en) 2022-01-11 2022-12-19 Internet of things resource allocation method and system, terminal and storage medium

Country Status (2)

Country Link
CN (1) CN114390102B (en)
WO (1) WO2023134403A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113723867A (en) * 2021-05-21 2021-11-30 深圳市海柔创新科技有限公司 Method, apparatus, device, storage medium and program product for resource allocation

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114390102B (en) * 2022-01-11 2023-07-14 中国科学院深圳先进技术研究院 Internet of things resource allocation method, system, terminal and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062585A (en) * 2017-12-29 2018-05-22 航天科工智慧产业发展有限公司 A kind of method that Function Extreme value is calculated based on a flying moth darts into the fire algorithm
CN109598296A (en) * 2018-11-26 2019-04-09 长安大学 One kind is based on a flying moth darts into the fire the K mean cluster method of improvement
WO2019217629A1 (en) * 2018-05-11 2019-11-14 Qualcomm Incorporated Shared channel design around reserved resources
CN114390102A (en) * 2022-01-11 2022-04-22 中国科学院深圳先进技术研究院 Internet of things resource allocation method, system, terminal and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106802822A (en) * 2016-12-30 2017-06-06 南京邮电大学 A kind of cloud data center cognitive resources dispatching method based on moth algorithm
CN113222096B (en) * 2021-04-30 2022-11-11 桂林理工大学 Improved particle swarm algorithm for cloud computing task scheduling
CN113656153A (en) * 2021-06-29 2021-11-16 桂林理工大学 Improved artificial bee colony algorithm for cloud computing task scheduling

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108062585A (en) * 2017-12-29 2018-05-22 航天科工智慧产业发展有限公司 A kind of method that Function Extreme value is calculated based on a flying moth darts into the fire algorithm
WO2019217629A1 (en) * 2018-05-11 2019-11-14 Qualcomm Incorporated Shared channel design around reserved resources
CN109598296A (en) * 2018-11-26 2019-04-09 长安大学 One kind is based on a flying moth darts into the fire the K mean cluster method of improvement
CN114390102A (en) * 2022-01-11 2022-04-22 中国科学院深圳先进技术研究院 Internet of things resource allocation method, system, terminal and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
TIAN, HONG ET AL.: "Research on New Moth-Flame Optimization Algorithm", COMPUTER ENGINEERING AND APPLICATIONS, vol. 55, no. 16, 26 October 2018 (2018-10-26), XP009547729, ISSN: 1002-8331 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113723867A (en) * 2021-05-21 2021-11-30 深圳市海柔创新科技有限公司 Method, apparatus, device, storage medium and program product for resource allocation
CN113723867B (en) * 2021-05-21 2024-04-26 深圳市海柔创新科技有限公司 Method, apparatus, device, storage medium and program product for resource allocation

Also Published As

Publication number Publication date
CN114390102B (en) 2023-07-14
CN114390102A (en) 2022-04-22

Similar Documents

Publication Publication Date Title
WO2023134403A1 (en) Internet of things resource allocation method and system, terminal and storage medium
Wang et al. Task scheduling algorithm based on improved firework algorithm in fog computing
CN115237581B (en) Heterogeneous computing power-oriented multi-strategy intelligent scheduling method and device
Grace et al. Dynamic replica placement and selection strategies in data grids—a comprehensive survey
JP2022137182A (en) Federated learning method, device, equipment and storage medium
Kaur et al. Deep‐Q learning‐based heterogeneous earliest finish time scheduling algorithm for scientific workflows in cloud
CN109634742B (en) Time constraint scientific workflow optimization method based on ant colony algorithm
CN113485826B (en) Load balancing method and system for edge server
CN111708641B (en) Memory management method, device, equipment and computer readable storage medium
CN103970607A (en) Computing Optimized Virtual Machine Allocations Using Equivalence Combinations
CN111813506A (en) Resource sensing calculation migration method, device and medium based on particle swarm algorithm
Ogundoyin et al. Optimization techniques and applications in fog computing: An exhaustive survey
CN109447264B (en) Virtual machine placement genetic optimization method based on VHAM-R model in cloud computing environment
CN111176784B (en) Virtual machine integration method based on extreme learning machine and ant colony system
CN110162390B (en) Task allocation method and system for fog computing system
CN112463337B (en) Workflow task migration method used in mobile edge computing environment
Liumei et al. Towards energy efficient cloud: an optimized ant colony model for virtual machine placement
CN114546608A (en) Task scheduling method based on edge calculation
JP2022136234A (en) Federated learning method and apparatus, electronic apparatus, storage medium, and computer program
Samriya et al. Spider monkey optimization based energy-efficient resource allocation in cloud environment
CN115016889A (en) Virtual machine optimization scheduling method for cloud computing
CN112165721B (en) Multi-service task unloading and service migration method based on edge computing
CN117687759A (en) Task scheduling method, device, processing equipment and readable storage medium
CN117436627A (en) Task allocation method, device, terminal equipment and medium
CN116321189A (en) Server deployment method based on deep reinforcement learning in edge-oriented computing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22920034

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE