Embodiment
The present invention is a kind of dynamic networking method based on the mutation ant group algorithm, reparation arbitrary way while adopting likelihood probability inundation mechanism as path failure, the mutation ant group algorithm comprises route discovery and route maintenance two parts, wherein route discovery refers to by certain rule and finds route, it is the process of establishing of logical routing tree, the present invention regards carrier signal as artificial ant, the release of regarding described artificial ant as by carrier signal, to send carrier signal until its process that receives the back-signalling of purpose carrier wave node is regarded the once complete process of looking for food of described artificial ant as from the centered carrier node, the centered carrier node is set up the center routing table according to the back-signalling of purpose carrier wave node, other each carrier wave node calculates by the carrier signal received and monitor on power line the electrical distance that it arrives the centered carrier node, obtain an electrical distance table, by constantly updating this electrical distance table to adjust the routing table of its described centered carrier node that can go directly.
Artificial ant is from the centered carrier node, constraint according to constraint set, pheromone concentration and specific heuristic information, by the next communication node of policy selection, until arrive purpose carrier wave node, simultaneously artificial ant returns by original route, after getting back to the centered carrier node, quality to this path is assessed, various variation can occur in power line channel generally, early the pheromones of time will lose the effect that represents this power line channel current environment situation gradually, so will be volatilized according to a certain percentage to pheromones, for fear of search, occur stagnating simultaneously, set the bound of routing information element concentration, when the path obtained meets the requirements of precision, think that this path discovery completes, the centered carrier node completes the route discovery procedure of each communication node by constantly sending the pathfinding signal.
When in the present invention, artificial ant is selected next communication node, adopt the candidate strategy of electrical distance as constraint, at first, set the threshold values of the electrical distance of a proper communication, when electrical distance is greater than this threshold values, think that channel status is poor, can not carry out direct communication between two communication nodes, and near carrier wave node maximum communication distance is also unstable in communication, therefore near carrier wave node maximum communication distance is not suitable for doing relaying and uses, thus in algorithm, select electric threshold values [
,
] carrier wave node on interval is as the best candidate collection of next communication node, the selection strategy according to the calculating of correlation formula as next communication node.
Wherein route maintenance refers to when previous routing variable obtains when invalid or need to find a path that more is applicable to current power wire condition, need to by table, be upgraded Center Road, when center carrier wave node sends control command according to the route in the routing table of center to purpose carrier wave node, due to the load changing on some paths in this route or be subject to strong jamming and make communication failure, the centered carrier node is in the situation that confirm that this path has been not suitable for current channel, to reselect purpose carrier wave node path or use route discovery to find the path that arrives purpose carrier wave node, the search procedure of carrying out route maintenance is to carry out saving time significantly for the communication node in individual communication node or regional area.The packet data package of changing separately or listening to according to it due to all carrier wave nodes in the present invention is upgraded the state of the electrical distance of its neighbours' carrier wave node table separately and each self-corresponding arrival centered carrier node thereof with the dynamically adapting communication channel automatically, therefore different from other some routes based on table, the present invention does not need to divide into groups to safeguard by periodic routing broadcast the real-time of route, and this route maintenance adopts the mode lastest imformation element of local updating rule.
The local updating rule refers to that the path that every artificial ant is passed by is upgraded, and it reflects the impact that each path that only manually ant was once passed by is surveyed the artificial ant in back, and the formula that wherein pheromones is upgraded is
, in formula
for the pheromones volatility coefficient,
for the initial value of pheromones, it can be used as parameter at the program communication environment of being adjusted to adapt to on-the-spot complexity in service.Simultaneously
it is also the system coefficient of dispersion, this coefficient can avoid artificial ant receipts rope path too to concentrate and be absorbed in the local optimum trap, affect the integral body system energy of system, but this coefficient affects the constringency performance of individual paths simultaneously, therefore, this coefficient is the parameter of a regulating system balance.
Power line carrier network is the control net of one-to-many, several carrier wave nodes that centered carrier node is in charge of with it communicate, generally do not need direct communication function (application layer data) between each subcarrier node, therefore the carrier network system only needs routing table that reaches each carrier wave node of centered carrier node maintenance, each carrier wave node only need to be preserved its path that arrives separately the centered carrier node and get final product, this point can reduce foundation and the maintenance work of routing table greatly, has reduced the complexity of system.
In the network operation after completing network organizing, consider the time variation of power line network channel and not knowing and doing, reparation arbitrary way when the present invention adopts likelihood probability inundation mechanism as path failure, flooding (flooding) is a kind of traditional broadcast type route technology, it does not need the topological structure of maintaining network and route to calculate, the carrier wave node that receives message is given all neighbours' carrier wave nodes with forms of broadcasting forwarding data bag, this process repeats, until packet arrives purpose carrier wave node or has arrived predefined maximum hop count, early stage flooding is also used application in power line network, be the inundation of simple all nodes traversal or be the inundation of fixation probability, this algorithm is realized simple, but there will be the implosion of information and overlapping, according to these deficiencies, the present invention proposes the probability inundation of the number of neighbor node Network Based.
If the centered carrier node does not send a message to the path that reaches purpose carrier wave node, this carrier wave node will transmit the data of application layer by broadcast, and the definition of its probable value is as formula
, wherein
it is the probability of replaying, n is the number of the neighbor node of carrier wave node, from this formula, in the value of given n, in order to prevent the message blind spot, in the situation that it is as shown in table 1 in the probable value that is greater than each carrier wave node forwarding of 99.99% arrival rate to meet forward-path message.
Number and the probability of table 1 neighbours carrier wave node
relation table
Experimental result shows, this probability flooding has reduced the flow of network, if the carrier wave number of nodes is (the carrier wave node can locally be assembled installation) the more, and suitably reduce the length of PATH and the time of rationally determining the newspaper gap, this algorithm will obtain better performance, experimental results show that under the same conditions, the probability flooding improves 50% than the replay amount of traditional flooding.
The present invention comprises three of link nodes parameters (LinkNodeState), link line parameter circuit value (LinkLineState), taboo list (LinkedNodes) data midway, these three midway data store the successful frequency of failure, the route degree of depth, the annexation with its father node of each carrier wave node, the search vestige of current carrier wave node, wherein the connection relationship of each carrier wave node and its father node can embody the successful frequency of failure that this paths is used, and has recorded the search vestige of current carrier wave node and can avoid relaying on same carrier wave node repeatedly.
Wherein the data format of link nodes parameter (LinkNodeState) is:
000002062143,A=10,B=10,C=1D,iDflag=01,Ph=02,count=00,fixd=01
In this link nodes parameter (LinkNodeState), the 000002062143rd, the MAC Address of carrier wave node; A=10 means to have three-phase on phase place A(power line, and the present invention is set as A, B, C three-phase, lower same) the upper detection unsuccessfully 1 time, not once success; C=1D means that phase place C has above surveyed unsuccessfully 1 time, successful 0x0D time; IDflag=01 means that the current degree of depth of carrier wave node is 1(mono-jumping); Ph=02 means that current use phase place C(0,1,2 represents A phase, B phase, C phase); Count=00 means that current 0 carrier wave node is used carrier wave node that MAC Address is 000002062143 as its father node; Fixd=01 degree of depth when limiting the carrier wave node searching carrier that MAC Address is 000002062143 is no more than a process of jumping to prevent the route computing and progressively strengthens the carrier wave node path degree of depth.
Wherein the data format of link line parameter circuit value (LinkLineState) is:
000002062143,000002062148,A=00,B=00,C=0C
In this link line parameter circuit value (LinkLineState), the 000002062143rd, the MAC Address of carrier wave node, the 000002062148th, the MAC Address of the father node of the carrier wave node that MAC Address is 000002062143, C=0C mean this path C go up mutually the failure 0 time, successful 0x0C time.
And the data format of taboo list (LinkedNodes table) is:
000002062143,000002062090
000002062143,000002062093
This taboo list means that it is 000002062090,000,002,062,093 two carrier wave node detective path that carrier wave node that MAC Address is 000002062143 was used MAC Address.
Pheromones in the present invention more new formula adopts formula F=100 * iused/ (iused+iUnused+iUnused * iDflag/Nvalue), in formula, F means pheromones, iused means successful number of times, iUnused means failed number of times, iDflag means the degree of depth in path, Nvalue means the number of father node, from this formula, can find out along with number of success increases, pheromones rises, along with the route degree of depth increases, pheromones descends, current carrier wave node path more (they being that his father's nodes increases), and pheromones rises.When choosing certain carrier wave node as relaying carrier wave node, give iused, the iUnused value adds 1 simultaneously, if when the routing of process detective path is successful, the iused value adds 1 again, with give iused simultaneously, the iUnused value adds 1 mode, guarantees when reducing pheromones, the survival property that retains the carrier wave node, change the currency of pheromones by simple number of times increase and decrease, amount of calculation is little, and computing is simple.
Wherein the decision method of carrier wave node survival is when the pheromones of carrier wave node drops to certain value, just can think that this carrier wave node do not survived, now the centered carrier node just need to be readjusted path and survey this carrier wave node, the minimum value of pheromones is the parameter of a complexity, itself and the residing node degree of depth of carrier wave node, the number of the neighbours' carrier wave node around this carrier wave node, the son node number of carrier wave node is relevant, it must obtain by complicated network analog and field test, and need the different value that is equipped with different typical platforms district to modify, just can obtain preferably search efficiency.
Now Automatic meter reading system occurs that new problem is that the community of estate management needs water meter, ammeter, the concentrator copy reading of gas meter, the problem caused like this is that the quantity of carrier network intercarrier node sharply increases, and due to water meter, the power supply of gas meter is generally in user family, the copy reading effect is very undesirable, adopt in the present invention the water meter of a user the inside, gas meter and ammeter are associated, water meter in the process of route discovery and route maintenance, gas meter is as the not participation network computing of attached carrier wave node, can guarantee water meter again when having greatly reduced network size, gas meter to the reliability of centered carrier node path (without loss of generality: indoor water meter, gas meter in the path of centered carrier node by best with the ammeter communication capacity in family).
Article one, the life cycle of routed path comprises establishment, reparation, again creates ... so circulation, the specific works step that in the present invention, route realizes is as follows:
(1) during constructive process, the successful record of this carrier wave node not in the LinkNodeState table, LinkLineState shows the also routing information of carrierfree node;
(2) artificial ant is from the centered carrier node, the any information that there is no the carrier wave node in the LinkNodeState table, adopt the mode of directly copying to survey artificial ant, wait for that artificial ant returns, the successful record that this carrier wave node is arranged in LinkNodeState table, every artificial ant survey and return after according to pheromones new formula lastest imformation element more;
(3) until all carrier wave nodes in LinkNodeState after existing record, route enters the multistage detection phase, route is according to pheromone concentration, heuristic information and normalized electrical distance are as selection strategy, select multistage path to discharge artificial ant, wait for that artificial ant returns, upgrade LinkNodeState, LinkLineState information and pheromones, choosing of relaying carrier wave node is the basis of route discovery and route maintenance, the first element of choosing is the concentration of pheromones, separately need to calculate the routing convergence that certain transition probability completes whole network,
(4) reach one regularly when the carrier wave node visit frequency of failure, in the LinkNodeState table, this carrier wave nodal information becomes failure, in LinkLineState table, path is also successfully the time, route enters repairs the carrier wave node path stage, at first the mulitpath that can choose in LinkLineState carries out multistage detection, if also unsuccessful, the carrier wave node of intercepting of choosing the carrier wave node carries out multistage detection, if survey artificial ant success repair successfully;
(5) when failure or continue, and to make in the LinkLineState table path be unsuccessfully the time, shows that this carrier wave node has been to be disconnected, and now just need to again create new path and enter one-level path detection phase of above-mentioned steps (2);
(6) when urgency communication or existing route can't complete normal data degree of copying, send the order of likelihood probability inundation, the probability that neighbours' carrier wave nodes that following carrier wave node is intercepted according to oneself selects broadcast to forward, complete data communication.
The low-voltage power spider lines route of having applied before the present invention relatively has following advantage and novelty:
(1) application of mutation ant group algorithm
The present invention has designed data-centered network model, and network carriers node random distribution, realize route discovery and route maintenance by ant group algorithm.The mutation ant group algorithm adopts positive feedback mechanism to realize the global optimization of network, and the continuous renewal by pheromones reaches and finally converges on optimal path, and the mutation ant group algorithm is without carrying out a large amount of probability calculations and setting up complicated Mathematical Modeling and carry out system prediction.The present invention can guarantee the network carriers node in the situation that link down occurs, and can recover link with minimum cost, and packet can correctly arrive purpose carrier wave node timely.
(2) application of likelihood probability inundation mechanism
The application of likelihood probability inundation mechanism had both guaranteed the effect of inundation mechanism, and minimizing replay amount that again can a great deal of, well meet the requirement of inundation route to carriers rate, was that to narrowband carrier broadcast behavior efficiency promotes largely.
(3) be convenient to the upgrading that water meter, gas meter, ammeter one collection are copied
The present invention has paid close attention to the concept of nearest popular, gas meter, ammeter automatic meter reading system, because other carrier wave nodes such as water meter, gas meter and ammeter have relevant relevance, if whole carrier wave nodes all participate in route discovery and route maintenance certainly will increase network overhead, the present invention introduces the concept of attached carrier wave node, the equipment such as water meter, gas meter does not participate in the networking computing, after its associated ammeter path success, using the communication path of ammeter as oneself path, and the method can reduce the complicated row of network and improve system reliability.
(4) robustness of network
The mutation ant group algorithm of strong, low expense, improved reliability and the validity of network, and adaptive likelihood probability algorithm can be made timely response to network topology change.