CN104506576B - A kind of wireless sensor network and its node tasks moving method - Google Patents
A kind of wireless sensor network and its node tasks moving method Download PDFInfo
- Publication number
- CN104506576B CN104506576B CN201410725181.4A CN201410725181A CN104506576B CN 104506576 B CN104506576 B CN 104506576B CN 201410725181 A CN201410725181 A CN 201410725181A CN 104506576 B CN104506576 B CN 104506576B
- Authority
- CN
- China
- Prior art keywords
- node
- chromosome
- msub
- task
- mrow
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 230000002068 genetic effect Effects 0.000 claims abstract description 10
- 230000007246 mechanism Effects 0.000 claims abstract description 6
- 210000000349 chromosome Anatomy 0.000 claims description 132
- 239000011159 matrix material Substances 0.000 claims description 48
- 230000035772 mutation Effects 0.000 claims description 18
- 238000004891 communication Methods 0.000 claims description 15
- 238000005265 energy consumption Methods 0.000 claims description 12
- 230000005012 migration Effects 0.000 claims description 7
- 238000013508 migration Methods 0.000 claims description 7
- 230000005540 biological transmission Effects 0.000 claims description 5
- 238000010276 construction Methods 0.000 claims description 3
- 230000005284 excitation Effects 0.000 claims description 3
- 238000010353 genetic engineering Methods 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 230000006798 recombination Effects 0.000 claims description 3
- 238000005215 recombination Methods 0.000 claims description 3
- 238000012163 sequencing technique Methods 0.000 claims description 3
- 230000004083 survival effect Effects 0.000 claims description 3
- 230000000295 complement effect Effects 0.000 abstract 1
- 230000010354 integration Effects 0.000 abstract 1
- 230000008569 process Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 230000035484 reaction time Effects 0.000 description 1
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The present invention relates to a kind of wireless sensor network and its node tasks moving method, the wireless sensor network, including a gateway node and multiple ordinary nodes, it is characterised in that:The gateway node and ordinary node are linked in a manner of wireless multi-hop to be formed, and gateway node has supply of electric power, and ordinary node does not have supply of electric power, and ordinary node is arranged at random, once arranged, just no longer moves.Gateway node in the wireless sensor network is allocated based on genetic algorithm to complementary subtask, and integration incentive mechanism is incorporated into allocation algorithm, so as to balance each node load, extends network lifecycle;It in the case where node is unstable, can ensure that task is completed in time limit by the task immigration not completed on point of instability to other suitable nodes, improve task allocative efficiency and complete quality.
Description
Technical Field
The invention belongs to the technical field of wireless multimedia sensor networks, and particularly relates to a node task migration method based on a genetic algorithm and an integral excitation mechanism.
Background
With the requirement of the application real-time performance of the wireless sensor network becoming higher and higher, the successful completion of tasks distributed on the nodes within a time limit is an important condition for ensuring the real-time performance of the whole application. However, in a wireless sensor network environment, a wireless node is easily disabled due to energy exhaustion or attack of a malicious node, so when a node executing a task is about to be disabled or dies, how to find a task migration method capable of quickly and efficiently consuming energy and having a high success rate is very necessary to migrate tasks on the disabled node to other nodes, which can ensure smooth execution of tasks under the condition that individual nodes are disabled.
Disclosure of Invention
Compared with the prior art, the gateway node distributes the interdependent subtasks based on the genetic algorithm and introduces the integral excitation mechanism into the distribution algorithm, thereby balancing the load of each node and prolonging the life cycle of the network; under the condition that the node fails, uncompleted tasks on the failed node can be migrated to other appropriate nodes, the tasks are guaranteed to be completed within a time limit, and the task distribution efficiency and the completion quality are improved. Meanwhile, through the improved genetic algorithm, the space exploration capacity of the algorithm is improved, the evolution speed is accelerated, the distribution scheme of the nodes can be obtained in a short time, and the reaction time of the wireless sensor network is prolonged.
The invention provides a wireless sensor network, which comprises a gateway node and a plurality of common nodes, and is characterized in that:
the gateway node and the common nodes are linked in a wireless multi-hop mode, the gateway node is provided with power supply, the common nodes are not provided with power supply, the common nodes are randomly arranged, and once the common nodes are arranged, the common nodes do not move.
The invention also relates to a task allocation method based on genetic algorithm in the wireless sensor network, which is characterized in that:
step one, the gateway node receives an application instruction, the application in the instruction can be decomposed into a plurality of interdependent subtasks, and the subtasks are described by using a DAG task graph G ═ T, E, and the vertex of the DAG task graph is described by using a set T ═ T1,T2,...,TnThe representation represents the subtasks to be executed, wherein n represents the number of the subtasks, each subtask has a time limit deadline, the execution of the subtask must be completed before the specified deadline, and the edge of the DAG task graph is defined as E ═ { E ═ E }1,E2,...,EgDenotes, representing data dependency or control dependency between subtasks, where g denotes the number of edges of the DAG task graph, if from vertex TiTo the top point TjThere is an oriented edge EijThen say thatMing sub-task TjIs performed by a subtask TiThe output data of (1); the gateway node manages and distributes subtasks in the DAG task graph by adopting a genetic algorithm, and the specific method comprises the following steps:
(1) randomly generating an allocation scheme, i.e. chromosomes, constructing a chromosome set S
With S ═ C1,C2,…,CxThe gateway node randomly generates x allocation schemes, each allocation scheme being a chromosome, each chromosome being represented by a 3 × n matrix C, n representing the total number of tasks in the DAG task graph, in the first row of the matrix C (T)1,...Ti...Tn) The sequence of the subtasks to be distributed from left to right is determined according to the task execution sequence in the DAG task graph, and the matrix C is arranged in the second row (V)1,...Vj...Vm) Representing nodes of the subtask mapping, the third row (ω) of the matrix C1,...ωi...ωn) Representing the computational load of the subtasks, the chromosome matrix C is as follows:
(2) constructing a communication matrix E
The data transmission relation between tasks is represented by a 3 × g matrix E, namely a communication matrix, g is the total number of edges of a DAG task graph, and the first element T of each column in the matrix EiIndicating the sender of the task, a second element TjFor the task receiver, a third element lijFor task TiAnd TjThe size of the inter-transmission data, one column of the communication matrix E is as follows:
(3) calculating total reward points for chromosomes
Reward points generated per chromosomeRefers to the point of the web joint according to a certain chromosome CkWhen task allocation is carried out, the sum of reward points required to be paid by all subtasks in the DAG task graph is completed:
wherein, Ti∈ T denotes all subtasks in the DAG task graph, Vj∈CkRepresents chromosome CkAll of the common nodes involved in (a) are,is node VjCompletion of task TiRequired reward points;
(4) calculating chromosome completion time
Chromosome completion time WT (C)k) Refers to the point of the web joint according to a certain chromosome CkWhen task allocation is carried out, the time length required by all subtasks in the DAG task graph is completed;
(5) constructing a fitness function to evaluate the performance of the chromosome
The fitness represents the advantages and disadvantages of the chromosome, the higher the fitness is, the better the chromosome is, the higher the survival probability of the chromosome is, the fitness of the chromosome is calculated by constructing a fitness function, the construction target of the fitness function is to find the chromosome with small total reward integral and short completion time, and the fitness function is as follows:
wherein, fit (C)i) Is chromosome CiThe degree of fitness of (a) to (b),is the minimum value of the total reward points in chromosome set S, MIN _ wt (S) is the minimum value of the completion time in chromosome set S, β is an adjustable parameter that adjusts the weight of the total reward points and completion time in the fitness function;
calculating the fitness of each chromosome, storing the ID numbers of the x chromosomes and the corresponding fitness in a performance grade table for classification and identification, sequencing the performance grade table according to the descending order of the fitness values, and arranging the chromosomes with high fitness at the top of the table;
(6) genetic manipulation of chromosomes
1) Inheritance operation
The first y% of x chromosomes in the performance grade table are inherited into a next generation chromosome set, the rest x (1-y%) chromosomes are generated through steps of selection, crossing and mutation, and y% represents the excellent rate of the chromosomes, wherein y belongs to [1-100 ];
2) selecting operation:
selecting two chromosomes to carry out subsequent cross operation in a performance grade table so as to generate a new chromosome, wherein the higher the fitness of the chromosome is, the higher the probability of selection is by adopting a roulette mode;
3) crossover operation
Two chromosome matrices C of choice1And C2As the parent chromosome, the crossover operation is to the parent chromosome matrix C1And C2Partial recombination is carried out to generate ancestral chromosome C3And C4In the cross operation, the first row of the chromosome matrix is kept unchanged to ensure that the execution sequence of the tasks is unchanged, and in the parent chromosome matrix C1And C2Second row selects a point as a cross point, matrix C1And C2The parts behind the second row intersection are swapped, resulting in the children chromosome matrix C3And C4Calculating the child chromosome matrix C3And C4The fitness of the performance grade table is stored in a corresponding position of the performance grade table;
4) mutation manipulation
The method comprises two mutation modes, namely a) mutation based on tasks, wherein each chromosome has lambda probability, and one randomly selected task is mapped to another node; or by means of b) chromosome-based mutations, each chromosome having a probability of λ being completely replaced by a new chromosome generated randomly, where λ denotes the mutation rate, λ e (0-1);
(7) after a certain number of iterative operations, the gateway node selects the chromosome at the top in the performance grade table as the current distribution scheme;
step two, the common node involved in the distribution scheme selected by the gateway node is an active node, and the active node acquires corresponding points according to the node point exchange rate and the task completion energy consumption;
the points are used for measuring the historical performance of the node to complete the task, increasing the participation of the node in executing the task, quantitatively evaluating the performance of the node to complete the task by the points and recording the results, wherein the points comprise reward pointsAnd penalty integrationWherein T isi∈ T represent all subtasks in the DAG task graph, and if the active node completes the task successfully, it can obtain the corresponding bonus pointIf the task is not successfully completed, the corresponding penalty credit is deductedThe total point is the sum of the points accumulated by the active nodes through the completion of the tasksTotal integralIs a common node VjThe sum of the points accumulated for completing the task, i.e. the sum of all bonus points minus the sum of all penalty points:wherein, Vj(T) is a common node VjAll tasks allocated, TsIs a common node VjTask completed successfully, TfIs a common node Vj(iii) a task that was not successfully completed;
the point exchange rate is the point which is obtained by the unit energy consumption of the node, which reflects the cost performance of the node to complete the taskIs shown in whichIs a common node VjThe remaining amount of energy of (a) is,is node VjThe total integral of (1);
if the active node has a fault or is attacked by other malicious nodes, the active node is an unstable node, if the unstable node has a task which is not executed, the cooperation of other common nodes needs to be exchanged in a point exchange mode, and therefore the task is migrated to other common nodes;
and step four, if the active node cannot communicate with other nodes due to energy exhaustion or communication link failure, the active node is a dead node, the gateway node immediately discovers the dead node and redistributes the unfinished tasks on the dead node to other common nodes.
Drawings
FIG. 1 is a diagram of a wireless sensor network architecture;
FIG. 2 is a flow chart of a gateway node assignment task;
fig. 3 is a general node task migration flowchart.
Detailed Description
The invention will be described in further detail with reference to the following figures and specific examples, without limiting the scope of the invention. As shown in fig. 1:
the wireless sensor network generally comprises a gateway node and a plurality of common nodes which are linked by wireless multi-hop. The gateway node has strong processing capability and enough power supply. Common nodes have limited energy and no power supply. Common nodes are heterogeneous in that processing rates are different and node energies are different, but transmission characteristics are considered to be the same. Ordinary nodes are randomly arranged, and once the nodes are arranged, the nodes do not move.
Fig. 2 and 3 show a task allocation method based on the above-mentioned wireless sensor network and based on a genetic algorithm and a credit incentive mechanism, in which a gateway node allocates each subtask to the most appropriate node by providing a service of exchanging a credit reward for a common node, and on the premise of meeting a task time limit, the total number of credits consumed by the gateway node is minimized, thereby completing all subtasks, specifically including the following steps:
step one, a gatewayThe node receives an application instruction, the application in the instruction can be decomposed into a plurality of interdependent subtasks, and the instruction is described by a directed acyclic graph DAG task graph G ═ T, E, and the vertex of the DAG task graph is described by a set T ═ T1,T2,...,TnThe representation represents subtasks needing to be executed, n represents the number of the subtasks, each subtask has a time limit deadline, the execution of the subtask must be completed before the specified deadline, and the edge of the DAG task graph is defined as E ═ E { (E)1,E2,...,EgDenotes, data dependency or control dependency between subtasks, g denotes the number of edges of the DAG task graph, if from vertex TiTo the top point TjThere is an oriented edge EijIf yes, the subtask T is explainedjIs performed by a subtask TiThe output data of (1); the gateway node manages and distributes subtasks in the DAG task graph by adopting a genetic algorithm, and the specific task management and distribution method comprises the following steps:
(1) randomly generating an allocation scheme, i.e. chromosomes, constructing a chromosome set S
With S ═ C1,C2,…,CxThe gateway node randomly generates x allocation schemes, each allocation scheme being a chromosome, each chromosome being represented by a 3 × n matrix C, n representing the total number of tasks in the DAG task graph, in the first row of the matrix C (T)1,...Ti...Tn) Representing the subtasks to be allocated, the order of which from left to right is determined according to the order of task execution in the DAG task graph, matrix C second row (V)1,...Vj...Vm) Representing nodes of the subtask mapping, the third row (ω) of the matrix C1,...ωi...ωn) Representing the computational load of the subtasks, the chromosome matrix C is as follows:
(2) constructing a communication matrix E
The data transmission relation between tasks is represented by a 3 × g matrix E, namely a communication matrix, g is the total number of edges of a DAG task graph, and the first element T of each column in the matrix EiIndicating the sender of the task, a second element TjFor the task receiver, a third element lijFor task TiAnd TjThe size of the inter-transmission data, a certain column of the communication matrix E is as follows:
(2) calculating total reward points for chromosomes
Reward points generated per chromosomeRefers to the point of the web joint according to a certain chromosome CkWhen task allocation is carried out, the sum of reward points required to be paid by all subtasks in the DAG task graph is completed:
wherein, Ti∈ T denotes all subtasks in the DAG task graph, Vj∈CkRepresents chromosome CkAll the common nodes involved in (1).Is node VjCompletion of task TiRequired reward points;
(3) calculating chromosome completion time
Chromosome completion time WT (C)k) Refers to the point of the web joint according to a certain chromosome CkAnd when the task is distributed, the time length required for completing all the subtasks in the DAG task graph is long.
(4) Constructing a fitness function to evaluate the performance of the chromosome
The fitness represents the advantages and disadvantages of the chromosome, the higher the fitness is, the better the chromosome is, the higher the survival probability of the chromosome is, the fitness of the chromosome is calculated by constructing a fitness function, the construction target of the fitness function is to find the chromosome with small total reward integral and short completion time, and the fitness function is as follows:
wherein, fit (C)i) Is chromosome CiThe degree of fitness of (a) to (b),is the minimum value of the total reward points in chromosome set S, MIN _ wt (S) is the minimum value of the completion time in chromosome set S, β is an adjustable parameter that adjusts the weight of the total reward points and completion time in the fitness function.
Calculating the fitness of each chromosome, storing the ID numbers of the x chromosomes and the corresponding fitness in a performance grade table for classification and identification, sequencing the performance grade table according to the descending order of the fitness values, and arranging the chromosomes with high fitness at the top of the table;
(5) genetic manipulation of chromosomes
1) Inheritance operation
The first y% of x chromosomes in the performance grade table are inherited into a next generation chromosome set, the rest x (1-y%) chromosomes are generated through steps of selection, crossing and mutation, and y% represents the excellent rate of the chromosomes, wherein y belongs to [1-100 ];
2) selecting operation:
selecting two chromosomes to carry out subsequent cross operation in a performance grade table so as to generate a new chromosome, wherein the higher the fitness of the chromosome is, the higher the probability of selection is by adopting a roulette mode;
3) crossover operation
Two chromosome matrices C of choice1And C2As the parent chromosome, the crossover operation is to the parent chromosome matrix C1And C2Partial recombination is carried out to generate ancestral chromosome C3And C4In the cross operation, the first row of the chromosome matrix is kept unchanged to ensure that the execution sequence of the tasks is unchanged, and in the parent chromosome matrix C1And C2Second row selects a point as a cross point, matrix C1And C2The parts behind the second row intersection are swapped, resulting in the children chromosome matrix C3And C4Calculating the child chromosome matrix C3And C4The fitness of the performance grade table is stored in a corresponding position of the performance grade table;
4) mutation manipulation
The method comprises two mutation modes, namely a) mutation based on tasks, wherein each chromosome has lambda probability, and one randomly selected task is mapped to another node; or by means of b) chromosome-based mutations, each chromosome having a probability of λ being completely replaced by a new chromosome generated randomly, where λ denotes the mutation rate, λ e (0-1);
(5) after a certain number of iterative operations, the gateway node selects the chromosome at the top in the performance grade table as the current distribution scheme;
step two, the common node involved in the distribution scheme selected by the gateway node is an active node, and the active node acquires corresponding integral according to the node point exchange rate and the task completion energy consumption; the total exchange rate is usedThe node consumption unit energy is represented by the integral which is obtained when the node consumes the unit energy, and the cost performance of the node to complete the task is reflected; the integral is used for measuring the historical performance of the node to complete the task, and the node execution can be increasedAnd quantitatively evaluating the task performance of the nodes by using the scores, recording the scores, and dividing the scores into reward scores and penalty scores, wherein the reward scores are used forFor indication, penalty integrationThe method comprises the steps of representing that if a task is successfully completed, corresponding reward points can be obtained, if the task is not successfully completed, corresponding penalty points can be deducted, wherein the reward points refer to corresponding points which can be obtained after a node successfully completes the task, the penalty points refer to corresponding points which are deducted when the node unsuccessfully completes the task, the sum of the points accumulated by the node after completing the task is called total points, and the total points are usedRepresents;
the specific process of obtaining the integral is as follows:
first, a common node VjCompleting task T within task deadline deadlinesiConsidered as a common node VjSuccessful completion of task TiCommon node VjAutomatic acquisitionReward points and update the common node VjThe residual energy, the total point and the point exchange rate are returned to the gateway node together with the task result. The gateway node updates the residual energy, the total integral and the integral exchange rate of the common node in the node integral table;
second, the common node VjFailure to complete task T within task deadlineiConsider a common node VjFailure to complete task TiCommon node VjAutomatically deduct the total scoreA penalty integral, common node VjUpdating the residual energy, the total integral and the integral exchange rate, transmitting the residual energy, the total integral and the integral exchange rate to the gateway node through a periodic report, and updating the residual energy, the total integral and the integral exchange rate of the common node in the node integral table by the gateway node;
the specific calculation process of the integral is as follows:
first, the node point exchange rate is calculatedRepresents a common node VjThe reward points that should be obtained for each joule of energy consumed are related to both the node remaining energy and the node total points, and the node point exchange rate is expressed as:whereinIs a common node VjThe remaining amount of energy of (a) is,is node VjThe total integral of (1);
secondly, the computing nodes complete task energy consumption, including computing energy consumption and communication energy consumption;
wherein,representing a task TiAt a common node VjThe total consumption of the above-mentioned components,representing a task TiAt a common node VjThe computation of (a) is consumed,representing a task TiAt a common node Vj(ii) communication consumption over;
calculating the consumption: represents a common node VjThe average power consumption is calculated based on the average power consumption,representing a task TiAt a common node VjThe execution time of the first time slot is greater than the execution time of the second time slot, representing a task TiThe amount of calculation of (a) is,represents a common node VjThe execution rate of (c);
communication consumption:wherein,represents a common node VjTo complete task TiThe energy consumption required for the transmission of the data packets,represents a common node VjTo complete task TiEnergy consumption required for receiving the data packet.
l represents the size of the transmitted packet, d represents the distance between the sending node and the receiving node, ξelec、ξfs、ξmpIs a hardware-related parameter, d0Is a fixed parameter;
third, the node task rewards pointsI.e. the common node VjSuccessful completion of task TiThe integral that should be obtained is:
whereinIs a common node VjThe rate of the collection of points of (a),is a common node VjCompletion of task TiTotal energy consumption of (a);
thirdly, node task penalty integrationI.e. the common node VjUnsuccessful completion of task TiThe integral that should be subtracted is:
wherein β is an adjustable parameter;
finally, the total point of the node is calculatedIs a common node VjThe accumulated integral sum of the completed tasks, namely the sum of all the reward points minus the sum of all the penalty points;
wherein, Vj(T) is a common node VjAll tasks allocated, TsIs a common node VjTask completed successfully, TfIs a common node Vj(iii) a task that was not successfully completed;
step three, if the active node is in fault or is attacked by other malicious nodes, the active node is considered to be an unstable node, if the unstable node has a task which is not completed, the cooperation of other common nodes needs to be exchanged in a point exchange mode, and therefore the task is migrated to other common nodes;
the process of seeking other common node cooperation by exchanging points by unstable nodes adopts an auction mechanism to improve the auction form, and the specific task migration process is as follows:
firstly, when a common node for executing a task finds itself to be an unstable node, the common node cannot continuously execute the distributed task, then an auction is initiated to find a successor node of the task, and the unstable node uses VfailureIndicating that the task outstanding on the unstable node is TfailureRepresents; unstable node VfailureSending a Tender Tender (T) as a tendering node to other common nodesfailure,deadline,Pointbudget) The markup includes task description, task deadline and maximum budget Point paid by the node for the taskbudgetThe maximum budget is equal to the total integral of the node
Second, when the ordinary node receives the bid descriptor (T)failure,deadline,Pointbudget) Then, the self condition is judged according to the requirement in the bidding document to decide whether to participate in bidding, if not, the action is not given, and if so, the quotation is given according to the self condition; the process of deciding whether to participate in bidding is as follows:
the bidding node firstly considers the time limit factor of the task, if the bidding node already has the originally distributed task and the predicted completion time of the new task is greater than the time limit deadline specified in the bidding document, the bidding node does not participate in bidding;
if the predicted completion time of the bidding node is less than or equal to the time limit deadline specified in the bidding document, calculating the integral price for completing the taskWhereinFor bidding node VjThe rate of the collection of points of (a),for bidding node VjCompletion of task TfailureTotal energy consumption of (a);
if the integral price of the completed task of the bidding node is larger than the budget in the bidding document, that isThe bidding node does not participate in bidding,
if the integral price of the completed task of the bidding node is less than or equal to the budget in the bidding document, that isThe bidding node can participate in bidding, andas a bid price;
and thirdly, selecting the bidding node with the lowest bidding price as the bidding node by the bidding node. After the winning bid node is determined, the bidding node VfailureTask TfailureMigrating to the winning node, and deducting in the total scoreAnd (4) integrating. And using the updated total points, point exchange rates, winning node and migration task information as the Report of the emergencyemergencyUploading to a gateway node;
thirdly, the gateway node renews the node score table;
thirdly, the successful bid winning node executes the task and obtains the successful completion of the taskThe reward points and the task processing result are returned to the gateway node;
finally, if no ordinary node wins the bid, the unstable node VfailureTask TfailureReport as an incident ReportemergencyUploading the task T to a gateway node, and using the gateway node to transmit the task TfailureAppointing to distribute to other ordinary nodes, unstable node VfailureDeducting corresponding penalty points;
step four, if the active node can not communicate with other common nodes due to energy exhaustion or communication link failure, the active node is called a dead node, the gateway node immediately discovers the dead node and redistributes the unfinished tasks on the dead node to other common nodes;
the specific process is as follows:
firstly, the common node needs to send a Report to the gateway node periodicallyperiodicThe gateway node reports Report according to a regular period, including residual energy, total point and point exchange rate informationperiodicPeriodically updating the node integral table;
secondly, if the regular Report of a normal node is not received within a specified timeperiodicAnd the Report of the emergency Report of the common node is not receivedemergencyThe gateway node determines that the common node is dead;
finally, the gateway node judges whether the death node has an unfinished task, if not, the gateway node directly updates the node score table and deletes the node from the table; if the unfinished task exists, the unfinished task is redistributed, and then the node integral table is updated.
The above embodiments are only for illustrating the invention and are not to be construed as limiting the invention, and those skilled in the art can make various changes without departing from the scope and method of the invention, therefore, all equivalent technical solutions also belong to the scope of the invention, and the scope of the invention is defined by the claims.
Claims (1)
1. A task migration method based on a genetic algorithm and an integral excitation mechanism in a wireless sensor network is characterized in that:
the wireless sensor network comprises a gateway node and a plurality of common nodes, wherein the gateway node and the common nodes are formed by linking in a wireless multi-hop mode, the gateway node is provided with power supply, the common nodes are not provided with power supply, the common nodes are randomly arranged, and once the common nodes are arranged, the common nodes do not move;
the method comprises the following steps:
step one, netThe joint receives an application instruction, the application in the instruction can be decomposed into a plurality of interdependent subtasks, and the instruction is described by a DAG task graph G ═ (T, E), and the vertex of the DAG task graph is described by a set T ═ T { (T, E) }1,T2,...,TnThe representation represents the subtasks to be executed, wherein n represents the number of the subtasks, each subtask has a time limit deadline, the execution of the subtask must be completed before the specified deadline, and the edge of the DAG task graph is defined as E ═ { E ═ E }1,E2,...,EgDenotes, representing data dependency or control dependency between subtasks, where g denotes the number of edges of the DAG task graph, if from vertex TiTo the top point TjThere is an oriented edge EijIf yes, the subtask T is explainedjIs performed by a subtask TiThe output data of (1); the gateway node manages and distributes subtasks in the DAG task graph by adopting a genetic algorithm, and the specific method comprises the following steps:
(1) randomly generating an allocation scheme, i.e. chromosomes, constructing a chromosome set S
With S ═ C1,C2,…,CxThe gateway node randomly generates x allocation schemes, each allocation scheme being a chromosome, each chromosome being represented by a 3 × n matrix C, n representing the total number of tasks in the DAG task graph, in the first row of the matrix C (T)1,...Ti...Tn) The sequence of the subtasks to be distributed from left to right is determined according to the task execution sequence in the DAG task graph, and the matrix C is arranged in the second row (V)1,...Vj...Vm) Representing nodes of the subtask mapping, the third row (ω) of the matrix C1,...ωi...ωn) Representing the computational load of the subtasks, the chromosome matrix C is as follows:
<mrow> <mi>C</mi> <mo>=</mo> <mfenced open = "[" close = "]"> <mtable> <mtr> <mtd> <msub> <mi>T</mi> <mn>1</mn> </msub> </mtd> <mtd> <mn>...</mn> </mtd> <mtd> <msub> <mi>T</mi> <mi>i</mi> </msub> </mtd> <mtd> <mn>...</mn> </mtd> <mtd> <msub> <mi>T</mi> <mi>n</mi> </msub> </mtd> </mtr> <mtr> <mtd> <msub> <mi>V</mi> <mn>1</mn> </msub> </mtd> <mtd> <mn>...</mn> </mtd> <mtd> <msub> <mi>V</mi> <mi>j</mi> </msub> </mtd> <mtd> <mn>...</mn> </mtd> <mtd> <msub> <mi>V</mi> <mi>m</mi> </msub> </mtd> </mtr> <mtr> <mtd> <msub> <mi>&omega;</mi> <mn>1</mn> </msub> </mtd> <mtd> <mn>...</mn> </mtd> <mtd> <msub> <mi>&omega;</mi> <mi>i</mi> </msub> </mtd> <mtd> <mn>...</mn> </mtd> <mtd> <msub> <mi>&omega;</mi> <mi>n</mi> </msub> </mtd> </mtr> </mtable> </mfenced> </mrow>
(2) constructing a communication matrix E
The data transmission relation between tasks is represented by a 3 × g matrix E, namely a communication matrix, g is the total number of edges of a DAG task graph, and the first element T of each column in the matrix EiIndicating the sender of the task, a second element TjFor the task receiver, a third element lijFor task TiAnd TjThe size of the inter-transmission data, one column of the communication matrix E is as follows:
<mrow> <mi>E</mi> <mo>=</mo> <mfenced open = "[" close = "]"> <mtable> <mtr> <mtd> <msub> <mi>T</mi> <mi>i</mi> </msub> </mtd> </mtr> <mtr> <mtd> <msub> <mi>T</mi> <mi>j</mi> </msub> </mtd> </mtr> <mtr> <mtd> <msub> <mi>l</mi> <mrow> <mi>i</mi> <mi>j</mi> </mrow> </msub> </mtd> </mtr> </mtable> </mfenced> </mrow>
(3) calculating total reward points for chromosomes
Reward points generated per chromosomeRefers to the point of the web joint according to a certain chromosome CkWhen task allocation is carried out, the sum of reward points required to be paid by all subtasks in the DAG task graph is completed:
<mrow> <msubsup> <mi>Point</mi> <mrow> <mi>t</mi> <mi>o</mi> <mi>t</mi> <mi>a</mi> <mi>l</mi> </mrow> <msub> <mi>C</mi> <mi>k</mi> </msub> </msubsup> <mo>=</mo> <munder> <mo>&Sigma;</mo> <mrow> <msub> <mi>T</mi> <mi>i</mi> </msub> <mo>&Element;</mo> <mi>T</mi> <mo>,</mo> <msub> <mi>V</mi> <mi>j</mi> </msub> <mo>&Element;</mo> <msub> <mi>C</mi> <mi>k</mi> </msub> </mrow> </munder> <msubsup> <mi>Point</mi> <mrow> <mi>r</mi> <mi>e</mi> <mi>w</mi> <mi>a</mi> <mi>r</mi> <mi>d</mi> </mrow> <msub> <mi>V</mi> <mi>j</mi> </msub> </msubsup> <mrow> <mo>(</mo> <msub> <mi>T</mi> <mi>i</mi> </msub> <mo>)</mo> </mrow> </mrow>
wherein, Ti∈ T denotes all subtasks in the DAG task graph, Vj∈CkRepresents chromosome CkAll of the common nodes involved in (a) are,is node VjCompletion of task TiRequired reward points;
(4) calculating chromosome completion time
Chromosome completion time WT (C)k) Refers to the point of the web joint according to a certain chromosome CkWhen task allocation is carried out, the time length required by all subtasks in the DAG task graph is completed;
(5) constructing a fitness function to evaluate the performance of the chromosome
The fitness represents the advantages and disadvantages of the chromosome, the higher the fitness is, the better the chromosome is, the higher the survival probability of the chromosome is, the fitness of the chromosome is calculated by constructing a fitness function, the construction target of the fitness function is to find the chromosome with small total reward integral and short completion time, and the fitness function is as follows:
<mrow> <mi>f</mi> <mi>i</mi> <mi>t</mi> <mrow> <mo>(</mo> <msub> <mi>C</mi> <mi>k</mi> </msub> <mo>)</mo> </mrow> <mo>=</mo> <mfrac> <mrow> <mi>M</mi> <mi>I</mi> <mi>N</mi> <mo>_</mo> <msubsup> <mi>Point</mi> <mrow> <mi>t</mi> <mi>o</mi> <mi>t</mi> <mi>a</mi> <mi>l</mi> </mrow> <mi>S</mi> </msubsup> </mrow> <mrow> <msubsup> <mi>Point</mi> <mrow> <mi>t</mi> <mi>o</mi> <mi>t</mi> <mi>a</mi> <mi>l</mi> </mrow> <msub> <mi>C</mi> <mi>k</mi> </msub> </msubsup> </mrow> </mfrac> <mo>+</mo> <mi>&beta;</mi> <mfrac> <mrow> <mi>M</mi> <mi>I</mi> <mi>N</mi> <mo>_</mo> <mi>W</mi> <mi>T</mi> <mrow> <mo>(</mo> <mi>S</mi> <mo>)</mo> </mrow> </mrow> <mrow> <mi>W</mi> <mi>T</mi> <mrow> <mo>(</mo> <msub> <mi>C</mi> <mi>k</mi> </msub> <mo>)</mo> </mrow> </mrow> </mfrac> </mrow>
wherein, fit (C)i) Is chromosome CiThe degree of fitness of (a) to (b),is the minimum value of the total reward points in chromosome set S, MIN _ wt (S) is the minimum value of the completion time in chromosome set S, β is an adjustable parameter that adjusts the weight of the total reward points and completion time in the fitness function;
calculating the fitness of each chromosome, storing the ID numbers of the x chromosomes and the corresponding fitness in a performance grade table for classification and identification, sequencing the performance grade table according to the descending order of the fitness values, and arranging the chromosomes with high fitness at the top of the table;
(6) genetic manipulation of chromosomes
1) Inheritance operation
The first y% of x chromosomes in the performance grade table are inherited into a next generation chromosome set, the rest x (1-y%) chromosomes are generated through steps of selection, crossing and mutation, and y% represents the excellent rate of the chromosomes, wherein y belongs to [1-100 ];
2) selecting operation:
selecting two chromosomes to carry out subsequent cross operation in a performance grade table so as to generate a new chromosome, wherein the higher the fitness of the chromosome is, the higher the probability of selection is by adopting a roulette mode;
3) crossover operation
Two chromosome matrices C of choice1And C2As the parent chromosome, the crossover operation is to the parent chromosome matrix C1And C2Partial recombination is carried out to generate ancestral chromosome C3And C4In the cross operation, the first row of the chromosome matrix is kept unchanged to ensure that the execution sequence of the tasks is unchanged, and in the parent chromosome matrix C1And C2Second row selects a point as a cross point, matrix C1And C2The parts behind the second row intersection are swapped, resulting in the children chromosome matrix C3And C4Calculating the child chromosome matrix C3And C4The fitness of the performance grade table is stored in a corresponding position of the performance grade table;
4) mutation manipulation
The method comprises two mutation modes, namely a) mutation based on tasks, wherein each chromosome has lambda probability, and one randomly selected task is mapped to another node; or by means of b) chromosome-based mutations, each chromosome having a probability of λ being completely replaced by a new chromosome generated randomly, where λ denotes the mutation rate, λ e (0-1);
(7) after a certain number of iterative operations, the gateway node selects the chromosome at the top in the performance grade table as the current distribution scheme;
step two, the common node involved in the distribution scheme selected by the gateway node is an active node, and the active node acquires corresponding points according to the node point exchange rate and the task completion energy consumption;
the points are used for measuring the historical performance of the node to complete the task, increasing the participation of the node in executing the task, quantitatively evaluating the performance of the node to complete the task by the points and recording the results, wherein the points comprise reward pointsAnd penalty integrationWherein T isi∈ T represent all subtasks in the DAG task graph, and if the active node completes the task successfully, it can obtain the corresponding bonus pointIf the task is not successfully completed, the corresponding penalty credit is deductedThe total point is the sum of the points accumulated by the active nodes through the completion of the tasksTotal integralIs a common node VjThe sum of the points accumulated for completing the task, i.e. the sum of all bonus points minus the sum of all penalty points:wherein, Vj(T) is a common node VjAll tasks allocated, TsIs a common node VjTask completed successfully, TfIs a common node Vj(iii) a task that was not successfully completed;
the point exchange rate is the point which is obtained by the unit energy consumption of the node, which reflects the cost performance of the node to complete the taskIs shown in whichIs a common node VjThe remaining amount of energy of (a) is,is node VjThe total integral of (1);
if the active node has a fault or is attacked by other malicious nodes, the active node is an unstable node, if the unstable node has a task which is not executed, the cooperation of other common nodes needs to be exchanged in a point exchange mode, and therefore the task is migrated to other common nodes;
and step four, if the active node cannot communicate with other nodes due to energy exhaustion or communication link failure, the active node is a dead node, the gateway node immediately discovers the dead node and redistributes the unfinished tasks on the dead node to other common nodes.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410725181.4A CN104506576B (en) | 2014-12-03 | 2014-12-03 | A kind of wireless sensor network and its node tasks moving method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410725181.4A CN104506576B (en) | 2014-12-03 | 2014-12-03 | A kind of wireless sensor network and its node tasks moving method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104506576A CN104506576A (en) | 2015-04-08 |
CN104506576B true CN104506576B (en) | 2017-11-10 |
Family
ID=52948291
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410725181.4A Active CN104506576B (en) | 2014-12-03 | 2014-12-03 | A kind of wireless sensor network and its node tasks moving method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104506576B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2016067299A1 (en) * | 2014-10-30 | 2016-05-06 | Hewlett-Packard Development Company, L.P. | Location aware failover solution |
CN104540171B (en) * | 2014-12-15 | 2017-09-08 | 常州大学 | A kind of node tasks distribution method in wireless sensor network |
CN105577541A (en) * | 2015-12-21 | 2016-05-11 | 东北大学 | Dynamic gaming excitation method based on node dependence |
CN107066709B (en) * | 2017-03-29 | 2019-05-21 | 西安电子科技大学 | Electric power transportation network Topology Structure Design method based on multi-Agent Genetic Algorithm |
CN107547264B (en) * | 2017-07-28 | 2020-10-20 | 深圳市盛路物联通讯技术有限公司 | Data backup method and device based on Internet of things |
CN111328029A (en) * | 2020-03-14 | 2020-06-23 | 杭州鸿晶自动化科技有限公司 | Decentralized task redistribution method and device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101013986A (en) * | 2007-02-02 | 2007-08-08 | 南京邮电大学 | Method for realizing data inquiring system of sensor network based on middleware of mobile agent |
CN101039321A (en) * | 2007-02-02 | 2007-09-19 | 南京邮电大学 | Mixed mobile agent-based wireless sensor network data transmission method |
CN101170573A (en) * | 2007-11-21 | 2008-04-30 | 湖南大学 | Active radio sensor network middleware system and implementation method |
-
2014
- 2014-12-03 CN CN201410725181.4A patent/CN104506576B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101013986A (en) * | 2007-02-02 | 2007-08-08 | 南京邮电大学 | Method for realizing data inquiring system of sensor network based on middleware of mobile agent |
CN101039321A (en) * | 2007-02-02 | 2007-09-19 | 南京邮电大学 | Mixed mobile agent-based wireless sensor network data transmission method |
CN101170573A (en) * | 2007-11-21 | 2008-04-30 | 湖南大学 | Active radio sensor network middleware system and implementation method |
Also Published As
Publication number | Publication date |
---|---|
CN104506576A (en) | 2015-04-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104506576B (en) | A kind of wireless sensor network and its node tasks moving method | |
Zhou et al. | A hybrid approach combining modified artificial bee colony and cuckoo search algorithms for multi-objective cloud manufacturing service composition | |
Tong et al. | A scheduling scheme in the cloud computing environment using deep Q-learning | |
Xu et al. | Multi-objective artificial bee colony algorithm for multi-stage resource leveling problem in sharing logistics network | |
Afrin et al. | Multi-objective resource allocation for edge cloud based robotic workflow in smart factory | |
Ye et al. | A survey of self-organization mechanisms in multiagent systems | |
Wang et al. | Multiagent-based resource allocation for energy minimization in cloud computing systems | |
CN106227599B (en) | The method and system of scheduling of resource in a kind of cloud computing system | |
Durgadevi et al. | Resource allocation in cloud computing using SFLA and cuckoo search hybridization | |
CN104540171B (en) | A kind of node tasks distribution method in wireless sensor network | |
Li et al. | New MILP model and station-oriented ant colony optimization algorithm for balancing U-type assembly lines | |
CN101944157A (en) | Biological intelligence scheduling method for simulation grid system | |
Agarwal et al. | Non-additive multi-objective robot coalition formation | |
Wu et al. | Optimal deploying IoT services on the fog computing: A metaheuristic-based multi-objective approach | |
Zhang et al. | Cost-aware scheduling systems for real-time workflows in cloud: An approach based on Genetic Algorithm and Deep Reinforcement Learning | |
Dziurzanski et al. | Scalable distributed evolutionary algorithm orchestration using Docker containers | |
Zhang et al. | Individualized requirement-driven multi-task scheduling in cloud manufacturing using an extended multifactorial evolutionary algorithm | |
CN104320484B (en) | A kind of task immigration method in wireless sensor network based on integration incentive mechanism | |
Ebrahim et al. | Privacy-aware load balancing in fog networks: A reinforcement learning approach | |
WO2017016417A1 (en) | System control method and device, controller and control system | |
CN115421885B (en) | Distributed multi-target cloud task scheduling method and device and cloud service system | |
Tong et al. | Energy and performance-efficient dynamic consolidate vms using deep-q neural network | |
Chiang et al. | Multi-mode resource-constrained project scheduling by ant colony optimization with a dynamic tournament strategy | |
CN113220437B (en) | Workflow multi-target scheduling method and device | |
Kamalinia et al. | Hybrid task scheduling method for cloud computing by genetic and PSO algorithms |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20211217 Address after: 213000 Room 501, building 3, Changzhou inspection and testing industrial park, Tianning District, Changzhou City, Jiangsu Province Patentee after: Biyi (Jiangsu) Intelligent Technology Co.,Ltd. Address before: Gehu Lake Road Wujin District 213164 Jiangsu city of Changzhou province No. 1 Patentee before: CHANGZHOU University |
|
TR01 | Transfer of patent right |