CN114666251A - Ant colony algorithm-based data polling method and related device - Google Patents

Ant colony algorithm-based data polling method and related device Download PDF

Info

Publication number
CN114666251A
CN114666251A CN202210135478.XA CN202210135478A CN114666251A CN 114666251 A CN114666251 A CN 114666251A CN 202210135478 A CN202210135478 A CN 202210135478A CN 114666251 A CN114666251 A CN 114666251A
Authority
CN
China
Prior art keywords
path
ant
polling
determining
candidate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210135478.XA
Other languages
Chinese (zh)
Inventor
林后凯
方文
刘永涛
赵承宇
陈星星
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Huaxiao Technology Co ltd
Original Assignee
Zhejiang Huaxiao Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Huaxiao Technology Co ltd filed Critical Zhejiang Huaxiao Technology Co ltd
Priority to CN202210135478.XA priority Critical patent/CN114666251A/en
Publication of CN114666251A publication Critical patent/CN114666251A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/10Active monitoring, e.g. heartbeat, ping or trace-route
    • H04L43/103Active monitoring, e.g. heartbeat, ping or trace-route with adaptive polling, i.e. dynamically adapting the polling rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q9/00Arrangements in telecontrol or telemetry systems for selectively calling a substation from a main station, in which substation desired apparatus is selected for applying a control signal thereto or for obtaining measured values therefrom

Abstract

The invention provides a data polling method and a related device based on an ant colony algorithm, wherein the data polling method comprises the following steps: determining a first heuristic activity value and a first pheromone content corresponding to a path between a first current device and a device in a first candidate device set; the first candidate device set comprises devices around a first current device, and the first current device is a device traversed by a first ant currently; determining first to-be-traversed equipment corresponding to the first ant from the first candidate equipment set based on the first heuristic activity value and the first pheromone content; and obtaining a polling path of a first ant based on the first current device and the first to-be-traversed device, and performing data polling based on the polling path of the first ant. The method can adaptively plan the optimal full-coverage polling path in different environments, and improves the adaptability of the algorithm to the environment.

Description

