Summary of the invention
The objective of the invention is to deficiency, provide a kind of to intelligent fire host computer and radio node communication means to existing fire communication technology.What use between host computer and the radio node is Routing Protocol, relies on base-station node (Base) to upload and issue data and accomplishes, and this will realize communicating by letter and control of host computer and whole radio sensing network.Host computer is shown to the packet that obtains on the display after handling, and the instruction acquisition with the user simultaneously is issued in the wireless sense network well.
The intelligent fire host computer upgrades net list for timing and offers a timer, with the superseded overtime node of not uploading data of certain cycle, and offers an interruption inlet and detects whether receive that packet perhaps needs transmitting order to lower levels.In order to reduce the fire-fighting node power consumption, send instructions being kept in the specific buffer memory down,, the corresponding node packet again it is handed down to the fire-fighting node when uploading.After host computer receives data, packet is sorted out, distinguished out networking request package and packet.The networking request package is filtered, and finally judging whether needs to upgrade net list, and sends response packet.Packet is filtered equally, and send response packet.The wireless fire-fighting node that needs transmitting order to lower levels is sent reception response packet in advance, order wireless fire-fighting node to prepare to receive the order bag.Concrete steps are following:
Whether step 1. host computer is provided with a TMR3 timer for regularly upgrading net list, finish in order to judge timing: if the timer timing finishes, will upgrade net list to remove overtime free of data node; Otherwise, get into step 2.
Step 2. is interrupted inlet for detecting radio node and whether receiving packet and whether need transmitting order to lower levels bag, host computer to offer one: need the transmitting order to lower levels bag if detect, will testing result be saved in and send buffer memory in the order bag; If testing result is to have received packet, with regard to execution in step 3; If testing result is not receive packet or do not need the transmitting order to lower levels bag, just return step 1.
Step 3. receives after the packet, and type of data packet is judged: if belong to the networking request package, get into step 4; If belong to data, get into step 5.
Step 4. receives after the networking request package, judges in the net list to have or not vacant position: if vacant position is arranged, then send and agree the networking packet and upgrade net list; If there is not vacant position, then send refusal networking packet.
Step 5. receives after the packet of data type, judges whether to network: if do not network, send refusal networking packet; If network, then show and preserve packet and querying command bag buffer memory, get into step 6 then.
Step 6. judges whether this node is sent packet: if do not send packet, then send and successfully receive response packet; If sent packet, then send and receive response packet in advance, and then send the order bag.
The beneficial effect that the relative prior art of the present invention has is: the communication means between host computer and the radio node, and rely on base-station node (Base) to upload and issue data and accomplish, the realization host computer is communicated by letter and control with whole radio sensing network.Realize the low cost of network-efficient property and node.Collocation through the present invention and intelligent fire emergency light is used can be when breaking out of fire etc. be dangerous; Realize the fault alarm of emergency light and the demonstration of functions such as early warning, emergency light real-time status; Guide the survivor to flee the scene safely, to greatest extent support personnel's property safety.
Embodiment
Below in conjunction with accompanying drawing and instantiation the present invention is made and to further specify.
The present invention proposes the communication means between a kind of intelligent fire host computer and the radio node.As shown in Figure 1:
Step 1. host computer specially is provided with a TMR3 timer for regularly upgrading net list, does not finish in order to judge timing.If the Timeout of timer surpasses certain threshold value, will upgrade net list and remove overtime free of data node; Otherwise, get into step 2.
To the net list that host computer regularly upgrades, its particular content comprises node address, node R SSI value, Timeout value, shown in table one.Wherein node address is made up of the node ID (low byte) and the node floor number (high byte) that network, the RSSI value of node R SSI value representation network access node, and tabulation will be deleted this nodal information when the Timeout value surpasses certain threshold value.
Table one net list form
Step 2. is interrupted inlet for detecting radio node and whether receiving packet and whether need transmitting order to lower levels bag, host computer specially to offer one.Need the transmitting order to lower levels bag if detect, will testing result be saved in and send buffer memory in the order bag; If testing result is to have received packet, will execution in step 3; If testing result is not receive packet or do not need the transmitting order to lower levels bag, will return step 1.
(2.1) packet that receives to radio node, its concrete form is shown in table two:
Table two packet data zone form
(2.1.1) self floor number is meant which floor the packet that receives belongs to.Agreement between radio node regulation, every layer of name zone that has separately, for example: ground floor has 256 nodes, and self floor number is 1, and node number is 1-255.Attention: have only Base node ability called after 0.
(2.1.2) present invention includes sensing data and report, the node health condition reports, a series of functions such as network control.In order better to use these functions, the present invention's decision is distinguished different packet functions according to type of data packet, and makes different decision-makings according to different data types.
(2.1.3) the node group number is for signal between distinguishing not on the same group disturbs, and can be used for defining different transmission regions in the present invention.
(2.1.4) self node number and destination node number comparatively speaking are meant the node number that sends data, are used for distinguishing the different nodes in the same floor.
(2.1.5) equipment of itself number is in order to distinguish different wireless devices, so that host computer is handled corresponding different data area types, simultaneously different equipment to be made different processing.The device number type is shown in table three:
Table three device number type
The device number style number |
The device number types value |
Describe |
BASE_DEVICE |
0x01 |
Base station (Base) |
MOTE_ DEVICE |
0x02 |
Emergency light node (Mote) |
MEASUR_ DEVICE |
0x03 |
The wireless measurement node |
(2.1.6) sequence of data packet number writes down the position of this packet in whole transmission sequence, purpose be in the test link packet loss with give the significant data bag for change.Sequence of data packet number adds up once when packet of every transmission.
(2.1.7) data packet length comprises except that CRC check code, packet header and all data lengths the bag tail.Packet header and bag tail are represented with 0x7E, when using 0x7E in the packet, need escape.The 0x7E escape becomes 0x7D5E, and the 0x7D escape becomes 0x7D5D.
(2.2) to the required order bag that issues of radio node, according to the difference of device type, order packet format that issues and content are with different.
The order packet format of intelligent fire emergency light control is enumerated at this place, and its data area form is shown in following table four:
The data area form of table four order bag
(2.2.1) the data upload time interval: be meant the time cycle of uploading data of emergency light node to the Base node, unit is second (S), and the largest interval time is 65535 seconds, and the minimum interval is 1 second.
(2.2.2) discharge and recharge control: the expression host computer directly charges to the node of emergency light and discharges.Concrete form is shown in following table five:
Table five discharges and recharges the controlled flag position
Discharge and recharge the sign name |
Discharge and recharge value of statistical indicant |
Describe |
CHANG |
0x01 |
Charging |
DISCHANG |
0x02 |
Discharge |
CHANG_TOGGLE |
0x03 |
Discharge and recharge upset |
(2.2.3) emergent control: the expression host computer is directly met an urgent need and main electricity condition switching controls to the node of emergency light.Concrete form is shown in following table six:
The emergent control of table six
Emergent controlled flag name |
Emergent controlled flag value |
Describe |
EMERG_MODE |
0X01 |
Discharge mode |
MAINS_MODE |
0X02 |
Main power mode |
MODE _TOGGLE |
0X03 |
The pattern upset |
(2.2.4) manually year/monthly test: the expression host computer carries out remote manual year/monthly test to emergent Lantern Festival point and controls.Concrete form is shown in following table seven:
Manually year/monthly test control of table seven
Manual year/monthly test sign name |
Manual year/monthly test value of statistical indicant |
Describe |
YEAR_CHECK |
0X01 |
Annual test |
MONTH_CHECK |
0X02 |
Monthly test |
NO_CHECK |
0X03 |
Do not have and detect |
Step 3. receives after the packet, will judge type of data packet.If belong to the networking request package, get into step 4; If belong to data, get into step 5.
To type of data packet, the form of data area is with different in the different data type corresponding data bags, and concrete form is shown in table eight:
Table eight type of data packet
The type of data packet name |
The type of data packet value |
Describe |
AM_SHEART_MSG |
0x01 |
Heartbeat data packets shows the base operating state |
AM_SSENSOR_MSG |
0x02 |
Sensor data packet reports acquisition node |
AM_SHEALTH_MSG |
0x03 |
Healthy bag shows node health status |
AM_SCOMMAND_MSG |
0x04 |
The order bag, control wireless network operating state |
AM_SACK_MSG |
0x05 |
Response packet is replied accepting to instruct to make |
AM_SOUTE_MSG |
0x06 |
The route bag, Control Network is set up |
(3.1) owing to need not to upload any other redundant data, the data area in the heartbeat data packets is empty.And information such as floor number, node number, group number are all relevant with Base node self.
(3.2) owing to the difference of device type, sensing data packet format of uploading and content are with different.The data format that the fire emergency lamp transducer is collected is enumerated at this place, shown in table nine:
Table nine sensor data packet data area form
(3.2.1) cell voltage: the existing magnitude of voltage of expression emergency light internal cell, represent the existing electric weight of battery.
(3.2.2) light source state: the existing state value of expression emergency light light source, concrete form is shown in following table ten:
Table ten light source Status Flag
Light source failure sign name |
The light source failure value of statistical indicant |
Describe |
LIGHT_FUN |
0X01 |
Light source is normal |
LIGHT_SHORT |
0X02 |
The light source short circuit |
LIGHT_OPEN |
0X03 |
The light source open circuit |
(3.2.3) battery status: the standing state of expression emergency light internal cell, concrete form is shown in following table 11:
Table ten a battery status flag bit
Battery failures sign name |
The battery failures value of statistical indicant |
Describe |
BATTERY_FUN |
0X01 |
Battery is normal |
BATTERY_SHORT |
0X02 |
Battery short circuit |
BATTERY_OPEN |
0X03 |
The battery open circuit |
BATTERY_LOW |
0X04 |
Electric weight is low |
BATTERY_LOW |
0X05 |
Electric weight is low excessively |
BATTERY_FULL |
0X06 |
Electric weight is saturated |
(3.2.4) city's electricity condition: whether expression 220V power supply situation need get into emergency rating.When line voltage gets into contingency mode during less than 132V, get into main power mode during greater than 186V.Concrete form is shown in following table 12:
Table ten two civil power state flag bits
Civil power Status Flag name |
The civil power status flag value |
Describe |
MAINS_MODE |
0X01 |
Main power mode |
EMERG_MODE |
0X02 |
Contingency mode |
(3.2.5) warning: whether the expression emergency light needs to report to the police, and concrete warning reason needs several before of reference data bags.Concrete form is shown in following table 13:
Table ten three warning mark positions
The warning mark name |
The warning mark value |
Describe |
FUN |
0X01 |
Normally |
ALERT |
0X02 |
Report to the police |
(3.3) purpose of healthy bag is in order to obtain the health status of all nodes in the network.According to the difference that distinct device requires, host computer can through under send instructions and come the Control Network interior nodes whether to upload healthy bag.The data area form of healthy bag is shown in table ten four.
The data area form of table ten four healthy bags
(3.4) the order bag sees (2.2) for details.
(3.5) response packet mainly is the serial ports instruction that host computer is issued, and slave computer is made this and being replied, comprising receiving the information that whether successfully waits.Its data area form is shown in table ten five:
Table ten five response packet data area forms
The accepting state concrete form is shown in following table 16:
Table ten six accepting state flag bits
Response status sign name |
The response status value of statistical indicant |
Describe |
SUCCEED_STATE |
0X01 |
Receive successfully |
ERROR_STATE |
0X02 |
Take defeat |
The fault message concrete form is shown in following table 17:
Table ten seven fault message flag bits
Fault message sign name |
The fault message value of statistical indicant |
Describe |
NO_MOTE_ERROR |
0X01 |
No node mistake |
CRC_ERROR |
0X02 |
The CRC check failure |
OVERSET_ERROR |
0X03 |
Adjusting overruns |
NO_ERROR |
0X04 |
Inerrancy |
(3.6) the route bag sends the packet that uses when replying instruction mainly as slave computer to host computer application networking or host computer to slave computer.Route bag data area form is shown in table ten eight:
Table ten octuple is by bag data area form
(3.6.1) routing state: represent the effect that this route bag is played, slave computer will be made corresponding reaction to its different state.Particular type is shown in table ten nine:
Table ten nine routing state signs
Routing state sign name |
Discharge and recharge value of statistical indicant |
Describe |
DATA_ACCEPT |
0xE0 |
Data Receiving is replied |
DATA_DENIED |
0xEF |
Data reject response |
SLAVE_INFO_TABLE_UNFULL |
0xF0 |
Network successfully |
SLAVE_INFO_TABLE_FULL |
0xFF |
Failure networks |
COMMAND_REQ_PACKET |
0x13 |
Instruction issues requirement |
(3.6.2) RSSI value: link corresponding quality when the expression node networks, preserve the RSSI value and help evaluating and optimizing of network configuration.
Step 4. receives after the networking request package, judges in the net list to have or not vacant position.If vacant position is arranged, then send and agree the networking packet and upgrade net list; If there is not vacant position, then send refusal networking packet.
Step 5. receives after the packet of data type, judges whether to network.If do not network, send refusal networking packet; If network, then show and preserve packet and querying command bag buffer memory, get into step 6 then.
Step 6. judges whether this node is sent packet.If do not send packet, then send and successfully receive response packet; If sent packet, then send and receive response packet in advance, and then send the order bag.