Invention content
The technical problem to be solved by the present invention is to need provide one kind can effectively reduce communication delay, improve communication can
Reduce by property and rationally the radio frequency network network-building method of power consumption.
In this regard, the present invention provides a kind of radio frequency network network-building method of low-power consumption, include the following steps:
Step S1, host are reached the standard grade, and start to realize that radio frequency network is set up;
Step S2, host cycle through broadcasting packet;
Step S3, slave are persistently intercepted, and after listening to broadcasting packet, receive and parse through the broadcasting packet, are obtained to authorize and be led to
News number;
Step S4, slave, which is sent, logs in message;
Step S5 judges the internal logic of the login message after host receives the login message, correct then in master until confirming
The mandate communication numbers corresponding position and fills out slave addresses inside machine;
Step S6, the slave number corresponding position by mandate communication and carry out data transmission;
Wherein, the network communication period between the host and slave is divided into T1 periods and T2 periods, and the T1 periods include the
One timeslice, the second timeslice and third timeslice, the first time piece, the second timeslice and third timeslice are with T2 weeks
Phase is as the timeslice period.
Further improvement of the present invention is that the first time piece is that host sends broadcasting packet timeslice, the step
Rapid S2 and step S3 is worked in the first time piece.
Further improvement of the present invention is, in the first time piece, the host is in transmission state, the host
Fixed frequency point in network is broadcasted, broadcasted content includes heading, message length, broadcast number, T1 cycle values, T2
Cycle value, transmission spreading coefficient, epicycle receive slave number most-significant byte, epicycle receives slave number least-significant byte, epicycle can apply
Mandate communication number, CRC and message trailer;The slave is in reception state, the broadcasting packet for receiving the host;
The slave newly to network can be applied by T1 cycle values, T2 cycle values, transmission spreading coefficient and epicycle in broadcasting packet
It authorizes communication number that inherent parameters are set, and log in the work of networking.
Further improvement of the present invention is that the host realizes the control to timeslice resource by spreading coefficient change
And utilization, the spreading coefficient change process are as follows:Host judges the corresponding vacant mandate communication number of current extensions coefficient,
When vacant mandate communication number only remains 1 or vacant mandate communication number is more than predetermined threshold value, the host is sent
Spreading coefficient modification information gives all authorisation devices;All authorisation devices reply acknowledgement frame;All mandates of host acknowledgement are set
After standby reply, new spreading coefficient is switched to according to the quantity for being currently accessed slave.
Further improvement of the present invention is that the T1 periods include 20 timeslices, and 20 timeslices are with T2 weeks
Phase, the first time piece included 1 timeslice, and second timeslice includes 3 timeslices, described as the timeslice period
Third timeslice includes 16 timeslices.
Further improvement of the present invention is that second timeslice is the point-to-point transmission message time piece of host, described
Host is in point-to-point transmission message status, and stops after having sent a frame retransmiting after the time interval in T1 periods next
Frame;Meet and receive the slave of slave number and be in reception state, remaining slave in a dormant state, and be in reception state from
Machine does not do any message reply after receiving message.
Further improvement of the present invention is that the third timeslice is slave sending time piece, and the host is in and connects
Receipts state;After the host receives any frame message, whether the communication mandate number for checking third timeslice and registration is correct,
If correct, switch to transmission state immediately, replied in a manner of the point-to-point transmission message time piece of host confirmation message to
The slave of transmission, then then returns to reception state.
Further improvement of the present invention is, in the step S3, it is described listen to broadcasting packet after, receive and parsing institute
Broadcasting packet is stated to include the following steps:
Step S301, slave receives and parsing broadcasting packet, obtains the mandate communication number of host meeting transmission data described in epicycle;
Step S302, if the slave is opened in the transmission list for authorizing communication number corresponding in follow-up second timeslice
Reception state;Otherwise go to step S303;
Step S303, the slave in follow-up second timeslice in a dormant state.
Further improvement of the present invention is, in the step S6, the slave transmission data includes following sub-step:
The step S601, the slave are registered to according to mandate communication number in the network of less radio-frequency networking;
Step S602 has been sent when switching to reception state after data and waiting for preset waiting in third timeslice transmission data
Between, receive the message acknowledgement frame of the host;If message acknowledgement frame is not received yet more than the preset stand-by period, under
The third timeslice of one wheel continues transmission data, until being more than preset transmission times.
Further improvement of the present invention is, after certain slave, which surprisingly goes offline, to exceed schedule time, authorizes communication number
It will automatically be recycled by losing changing process;The loss changing process includes:The host, which is sent, authorizes communication number change
After message gives new slave, new slave to receive mandate communication number change message, pass through the slave that goes offline and new in next round
The corresponding timeslice of slave institute in send and confirm change message to host;The host receives the confirmation of sub new slave
After changing message, the mandate communication numbered positions of the slave to go offline are filled out to the location device address of new slave, are discharged simultaneously
New slave original location device address.
Compared with prior art, the beneficial effects of the present invention are:The slave of no data transmission can be chronically at suspend mode
State, average sleep period duty ratio are more than 97%, and then effectively reduce communication delay;Host leads to without wake-up message is sent
News reliability is very high, and average data transfer rate can reach 100Kbps with number of access point dynamic regulation.Cause
Wake-up message will not be sent for host, then, even if host abnormal conditions, which cause to send for a long time, wakes up message, will not cause non-
Target slave is waken up and target slave is made to be waken up for a long time, and average stand-by power consumption of the invention, which is reduced to, receives the 3% of power consumption,
Maximum communication delay 1S, it is only necessary to 2S can fast automatic wireless networking, while reducing caused wireless telecommunications when communication abnormality
The case where machine is chronically at reception state and leads to battery rapid deterioration, therefore can effectively realize low-power consumption, low delay and height
The networking of reliability.
Specific implementation mode
Below in conjunction with the accompanying drawings, the preferably embodiment of the present invention is described in further detail.
As shown in Figure 1 and Figure 4, this example provides a kind of radio frequency network network-building method of low-power consumption, includes the following steps:
Step S1, host are reached the standard grade, and start to realize that radio frequency network is set up;This example starts according to the T1 periods and T2 periods of setting
Network construction is carried out, this example will be with T1=1S, for T2=50ms;
Step S2, host cycle through broadcasting packet;This example is after host is reached the standard grade, every time in the areas C(First time piece)Stage is followed
Ring sends broadcasting packet;
Step S3, slave are persistently intercepted, and after listening to broadcasting packet, receive and parse through the broadcasting packet, are obtained to authorize and be led to
News number;After slave booting, a wheel can be started and continue intercepting for 2S, after detecting broadcasting packet, parsing wherein broadcast number
The mandate that can apply with epicycle communicates number, is set as oneself slave communication number to authorize communication number;Such as number F3, together
When the clock of oneself is synchronized in the timeslice in T1 periods and T2 periods;If not listening to broadcasting packet, according to 10S-
The intervals 30S-60S-120S-240S-480S-960S continue to intercept;
Step S4, slave, which is sent, logs in message;
Step S5 judges the internal logic of the login message after host receives the login message, correct then in master until confirming
The mandate communication numbers corresponding position and fills out slave addresses inside machine;After host receives the login message of F3 at this time, if closing
Slave addresses are then filled out in the positions host internal authorization communication number F3 by method;
Step S6, the slave number corresponding position by mandate communication and carry out data transmission;I.e. hereafter slave is fixed
Data transmission is carried out in F3 timeslices.
Wherein, the network communication period between the host and slave is divided into T1 periods and T2 periods, and the T1 periods wrap
Include first time piece, the second timeslice and third timeslice, the first time piece, the second timeslice and third timeslice with
The T2 periods are as the timeslice period.
As shown in Fig. 2, forming networking communication between host and slave described in this example;The lower host of networking communication is 1, slave
It is 16 maximum;As shown in Fig. 3 and following table, networking communication mechanism is as follows, and whole network communication cycle is divided into T1 periods and T2 periods;
The T1 periods are large period, and the T2 periods are the minor cycle, it is preferred that the entire T1 periods are subdivided into 20 timeslices, including at the first time
Piece(The areas C)+ the second timeslice(The areas A1-A3)+ third timeslice(The areas F1-F16).The i.e. described T1 periods preferably include 20 times
Piece, for 20 timeslices using the T2 periods as the timeslice period, the first time piece includes 1 timeslice(The areas C), described
Second timeslice includes 3 timeslices(The areas A1-A3), the third timeslice includes 16 timeslices(The areas F1-F16).
|
C |
A1 |
A2 |
A3 |
F1 |
F2 |
…… |
F15 |
F16 |
Definition |
Broadcast |
Main hair/from receipts |
Main hair/from receipts |
Main hair/from receipts |
From hair/main receipts |
From hair/main receipts |
|
From hair/main receipts |
From hair/main receipts |
All hosts and the aerial baud rate of slave are 200Kbps in this example whole network;In more detail, such as Fig. 4 institutes
Show, the first time piece is that host sends broadcasting packet timeslice, and the step S2 and step S3 work in described first
In timeslice.
In first time piece described in this example(The areas C), the host is in transmission state, and the host is to fixed frequency in network
Rate point is broadcasted, and broadcasted content includes heading, message length, broadcast number, T1 cycle values, T2 cycle values, sends
The mandate communication that spreading coefficient, epicycle receive slave number most-significant byte, epicycle receives slave number least-significant byte, epicycle can apply is compiled
Number, CRC and message trailer;The slave is in reception state, the broadcasting packet for receiving the host;The slave newly to network
Number is communicated by the mandate that T1 cycle values, T2 cycle values, transmission spreading coefficient and epicycle can apply in broadcasting packet
Inherent parameters are set, and log in the work of networking, detailed operation flow is as shown in Figure 4.
Specific name meaning is as follows in broadcasted content described in this example, and it is which time broadcast of epicycle that broadcast number, which represents this, is used
It synchronizes and calculates in slave timeslice, value 1-4.It sends spreading coefficient and indicates slave sending time piece multiplying power, for improving the time
Piece utilization rate.Epicycle receives slave number most-significant byte and epicycle receives slave number least-significant byte and indicates which epicycle host will give
Several slaves send information, such as high/low 8 are respectively 0xF1 and 0x01, then it represents that epicycle host can give F1 F9 F13
F14 F15 F16 slaves send information.The mandate communication number that epicycle can apply indicates what new network access slave can obtain automatically
Communication number, such as 0x03 are authorized, indicates that slave can obtain the communication number of F3.
Wherein, host described in this example realizes control and utilization to timeslice resource, the expansion by spreading coefficient change
It is as follows to open up coefficient change process:Host judges the corresponding vacant mandate communication number of current extensions coefficient, when vacant mandate
Communication number only remains 1 or vacant mandate communication is numbered when being more than predetermined threshold value, and the host sends spreading coefficient and changes
Information gives all authorisation devices;All authorisation devices reply acknowledgement frame;After all authorisation devices of host acknowledgement are replied, according to
The quantity for being currently accessed slave switches to new spreading coefficient.
Spreading coefficient is described as follows:Spreading coefficient is to improve entire network environment when a small amount of equipment accesses, fill
Divide and utilize timeslice resource, reduces a measure of communication delay;The spreading coefficient of this example is preferably 1,2,4,8.When access is set
When for being 1, spreading coefficient 8;Then access device can be in F1, F3, F5, F7 and F15 timeslice transmission data.Work as access device
When being 2-3, spreading coefficient 4;Connect F1 equipment can in F1, F5, F9 and F13 timeslice transmission data, F2 equipment can F2, F6,
The positions F10 and F14 transmission data.When access device is 4-7, spreading coefficient 2, connecing F1 equipment can send out in F1 and F9 timeslices
Send data, F2 equipment can be in the positions F2 and F10 transmission data.And so on.
Spreading coefficient changing process:Host judges under current extensions coefficient that vacant mandate communication is numbered.When vacant mandate
When communication number only remains 1 or excessive vacant mandate communication number(When vacant mandate communication number is more than predetermined threshold value, in advance
If threshold value is to carry out customized value according to demand), host transmission spreading coefficient modification information is to all authorisation devices(Authorize from
Machine or legal slave);All authorisation devices reply acknowledgement frame;After all authorisation devices of host acknowledgement are replied, switch to new
Spreading coefficient.Such as:Access F1 and F2 at present, spreading coefficient 4;After F3 is accessed, detecting host only remains 1 vacant mandate
Communication number sends spreading coefficient and is changed to 2 information to all devices at this time.After confirmation, host change communication accesses at this time
F1, F2 and F3, spreading coefficient 2.At this moment external equipment can apply for the mandate communication number of F4, F5, F6 and F7.
Second timeslice described in this example(The areas A1-A3)For the point-to-point transmission message time piece of host, the host is in point
Message status is sent to, and next frame is retransmited after the time interval in stopping T1 periods after having sent a frame;Meet reception
The slave of slave number be in reception state, and in a dormant state, and the slave for being in reception state receives report to remaining slave
Any message is not done after text to reply.The T1 periods are preferably 1ms.
Third timeslice described in this example is slave sending time piece(The areas F1-F16), the host is in reception state;Institute
It states after host receives any frame message, whether the communication mandate number for checking third timeslice and registration is correct, if correctly,
Then switch to transmission state immediately, replied in a manner of the point-to-point transmission message time piece of host confirmation message to transmission from
Then machine then returns to reception state.
Piece sends message to host to slave described in this example at the appointed time, such as F3 slaves are in F3 timeslices transmission message
To host.Reception state, the reply confirmation message of receiving host are switched to after transmission.
As shown in figure 5, in step S3 described in this example, it is described listen to broadcasting packet after, receive and parse the broadcast report
Text includes following procedure:Slave, which intercepts the first broadcasting packet of host transmission and parses acquisition, authorizes login number n, while will be certainly
Body clock is adjusted to consistent with host with host synchronization, by inherent parameters;Slave is in the Fn timeslices of communication networking to host
Send the login frame of request access host network;Slave receiving host judges whether login frame meets the requirements according to internal logic,
And the judgement message formed, until meeting the requirements, then what slave receiving host was sent includes the second of slave communication number
Broadcasting packet, and parse;Slave receiving host allows to log in message what A1-A3 timeslices were sent, and sends and log in host
Frame acknowledgment message;The networking of Fn slaves is on the regular payroll, and networking is completed.
In other words, in step S3 described in this example, it is described listen to broadcasting packet after, receive and parse the broadcasting packet
Include the following steps:
Step S301, slave receives and parsing broadcasting packet, obtains the mandate communication number of host meeting transmission data described in epicycle;
Obtain which slave transmission data epicycle host can give;
Step S302, if the slave is opened in the transmission list for authorizing communication number corresponding in follow-up second timeslice
Reception state, that is to say, that until meeting the requirements, then what slave receiving host was sent includes the second of slave communication number
Broadcasting packet, and parse;Otherwise go to step S303;
Step S303, the slave in follow-up second timeslice in a dormant state.
In step S6 described in this example, the slave transmission data includes following sub-step:
The step S601, the slave are registered to according to mandate communication number in the network of less radio-frequency networking;
Step S602 has been sent when switching to reception state after data and waiting for preset waiting in third timeslice transmission data
Between, receive the message acknowledgement frame of the host;If message acknowledgement frame is not received yet more than the preset stand-by period, under
The third timeslice of one wheel continues transmission data, until being more than preset transmission times.The preset stand-by period is preferably
10ms, it is described to start number that modify and adjust according to actual needs.
It is as follows that host described in this example receives slave data procedures:Host keeps reception state in F1-F16 timeslices;When
After receiving data, confirmation message is replied according to reception address immediately.The process of the host transmission data is as follows:Host A1 ~
Required message is sent in the timeslice in the areas A3;After slave receives data, the time in the corresponding areas F1 to F16
Piece replys confirmation message.
This example authorizes communication number will be by losing changing process certainly after certain slave surprisingly goes offline and exceeds schedule time
Dynamic recycling;Such as existing mandate communication number F1-F6, F5 occur it is unexpected go offline, host is detected after F5 goes offline, and can recycle automatically
Authorize communication number.After longtime running, authorize communication number it is possible that more discontinuous situation, such as F1-F16 are made
With, after longtime running, occur F2, F3, F5, F6, F7, F10, F11 and F12 loss the case where, in order to which communication can be improved
Efficiency, using spreading coefficient, then host needs are to authorizing communication number to change.
As shown in fig. 6, loss changing process described in this example includes:The host send authorize communication number change message to
New slave passes through the slave to go offline and new slave after new slave receives mandate communication number change message in next round
It is sent in the corresponding timeslice of institute and confirms change message to host;The host receives the confirmation change report of sub new slave
The mandate communication numbered positions of the slave to go offline are filled out the location device address of new slave by Wen Hou, while being discharged new
Original location device address of slave.
Communication number change message is authorized to give F4 slaves for example, the host is sent(New slave), F4 slaves(It is new from
Machine)After receiving mandate communication number change message, in next round, pass through F2 slaves(The slave to go offline)With F4 slaves(New
Slave)Timeslice in respectively send confirm change message to host;The host receives F4 slaves(New slave)Confirmation
After changing message, by F2 slaves(The slave to go offline)The position of internal authorization communication number fill out the location devices of former F4 slaves
Address, while discharging the location device address of former F4 slaves.
In conclusion the slave of this example no data transmission can be chronically at dormant state, average sleep period duty ratio
More than 97%, when no data communicates, average sleep period duty ratio about 99%, and then effectively reduce communication delay;Host also without
Wake-up message need to be sent, communication reliability is very high, and average data transfer rate can be with number of access point dynamic regulation, highest
100Kbps can be reached.
And because host will not send wake-up message, then, even if host abnormal conditions cause to send for a long time and wake up message,
Non-targeted slave will not be caused to be waken up and target slave is made to be waken up for a long time, average stand-by power consumption of the invention, which is reduced to, to be connect
Receive the 3% of power consumption;When no data communicates, stand-by power consumption, which is about reduced to, receives the 1% of power consumption, maximum communication delay 1S, it is only necessary to 2S
Can fast automatic wireless networking, while while reducing communication abnormality caused radio communication apparatus is chronically at reception state and leads
The case where sending a telegraph pond rapid deterioration, therefore can effectively realize the networking of low-power consumption, low delay and high reliability.
The above content is a further detailed description of the present invention in conjunction with specific preferred embodiments, and it cannot be said that
The specific implementation of the present invention is confined to these explanations.For those of ordinary skill in the art to which the present invention belongs, exist
Under the premise of not departing from present inventive concept, a number of simple deductions or replacements can also be made, all shall be regarded as belonging to the present invention's
Protection domain.