Ant colony algorithm-based data polling method and related device
Technical Field
The present invention relates to the field of wireless communication technologies, and in particular, to a data polling method and a related apparatus based on an ant colony algorithm.
Background
The smoke sensor is used as key equipment of the fire-fighting Internet of things technology, has important application advantages in home, office, education, finance and public places, and is an important direction for intelligent and visual development of the fire-fighting industry by acquiring data and uploading the data to a cloud platform in real time by means of a gateway. The current situation of fire prevention and control is that massive smoke sensing equipment is needed to collect front-end data, the method for uploading smoke sensing collected data on a platform in the current application technology mostly focuses on simple sequential polling, and data in a certain area usually appears too much attention at a certain moment during polling, so that the reliability of the collected data is reduced, the sensitivity of the platform to fire is greatly influenced, and important technical challenges are provided for the promotion of the polling method.
Because the time cost of the gateway polling for one circle is fixed, but a large number of detection intersections inevitably exist in the smoke sensing equipment group during detection, and it is necessary to plan a reasonable polling sequence to improve the reliability of data acquired by polling for one circle in any environment, so that research on a multi-smoke sensing equipment data self-adaptive polling method which can adapt to different environments is developed, and the method has important scientific research value and practical significance.
Disclosure of Invention
The invention provides a data polling method based on an ant colony algorithm and a related device, and the method can self-adaptively plan an optimal full-coverage polling path in different environments, thereby improving the adaptability of the algorithm to the environment.
In order to solve the above technical problems, a first technical solution provided by the present invention is: the data polling method based on the ant colony algorithm comprises the following steps: determining a first heuristic activity value and a first pheromone content corresponding to a path between a first current device and a device in a first candidate device set; the first candidate device set comprises devices around a first current device, and the first current device is a device traversed by a first ant currently; determining first equipment to be traversed corresponding to the first ant from the first candidate equipment set based on the first heuristic activity value and the first pheromone content; and obtaining a polling path of a first ant based on the first current device and the first to-be-traversed device, and performing data polling based on the polling path of the first ant.
After the step of obtaining the polling path of the first ant based on the first current device and the first device to be traversed, the method includes: acquiring pheromone increment of each sub-path in the polling path of the first ant; the sub-path is a path between adjacent devices in the polling path; updating the corresponding first pheromone content by utilizing the pheromone increment of each sub-path to obtain a second pheromone content; determining a polling path of a second ant based on the content of a second pheromone, wherein the initial polling equipment of the second ant is the same as that of the first ant; the data polling step based on the polling path of the first ant comprises the following steps: and performing data polling based on the polling path of the second ant.
Wherein the step of determining the polling path of the second ant based on the content of the second pheromone comprises: determining a second heuristic activity value corresponding to a path between a second current device and a device in a second candidate set; the second candidate set comprises devices around the second current device, and the second current device is a device traversed by the second ant currently; determining second equipment to be traversed corresponding to the second ant from the second candidate set based on the second heuristic activity value and the second pheromone content; and obtaining a polling path of the second ant based on the second current device and the second device to be traversed.
Wherein the step of determining a first heuristic Activity value comprises: determining a first path weight of a path between a first current device and a device in a first candidate device set; determining a first heuristic activity value based on the first path weight, the activity value of the first current device, the external restraint parameter of the first current device, the external excitation parameter of the first current device, the variation attenuation rate of the activity value of the first current device, and the upper limit value and the lower limit value of the activity value of the first current device; a step of determining a second heuristic activity value, comprising: determining a second path weight of a path between a second current device and a device in a second candidate device set; and determining a second heuristic activity value based on the second path weight, the activity value of the second current device, the external restraint parameter of the second current device, the external excitation parameter of the second current device, the variation attenuation rate of the activity value of the second current device, and the upper limit value and the lower limit value of the activity value of the second current device.
Wherein the step of determining a first path weight for a path between the first current device and a device in the first candidate device set comprises: determining a first signal value between the first current device and a device in the first candidate device set; determining a first path weight based on a first signal value, a first active propagation velocity parameter and a weight of the first signal value in response to the first signal value being at (0, R), R being a distance between a first current device and a device in a first set of candidate devices, determining a first path weight based on the first signal value, the first active propagation velocity parameter in response to the first signal value being at (R, 2R), determining a first path weight based on the first signal value, the first active propagation velocity parameter in response to the first signal value being at (2R, ∞), the first path weight being 0, determining a second path weight for a path between a second current device and a device in a second set of candidate devices, comprising determining a second signal value between the second current device and a device in the second set of candidate devices, determining a second path weight based on the second signal value, the second active propagation velocity parameter and a weight of the second signal value in response to the second signal value being at (0, R), R being a second path weight for a device in the second set of candidate devices and the second set of candidate devices The distance between them; a second path weight is determined based on the second signal value and the second active propagation velocity parameter in response to the second signal value being at (R, 2R), and the second path weight is 0 in response to the second signal value being at (2R, ∞).
The step of determining a first to-be-traversed device corresponding to a first ant from the first candidate device set based on the first heuristic activity value and the first pheromone content includes: calculating a first state transition probability for each device in the first candidate device set based on the first heuristic activity value and the second pheromone content; determining a first device to be traversed from the first candidate device set based on the first state transition probability; the step of determining a second device to be traversed corresponding to a second ant from a second candidate set based on a second heuristic activity value and a second pheromone content includes: calculating a second state transition probability for each device in the second candidate device set based on the second heuristic activity value and the second pheromone content; a second device to be traversed is determined from the second set of candidate devices based on the second state transition probability.
The method for obtaining the polling path of the first ant based on the first current device and the first device to be traversed further comprises the following steps: determining whether all devices in the environment have been traversed; in response, a polling path for the first ant is obtained based on the first current device and the first to-be-traversed device.
In order to solve the above technical problems, a second technical solution provided by the present invention is: provided is an ant colony algorithm-based data polling device, including: a parameter determination module for determining a first heuristic activity value and a first pheromone content corresponding to a path between a first current device and a device in a first candidate device set; the first candidate device set comprises devices around the first current device, and the second current device is a device traversed by the first ant currently; the equipment selection module is used for determining first equipment to be traversed corresponding to the first ant from the first candidate equipment set based on the first heuristic activity value and the first pheromone content; and the path generation module is used for obtaining a polling path of a first ant based on the first current device and the first to-be-traversed device and carrying out data polling based on the polling path of the first ant.
In order to solve the above technical problems, a third technical solution provided by the present invention is: there is provided an electronic device comprising a processor and a memory coupled to each other, wherein the memory is adapted to store program instructions for implementing any of the methods described above; the processor is operable to execute program instructions stored by the memory.
In order to solve the above technical problems, a fourth technical solution provided by the present invention is: there is provided a computer readable storage medium storing a program file executable to implement the method of any of the above.
The method has the advantages that the method is different from the prior art, and the first equipment to be traversed corresponding to the first ant is determined from the first candidate equipment set through the first heuristic activity value and the first pheromone content corresponding to the path between the first current equipment and the equipment in the first candidate equipment set; and obtaining a polling path of a first ant based on the first current device and the first equipment to be traversed, and polling data based on the polling path of the first ant. The method determines the equipment to be traversed from the environment, and can self-adaptively plan the optimal full-coverage polling path in different environments, thereby improving the adaptability of the algorithm to the environment.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without inventive efforts, wherein:
fig. 1 is a schematic flow chart of a first embodiment of the ant colony algorithm-based data polling method according to the present invention;
FIG. 2 is a diagram illustrating the distribution of a first current device and a first candidate device set according to the present invention;
FIG. 3 is a flowchart illustrating an embodiment of step S12 in FIG. 1;
fig. 4 is a schematic flowchart of a second embodiment of the ant colony algorithm-based data polling method according to the present invention;
fig. 5 is a schematic structural diagram of an embodiment of the ant colony algorithm-based data polling device according to the present invention;
FIG. 6 is a schematic structural diagram of an embodiment of an electronic device of the present invention;
FIG. 7 is a schematic diagram of the structure of the computer readable storage medium of the present invention.
Detailed description of the invention
The terms "first", "second" and "third" in this application are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implying any indication of the number of technical features indicated. Thus, a feature defined as "first," "second," or "third" may explicitly or implicitly include at least one of the feature. In the description of the present application, "plurality" means at least two, e.g., two, three, etc., unless explicitly specifically limited otherwise. All directional indications (such as up, down, left, right, front, and rear … …) in the embodiments of the present application are only used to explain the relative positional relationship between the components, the movement, and the like in a specific posture (as shown in the drawings), and if the specific posture is changed, the directional indication is changed accordingly. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein may be combined with other embodiments.
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, a schematic flow chart of a first embodiment of the ant colony algorithm-based data polling method of the present invention specifically includes:
step S11: a first heuristic activity value and a first pheromone content corresponding to a path between a first current device and a device in a first candidate device set are determined.
Specifically, a polling initiator is set, and the first ant starts sampling from the polling initiator. When a device samples a device point, that device point is defined as the first current device. The first ant needs to find out the next device point needing polling, namely the first device point to be traversed, from the devices around the first current device. In particular, devices around the first current device constitute a first set of candidate devices.
Further, a first heuristic activity value and a first pheromone content corresponding to a path between the first current device and a device in the first set of candidate devices are determined. Referring to fig. 2, assuming that the first current device is a, the first set of candidate devices includes device B, C, D, E, F, G, H, I, J; it is necessary to determine a first heuristic activity value X on the path of the first current device a to device BabAnd a first pheromone content tauabDetermining a first heuristic Activity value X on the path of the first current device A to device CacAnd a first pheromone content tauac… …, a first heuristic Activity value X on the path of the first current device A to the device J is determinedaJAnd a first pheromone content tauaJ
In an embodiment, the step of determining a first heuristic activity value comprises: determining a first path weight of a path between a first current device and a device in a first candidate device set; and determining a first heuristic activity value based on the first path weight, the activity value of the first current device, the external inhibition parameter of the first current device, the external excitation parameter of the first current device, the variation attenuation rate of the activity value of the first current device, and the upper limit value and the lower limit value of the activity value of the first current device.
Specifically, a path from the first current device a to the device B is taken as an example for explanation. Determining a first path weight W for a path from device A to device BAB. Based on the weight W of the first pathABAn activity value of a first current device A, an external inhibition parameter of the first current device A, and an external inhibition parameter of the first current device ADetermining a first heuristic activity value X by the excitation parameter, the attenuation rate a of the change of the activity value of the first current device, the upper limit value b and the lower limit value d of the activity value of the first current deviceab
In a specific embodiment, the activity value of the first current device i may be obtained by calculating according to the following formula, and in the actual calculation, the activity value of the first current device i is the first heuristic activity value of the path from the first current device i to the device j:
Figure BDA0003504342990000071
wherein a represents the change attenuation rate of the activity value of the device i, the device i is the first current device, b represents the upper line value of the activity value of the device i, and d represents the lower limit value of the activity value of the device i. Wherein a, b and d are all non-negative constants. K denotes the total number of devices in the first candidate device set, xiDenotes the activity value of the device I, [ I ]i]-An external suppression parameter representing the external suppression parameter of the device i,
Figure BDA0003504342990000072
representing the external excitatory excitation parameter of the device i and t representing time. Wherein, WijA first path weight representing a path between device i and device j. Specifically, [ I ]i]+=max(0,Ii),[Ii]-=max(0,-Ii),IiThe value of (d) depends on the state of the device i. In particular, for devices that have already been traversed, IiFor a device not traversed, I ═ 0i=E。
In an embodiment, a first path weight W of a path between device i and device jijDetermined by a first signal value between device i (the first current device) and device j in the first set of candidate devices. Specifically, a bluetooth mesh function of the device is used to collect a first signal value between the device i and the device j. In response to the first signal value being at (0, r)]Determining a first path weight based on the first signal value, the first active propagation velocity parameter, and a weight of the first signal value; r is the first current valueDistance between the device and the devices in the first candidate device set; in response to the first signal value being at (r, 2 r)]Determining a first path weight based on the first signal value and the first active propagation speed parameter; in response to the first signal value being at (2r, ∞), the first path weight is 0.
In one embodiment, the first path weight WijThe calculation method of (2) is as follows formula (1):
Figure BDA0003504342990000073
wherein u is a first active propagation velocity parameter, usually a non-negative constant, and the change of the Mars propagation velocity between devices can be realized by changing the size of u; dijRepresenting a first signal value between device i and device j, λ represents a weight of the first signal value, and r represents a distance between device i and device j.
The first heuristic activity value is determined as described above, and in one embodiment, the first pheromone content value may be predetermined if the first ant is a first ant. I.e. the value of the first pheromone content is a random value.
Step S12: and determining a first to-be-traversed device corresponding to the first ant from the first candidate device set based on the first heuristic activity value and the first pheromone content.
After the first heuristic activity value and the first pheromone content are determined through the step S11, a first to-be-traversed device corresponding to the first ant is determined from the first candidate device set based on the first heuristic activity value and the first pheromone content.
Specifically, referring to fig. 3, step S12 further includes:
step S31: a first state transition probability is calculated for each device in the first set of candidate devices based on the first heuristic activity value and the second pheromone content.
In one embodiment, the first state transition probability of each device may be calculated by the following equation (2):
Figure BDA0003504342990000081
among them, allowedkA first candidate device set is shown, it should be noted that the devices in the first candidate device set are devices with active values, i.e. allowedkIndicating that ant k can select a device set with an activity value next; tau isij(k) Representing a first pheromone content on a path from the device i to the device j during the k-th route searching; x is the number ofij(t) denotes the first heuristic activity value on the path from device i to device j at time t, α, β denote weight coefficients. The above formula (2) shows that the influencing factors of the state transition probability are determined by the heuristic activity value and pheromone content from the current equipment to the surrounding equipment. It should be noted that the heuristic activity value is adaptively changed along with the sampling of ants.
Step S32: determining a first device to be traversed from the first set of candidate devices based on the first state transition probability;
after determining the first state transition probabilities of all devices around the first current device, the first device to be traversed is further determined from the first candidate device set (all devices around the first current device) based on the first state transition probabilities.
It is to be understood that, in an embodiment, the device with the highest probability of state transition is determined as the first device to be traversed. As shown in fig. 2, assuming that the device C is the first device to be traversed, the first ant samples from the device a to the device C to obtain a sub-path, and then the device C is used as the first current device, and the above steps are repeatedly performed until all devices are traversed.
Specifically, each sampling and walking step of the ant k needs to judge whether to complete full traversal of all the devices, if the devices with the activity values still exist in the device table with the activity values, the ant directly judges that the full traversal planning is not completed, the ant continuously samples and searches the next device point, if the devices with the activity values do not exist in the device table with the activity values, all the device tables need to be inquired to judge whether the devices really complete the full traversal planning, and if the devices are detected to be completely searched, the ant k continues to perform the next step. That is, after the first device to be traversed is determined, it is determined whether all devices in the environment have been traversed, and in response, a polling path for the first ant is obtained based on the first current device and the first device to be traversed.
Step S13: and obtaining a polling path of a first ant based on the first current device and the first equipment to be traversed, and polling data based on the polling path of the first ant.
Specifically, a polling path of a first ant is obtained based on the first current device and the first device to be traversed, and data polling is performed based on the polling path of the first ant.
The data polling method shown in this embodiment provides a weight value for converting the inter-device signal value detected by the bluetooth Mesh module into a path plan, and affects the probability of the device to be sampled by setting a corresponding constraint condition, thereby improving the dispersibility during sampling, avoiding the occurrence of over-attention to data in a certain area at a certain time in sequential polling, and improving the reliability of the polling result. The method for calculating the heuristic factor content value of the ant colony algorithm by introducing the biostimulation neural network algorithm is provided, an excellent full-coverage polling path is formed in the planning position where the algorithm can be self-adaptive in different environments by enlightening the dynamic change of the activity value, the adaptability of the algorithm to the environment is improved, the current equipment to be sampled is searched in the equipment activity value table, the cost for maintaining the equipment activity value table is lower than that of a tabu table, and the robustness of the algorithm is enhanced.
In an embodiment, in order to obtain a more accurate data polling path, path polling is generally performed by using multiple ants, after a first ant performs polling to obtain a polling path, the pheromone content on a path corresponding to equipment related to the polling path is updated by using the pheromone content of the obtained polling path, then the polling path of a second ant is determined by using the updated pheromone content, and so on until the last ant obtains the polling path, which is the polling path with the highest final accuracy and the best robustness.
Specifically, referring to fig. 4, fig. 4 is a flowchart illustrating a second embodiment of the ant colony algorithm-based data polling method according to the present invention, wherein steps S41 and S42 are the same as steps S11 and S12 in the embodiment shown in fig. 1, except that the embodiment further includes, after step S42:
step S43: and obtaining a polling path of the first ant based on the first current device and the first to-be-traversed device.
Step S44: acquiring pheromone increment of each sub-path in the polling path of the first ant; the sub-path is a path between adjacent devices in the polling path.
Specifically, the pheromone increment of each sub-path in the polling path of the first ant is determined, it should be noted that the sub-path is a path between adjacent devices in the polling path, as shown in fig. 2, the sub-path is a path between a device a and a device C.
Step S45: and updating the corresponding first pheromone content by utilizing the pheromone increment of each sub-path to obtain a second pheromone content.
Specifically, the corresponding first pheromone content is updated by using the pheromone increment of each sub-path to obtain a second pheromone content. In a specific embodiment, the first pheromone content is the pheromone content on the path from the device a to the device C, an pheromone increment on the path from the device a to the device C is obtained from the polling path of the first ant, and the first pheromone content on the path from the device a to the device C is updated by using the pheromone increment on the path from the device a to the device C, so that the second pheromone content on the path from the device a to the device C is obtained. The first pheromone content of each sub-path on the polling path of the first ant is updated by the method.
In one embodiment, the pheromone content is updated as follows:
Figure BDA0003504342990000111
wherein rho represents pheromone residual factor and has a value range of [0, 1%],ΔτijIndicating pheromone increment in the environment after the ant k completes the polling on the path from the equipment i to the equipment j, and m indicating the number of the ants.
Step S46: determining a polling path for a second ant based on a second pheromone content, the second ant having the same initial polling device as the first ant.
After the second pheromone content is obtained in the above mode, the polling path of the second ant is determined based on the second pheromone content.
Note that the initial polling device for the second ant is the same as the initial polling device for the first ant. That is, a second ant is selected from m ants to begin sampling from the initial polling device, resulting in a polling path for the second ant.
Specifically, a second heuristic activity value corresponding to a path between a second current device and a device in the second candidate set is determined; the second candidate set includes devices around a second current device that is currently traversed by the second ant. And determining a second device to be traversed corresponding to the second ant from the second candidate set based on the second heuristic activity value and the second pheromone content. And obtaining a polling path of the second ant based on the second current device and the second device to be traversed.
In an embodiment, the step of determining the second heuristic activity value comprises: determining a second path weight of a path between a second current device and a device in a second candidate device set; and determining a second heuristic activity value based on the second path weight, the activity value of the second current device, the external restraint parameter of the second current device, the external excitation parameter of the second current device, the variation attenuation rate of the activity value of the second current device, and the upper limit value and the lower limit value of the activity value of the second current device.
Specifically, the activity value of the second current device i may be obtained by calculation through the following formula, and in actual calculation, the activity value of the second current device i is a second heuristic activity value of a path from the second current device i to the device j:
Figure BDA0003504342990000112
wherein a represents the change attenuation rate of the activity value of the device i, the device i is the second current device, b represents the upper line value of the activity value of the device i, and d represents the lower limit value of the activity value of the device i. Wherein a, b and d are all non-negative constants. K denotes the total number of devices in the second candidate device set, xiDenotes the activity value of the device I, [ I ]i]-An external suppression parameter representing the device i,
Figure BDA0003504342990000121
representing the external excitatory excitation parameter of the device i and t representing time. Wherein, WijA second path weight representing a path between device i and device j. Specifically, [ I ]i]+=max(0,Ii),[Ii]-=max(0,-Ii),IiThe value of (d) depends on the state of the device i. In particular, for devices that have already been traversed, IiFor a device not traversed, Ii=E。
In an embodiment, the second path weight W of the path between device i and device jijDetermined by a second signal value between device i (the second current device) and device j in the second set of candidate devices. Specifically, a second signal value between the device i and the device j is acquired by using a bluetooth mesh function of the device. In response to the second signal value being at (0, R)]Determining a second path weight based on the second signal value, the second active propagation velocity parameter, and the weight of the second signal value; r is the distance between the second current device and the devices in the second candidate device set; in response to the second signal value being at (R, 2R)]Determining a second path weight based on the second signal value and the second activity propagation speed parameter; in response to the second signal value being at (2R, ∞), the second path weight is 0.
In one embodiment, the second path weights WijThe calculation method of (2) is as follows formula (1):
Figure BDA0003504342990000122
wherein u is a second active propagation velocity parameter, usually a non-negative constant, and the change of the Mars propagation velocity between devices can be realized by changing the size of u; dijRepresenting a second signal value between device i and device j, λ represents a weight of the second signal value, and R represents a distance between device i and device j.
After the second heuristic activity value and the second pheromone content are determined, further calculating through a formula (2) to obtain a second state transition probability of each device in the second candidate device set; a second device to be traversed is determined from the second set of candidate devices based on the second state transition probability. And obtaining a polling path of a second ant based on the second current device and the second device to be traversed.
In an embodiment, if the second ant is the last ant, the polling path of the second ant is the final data polling path, and if the second ant is not the last ant, the pheromone content is further updated by using the polling path of the second ant, the steps are repeated, the third ant is used for sampling again to obtain the polling path of the third ant until the last ant is traversed, and the final polling path is obtained.
Step S47: and performing data polling based on the polling path of the second ant.
Specifically, assuming that the polling path of the second ant is the final data polling path, the polling path of the second ant is saved, and when data polling is performed, polling is performed by using the saved data polling path.
The data polling method can be applied to the fire-fighting internet technology. Polling is carried out through a plurality of ants, the content of pheromones is changed, convergence is gradually carried out, and the most accurate polling path is finally obtained.
Referring to fig. 5, a schematic structural diagram of an embodiment of the data polling apparatus based on the ant colony algorithm in the present invention specifically includes: a parameter determination module 51, a device selection module 52 and a path generation module 53.
Wherein the parameter determining module 51 is configured to determine a first heuristic activity value and a first pheromone content corresponding to a path between the first current device and a device in the first candidate device set; the first set of candidate devices includes devices surrounding the first current device, and the second current device is the device currently traversed by the first ant.
The device selection module 52 is configured to determine, from the first candidate device set, a first to-be-traversed device corresponding to the first ant based on the first heuristic activity value and the first pheromone content;
the path generating module 53 is configured to obtain a polling path of a first ant based on the first current device and the first device to be traversed, and perform data polling based on the polling path of the first ant.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the invention. The electronic device comprises a memory 82 and a processor 81 connected to each other.
The memory 82 is used to store program instructions implementing the method of any one of the above.
Processor 81 is operative to execute program instructions stored in memory 82.
The processor 81 may also be referred to as a CPU (Central Processing Unit). The processor 81 may be an integrated circuit chip having signal processing capabilities. Processor 81 may also be a general purpose processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 82 may be a memory bank, TF card, etc. and may store all information in the electronic device, including the input raw data, computer programs, intermediate operation results, and final operation results, all stored in the memory. It stores and retrieves information based on the location specified by the controller. With the memory, the electronic device can only have the memory function to ensure the normal operation. The storage of electronic devices can be classified into a main storage (internal storage) and an auxiliary storage (external storage) according to the use, and also into an external storage and an internal storage. The external memory is usually a magnetic medium, an optical disk, or the like, and can store information for a long period of time. The memory refers to a storage component on the main board, which is used for storing data and programs currently being executed, but is only used for temporarily storing the programs and the data, and the data is lost when the power is turned off or the power is cut off.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented by other methods. For example, the above-described apparatus implementation methods are merely illustrative, e.g., the division of modules or units into only one logical functional division, and additional division methods may be implemented in practice, e.g., units or components may be combined or integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment of the method.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a system server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the implementation method of the present application.
Fig. 7 is a schematic structural diagram of a computer-readable storage medium according to the present invention. The storage medium of the present application stores a program file 91 capable of implementing all the methods, wherein the program file 91 may be stored in the storage medium in the form of a software product, and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute all or part of the steps of each implementation method of the present application. The aforementioned storage device includes: various media capable of storing program codes, such as a usb disk, a portable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, or terminal devices such as a computer, a server, a mobile phone, and a tablet.
The above description is only an implementation method of the present invention, and not intended to limit the scope of the present invention, and all equivalent structures or equivalent flow transformations made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. A data polling method based on an ant colony algorithm is characterized by comprising the following steps:
determining a first heuristic activity value and a first pheromone content corresponding to a path between a first current device and a device in a first candidate device set; the first candidate device set comprises devices around the first current device, and the first current device is a device currently traversed by a first ant;
determining a first to-be-traversed device corresponding to the first ant from the first candidate device set based on the first heuristic activity value and the first pheromone content;
and obtaining a polling path of the first ant based on the first current device and the first device to be traversed, and polling data based on the polling path of the first ant.
2. The data polling method of claim 1, wherein the step of obtaining the polling path of the first ant based on the first current device and the first traversal device is followed by:
acquiring pheromone increment of each sub-path in the polling path of the first ant; the sub-path is a path between adjacent devices in the polling path;
updating the corresponding first pheromone content by utilizing the pheromone increment of each sub-path to obtain a second pheromone content;
determining a polling path of a second ant based on the second pheromone content, the second ant having the same initial polling device as the first ant;
the step of performing data polling based on the polling path of the first ant includes:
and performing data polling based on the polling path of the second ant.
3. The data polling method of claim 2, wherein the step of determining a polling path for a second ant based on the second pheromone content comprises:
determining a second heuristic activity value corresponding to a path between a second current device and a device in a second candidate set; the second candidate set comprises devices around the second current device, and the second current device is a device currently traversed by the second ant;
determining a second device to be traversed corresponding to the second ant from the second candidate set based on the second heuristic activity value and the second pheromone content;
and obtaining a polling path of the second ant based on the second current device and the second device to be traversed.
4. The method of claim 3, wherein the step of determining the first heuristic activity value comprises:
determining a first path weight of a path between the first current device and a device in the first candidate device set;
determining the first heuristic activity value based on the first path weight, the activity value of the first current device, an external suppression parameter of the first current device, an external excitement parameter of the first current device, an activity value variation attenuation rate of the first current device, and an activity value upper limit value and a lower limit value of the first current device;
a step of determining said second heuristic activity value, comprising:
determining a second path weight of a path between a second current device and a device in the second candidate device set;
determining the second heuristic activity value based on the second path weight, the activity value of the second current device, the external suppression parameter of the second current device, the external excitement parameter of the second current device, the attenuation rate of the change in the activity value of the second current device, and the upper and lower limit values of the activity value of the second current device.
5. The method according to claim 4, wherein the step of determining the first path weight of the path between the first current device and the device in the first candidate device set comprises:
determining a first signal value between the first current device and a device in the first set of candidate devices;
determining the first path weight based on the first signal value, a first active propagation velocity parameter, and a weight of the first signal value in response to the first signal value being at (0, r), r being a distance between the first current device and a device in the first set of candidate devices;
in response to the first signal value being at (r, 2 r), determining the first path weight based on the first signal value, a first active propagation velocity parameter;
in response to the first signal value being at (2r, infinity), the first path weight being 0;
the step of determining a second path weight for a path between a second current device and a device in the second candidate device set comprises:
determining a second signal value between the second current device and a device in the second candidate device set;
determining the second path weight based on the second signal value, a second active propagation velocity parameter, and a weight of the second signal value in response to the second signal value being at (0, R), where R is a distance between the second current device and a device in the second set of candidate devices;
determining the second path weight based on the second signal value, a second active propagation velocity parameter, in response to the second signal value being at (R, 2R);
in response to the second signal values being at (2R, ∞), the second path weight is 0.
6. The data polling method of claim 3, wherein the step of determining the first to-be-traversed device corresponding to the first ant from the first candidate device set based on the first heuristic activity value and the first pheromone content comprises:
calculating a first state transition probability for each device in the first set of candidate devices based on the first heuristic activity value, the second pheromone content;
determining the first device to be traversed from the first set of candidate devices based on the first state transition probability;
the step of determining a second device to be traversed corresponding to the second ant from the second candidate set based on the second heuristic activity value and the second pheromone content includes:
calculating a second state transition probability for each device in the second set of candidate devices based on the second heuristic activity value, the second pheromone content;
determining the second device to traverse from the second set of candidate devices based on the second state transition probability.
7. The data polling method of claim 1, wherein the step of obtaining the polling path of the first ant based on the first current device and the first traversal device is preceded by:
determining whether all devices in the environment have been traversed;
in response, a polling path for the first ant is obtained based on the first current device and the first to-be-traversed device.
8. An ant colony algorithm-based data polling device, comprising:
a parameter determination module for determining a first heuristic activity value and a first pheromone content corresponding to a path between a first current device and a device in a first candidate device set; the first candidate device set comprises devices around the first current device, and the second current device is a device currently traversed by the first ant;
a device selection module, configured to determine, from the first set of candidate devices, a first to-be-traversed device corresponding to the first ant based on the first heuristic activity value and the first pheromone content;
and the path generation module is used for obtaining the polling path of the first ant based on the first current device and the first device to be traversed and carrying out data polling based on the polling path of the first ant.
9. An electronic device comprising a processor and a memory coupled to each other, wherein,
the memory for storing program instructions for implementing the method of any one of claims 1-7;
the processor is configured to execute the program instructions stored by the memory.
10. A computer-readable storage medium, characterized in that a program file is stored, which program file can be executed to implement the method according to any one of claims 1-7.
CN202210135478.XA 2022-02-14 2022-02-14 Ant colony algorithm-based data polling method and related device Pending CN114666251A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210135478.XA CN114666251A (en) 2022-02-14 2022-02-14 Ant colony algorithm-based data polling method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210135478.XA CN114666251A (en) 2022-02-14 2022-02-14 Ant colony algorithm-based data polling method and related device

Publications (1)

Publication Number Publication Date
CN114666251A true CN114666251A (en) 2022-06-24

Family

ID=82028167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210135478.XA Pending CN114666251A (en) 2022-02-14 2022-02-14 Ant colony algorithm-based data polling method and related device

Country Status (1)

Country Link
CN (1) CN114666251A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110116568A (en) * 2010-04-19 2011-10-26 목포대학교산학협력단 Routing method based on spanning tree in wireless sensor and actor network
CN106789445A (en) * 2017-02-06 2017-05-31 凌云天博光电科技股份有限公司 The state polling method and system of the network equipment in a kind of CHINA RFTCOM Co Ltd
CN107870832A (en) * 2016-09-23 2018-04-03 伊姆西Ip控股有限责任公司 Multipath storage device based on various dimensions Gernral Check-up method
CN109711526A (en) * 2018-12-20 2019-05-03 广东工业大学 Server cluster dispatching method based on SVM and ant group algorithm
CN110989612A (en) * 2019-12-17 2020-04-10 哈工大机器人(合肥)国际创新研究院 Robot path planning method and device based on ant colony algorithm

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110116568A (en) * 2010-04-19 2011-10-26 목포대학교산학협력단 Routing method based on spanning tree in wireless sensor and actor network
CN107870832A (en) * 2016-09-23 2018-04-03 伊姆西Ip控股有限责任公司 Multipath storage device based on various dimensions Gernral Check-up method
CN106789445A (en) * 2017-02-06 2017-05-31 凌云天博光电科技股份有限公司 The state polling method and system of the network equipment in a kind of CHINA RFTCOM Co Ltd
CN109711526A (en) * 2018-12-20 2019-05-03 广东工业大学 Server cluster dispatching method based on SVM and ant group algorithm
CN110989612A (en) * 2019-12-17 2020-04-10 哈工大机器人(合肥)国际创新研究院 Robot path planning method and device based on ant colony algorithm

Similar Documents

Publication Publication Date Title
CN107808122B (en) Target tracking method and device
CN109495846B (en) Positioning method and mobile terminal
CN106489146A (en) Query rewrite using session information
CN107766573B (en) Commodity recommendation method, commodity recommendation device, commodity recommendation equipment and storage medium based on data processing
CN111401507B (en) Adaptive decision tree fall detection method and system
CN107767228A (en) Using recommendation method, apparatus, terminal device and storage medium
CN108763274A (en) Recognition methods, device, electronic equipment and the storage medium of access request
CN106874449A (en) The searching method and mobile terminal of a kind of application program
CN103366121A (en) Safety inspection method, device and system
CN110298508A (en) Behavior prediction method, device and equipment
CN111753826B (en) Vehicle and license plate association method, device and electronic system
CN113011471A (en) Social group dividing method, social group dividing system and related devices
CN111160049B (en) Text translation method, apparatus, machine translation system, and storage medium
CN111538931A (en) Big data-based public opinion monitoring method and device, computer equipment and medium
CN109358802A (en) A kind of data inputting method, device, equipment and readable storage medium storing program for executing
CN114143035A (en) Attack resisting method, system, equipment and medium for knowledge graph recommendation system
CN113886721A (en) Personalized interest point recommendation method and device, computer equipment and storage medium
WO2021135322A1 (en) Automatic question setting method, apparatus and system
CN114666251A (en) Ant colony algorithm-based data polling method and related device
CN108388652B (en) Method and device for sending song list identification
EP4075424B1 (en) Speech recognition method and apparatus
CN115291786A (en) False touch judgment method and device based on machine learning and storage medium
CN111858966B (en) Knowledge graph updating method and device, terminal equipment and readable storage medium
CN113469056A (en) Behavior recognition method and device, electronic equipment and computer readable storage medium
CN115080840A (en) Content pushing method and device and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination