CN1333376C - Fire alarm application layer data transmission method based on CAN2.0B - Google Patents

Fire alarm application layer data transmission method based on CAN2.0B Download PDF

Info

Publication number
CN1333376C
CN1333376C CNB2004100264294A CN200410026429A CN1333376C CN 1333376 C CN1333376 C CN 1333376C CN B2004100264294 A CNB2004100264294 A CN B2004100264294A CN 200410026429 A CN200410026429 A CN 200410026429A CN 1333376 C CN1333376 C CN 1333376C
Authority
CN
China
Prior art keywords
information
node
transmission
data
packets
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.)
Expired - Lifetime
Application number
CNB2004100264294A
Other languages
Chinese (zh)
Other versions
CN1560806A (en
Inventor
黄红军
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Hi Tech Investment Sanjiang Electronics Co ltd
Original Assignee
Shenzhen Fanhai Sanjiang Electronics Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Fanhai Sanjiang Electronics Co Ltd filed Critical Shenzhen Fanhai Sanjiang Electronics Co Ltd
Priority to CNB2004100264294A priority Critical patent/CN1333376C/en
Publication of CN1560806A publication Critical patent/CN1560806A/en
Application granted granted Critical
Publication of CN1333376C publication Critical patent/CN1333376C/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Abstract

The invention discloses a fire alarm application layer data transmission method based on CAN2.0B, which constructs an information layer data packet according to the length of transmission information, and simultaneously constructs a data frame identifier comprising an information packet type field, a transmission source address field, a receiving destination address field and an information packet data frame number field, so that the priority level of the transmission information is convenient to define, the defect that a CAN protocol does not contain a transmission source address field and a destination address field is overcome, and the method CAN be suitable for a fire alarm control system; the response mechanism of the receiving node ensures the reliability of data transmission; multi-frame transmission or multi-frame transmission of a plurality of information layer data packets of the whole file is adopted, so that the transmission of the information layer data packets with the length exceeding 8 bytes and the transmission of the file with the length exceeding the maximum allowable length of a single information layer data packet in the system are met; and a timeout retransmission mechanism, a node fault detection mechanism, a buffer zone retriggering mechanism and the like are also adopted in data transmission, so that the accuracy and the effectiveness of data transmission can be further ensured.

Description

Fire alarm application-layer data transmission method based on CAN2.0B
[technical field]:
The present invention relates to a kind of data transmission method, particularly a kind of fire alarm control Application for Field layer data transmission method that is applied in based on CAN2.0B fieldbus application protocol.
[background technology]:
Along with large-scale colony building occurs more and more, more and more higher requirement has been proposed automatic fire-alarm system at aspects such as geographical space fire detection, fire fighting equipment interlock controls.The heavy construction group makes geographic descriptor become big, and it is many that detection point becomes, and equipment linkage control complicates.Simultaneously,, make the delay of communication and the interference of environment strengthen, cause real-time, accuracy and the reliability of information transmission to reduce because communication distance becomes more and more far away.These all need alarm host machine can drive and manage more driving circuit board, and networking is satisfied the increase of communication information amount and the increase of communication distance between alarm host machine and the alarm host machine under the prerequisite of reliable transmission quick and precisely.
Traditional way is to use the RS485 communication modes to realize host computer communication and host computer communication, being connected between host computer communication and the driving circuit board.The RS-485 standard is that the EIA of Electronic Industries Association worked out and issue in nineteen eighty-three.It has only stipulated the electrical characteristics of balance driver and receiver and has not stipulated connector transmission cable and application layer communication protocol simultaneously, a node can only be arranged as main frame on the RS-485 bus, and other nodes can only be as slave, and no priority sends.These these quality factors cause the RS-485 agreement to exist bus efficiency low, and the real-time of system is poor, and the reliability of communication is low, the later maintenance cost height, and the network engineering debugging is complicated, and transmission range is undesirable, and the node that unibus can articulate is few, uses shortcomings such as dumb.
Controller local area network (Controller area network is called for short CAN) is a German Bosch company in nineteen eighty-three is that automobile is used and developed, can effectively support distributed control and the serial communication network of controlling in real time, 1991, the said firm released the CAN2.0 standard.In November, 1993, ISO (International Standards Organization) ISO has formally issued controller local area network CAN international standard (IS011898).Compared following characteristics with other buses: 1.. it is a kind of multi-master bus, and promptly each node machine all can become main frame, and also can communicate between the node machine; 2.. communication media can be twisted-pair feeder, concentric cable or light transmitting fiber, and traffic rate can reach 1Mbps; 3. the integrated Physical layer and the data link layer functions of CAN agreement in the .CAN bus communication interface can be finished the whole frame of communication data is handled, and comprises that position fillings, data block coding, cyclic redundancy check (CRC), priority discrimination etc. work; 4. the .CAN agreement is encoded to communicating data block.The identification code of data block can be made up of 11 (CAN2.0A) or 29 (CAN2.0B) binary numbers, therefore can define 2 11Or 2 29Individual different data block; 5.. data segment, length mostly is 8 bytes most; 6. the .CAN agreement adopts the CRC check and the corresponding error processing capacity can be provided, and has guaranteed reliability of data communication.
CAN technical manual (2.0B) is handled the data transmission layering (data link layer [logic chain LLC sublayer, media interviews control media access control sublayer] and Physical layer) of every frame.LLC sublayer major function: for data transmit and the teledata request provides service, confirm by the message reality that the LLC sublayer receives be received and for recovery management, notice overloads that information is provided.The media access control sublayer major function: guarantee to transmit rule (control frame structure, carry out arbitration, error-detecting, demarcations, failure defining make mistakes), it is monitored by a management entity that is referred to as failure defining.Data link layer is finished by application-specific integrated circuit that is referred to as the CAN protocol controller (as MCP2510, SJA1000,82C200 etc.) or the MCU (as 8XC592) that has a CAN agreement steering logic unit; Physical layer is finished by the application-specific integrated circuit that is referred to as the CAN driver (as 82C250).
Because Frame of CAN2.0B standard code is 8 bytes of transmission at most, and in current large-sized fire warning system, report to the police and the length of interlock information is far longer than 8 bytes; Simultaneously, the online detection of node, system clock is synchronous, and information such as state synchronized also are necessary in fire alarm system.Therefore, depend merely on the CAN2.0B standard, can't adapt to the needs of current fire alarm system, this just needs application layer protocol to guarantee these data message fast and reliable transmission.
[summary of the invention]:
Purpose of the present invention is exactly in order to overcome the above problems, and provides a kind of and can be applicable to fire alarm system, based on the fire alarm application-layer data transmission method of CAN2.0B.
For achieving the above object, the present invention proposes a kind of fire alarm application-layer data transmission method based on CAN2.0B, comprise the steps: A, calculate the length of this self-defined information bag or whole file, according to maximum length, the maximum data length that allows length, this transmission of Information Level packet of allowing of Frame, make up the Information Level packet; According to the data length of this transmission, when length is not more than 8 bytes, be the single frames send mode; Otherwise be the multiframe send mode; With described send mode information architecture in the information packet classification of first Information Level packet;
B, make up identifier, the 29bit of Frame ID identifier is divided at least four zones, be respectively packet type territory, transmission source address territory, receive destination address domain, packet data frame number territory;
C, judge described send mode information, determine the send mode of this packet; The Frame that is not more than 8 bytes with each is that unit sends the Information Level packet according to the reception destination address domain in the above-mentioned identifier to its destination address that provides;
After D, receiving node receive complete packets of information, at the appointed time in, send response signal according to the transmission source address territory in the identifier to transmission source address, confirm that data receive, this sends successfully, enters next packets of information transmit status.
In the above-mentioned transmission method, the step of described single frames send mode: the packets of information classification of judging first Information Level packet, when this value shows that this is sent as the single frames data packets, indicate the Information Level packet that time information packet stamp, User Defined data are arranged at least to its destination address that provides transmission according to the reception destination address domain in the above-mentioned identifier.The step of described multiframe send mode is: judge the packets of information classification of first Information Level packet, when this value shows that current data packet needs multiframe to send, then further judge information such as current information packet length; Number of information layers is sent according to pack subframe, subpackage.In the multiframe send mode, when the length of whole file allowed length greater than an Information Level packet is maximum, also indicating in packets of information Bale No. domain identifier is zero first Information Level packet had whole data file length information and current information bag Bale No. information; During transmission whole file is divided into a plurality of Information Level packets, each packet is divided into the multiframe data frame transfer.
Above-mentioned transmission method, also comprise overtime retransmission mechanism, when the affirmation that promptly at the appointed time interior sending node does not receive the receiving node transmission receives information, sending node starts repeating transmission automatically, receive the affirmation reception information that receiving node sends until sending node, or the repeating transmission number of times has reached predetermined maximum number of retransmissions.Described retransmission mechanism also comprises the method for judging duplicate packages: receiving node is judged the packet type territory and the timestamp of the packets of information sign that sending node sends, when the two and paid-in certain information in package bag type field, timestamp are identical respectively, think that then this information that receives is duplicate packages, abandon this duplicate packages.
Above-mentioned transmission method also comprises the node failure testing mechanism: each node regularly sends online signal to associated node with it on the bus when it is idle, and each node all has one group of node that interrelates with it at thread count.Each counter is provided with initial value when powering on and recovering, when receiving the online signal data bag of certain node, counter is carried out a forward operation, until certain predetermined value; Periodically counter is carried out once opposite with aforementioned positive computing direction reverse computing simultaneously, when the value of counter is 0, then quote this node communication failure.The preferred version of node failure testing mechanism is: send the time interval of the time interval of online signal less than the periodicity down counter, counter is provided with the non-zero initial value when powering on and recovering, when described node counts device is received the online signal data bag of certain node, carry out a forward operation and add 1, until a predetermined maximum value.Periodically each node is carried out once oppositely computing at thread count simultaneously and subtract 1, when the value of counter reduces to 0, quote this node communication failure.
Above-mentioned transmission method, also comprise the heavy trigger mechanism of buffer zone: for the packets of information that in described overtime retransmission mechanism, sends failure, sending node is opened up a new buffer zone and is preserved these packets of information, and when this node was in the transmission idle condition, this node attempted retransmitting these packets of information.
Owing to adopted above scheme, can make up the Information Level packet according to the length of transmission information, the data frame identifier of Gou Jianing comprises packet type territory, transmission source address territory, receives destination address domain and packet data frame number territory simultaneously, be convenient to define the priority level of transmission information, overcome the deficiency that does not comprise transmission source address and destination address domain in the CAN agreement, go for fire alarm control system; The acknowledgement mechanism of receiving node guarantees reliability of data transmission.
Secondly, adopt multiframe transmission or a plurality of Information Level packets of whole file, multiframe transmission, satisfy Information Level packet, the length that length in the system surpasses 8 bytes and surpass the maximum transmission that allows the file of length of single Information Level packet.In data transmission, also adopt overtime retransmission mechanism, node failure testing mechanism, the heavy trigger mechanism of buffer zone etc., can further guarantee accuracy, the validity of data transmission.
[description of drawings]:
Fig. 1 is the transmission flow figure of the CAN packets of information of a kind of implementation method of the present invention at sending node;
Fig. 2 is the reception process flow diagram of the CAN packets of information of a kind of implementation method of the present invention at receiving node;
Fig. 3 is the networking synoptic diagram in the fire alarm system that adopts the inventive method;
Fig. 4 is the data structure synoptic diagram between drive circuit plate and the alarm host machine in the fire alarm system of using the inventive method;
Fig. 5 is the data structure synoptic diagram between the fire alarm system alarm host machine of the inventive method.
[embodiment]:
Also the present invention is described in further detail in conjunction with the accompanying drawings below by specific embodiment.
1. the structure of application layer protocol data packet format:
In the CAN2.0 technical manual Frame ID is divided into standard (A) and expansion (B) dual mode.Wherein standard mode comprises the 11Bit position, and extended mode comprises the 29Bit position.It is relevant by forming of ID identifier that bus sends arbitration, and the numerical value of ID is more little, and then the priority of this Frame is high more, and this sending node is the easy more bus of seizing in bus arbitration, and the time-delay that Frame is sent completely is more little.This fire alarm application layer protocol adopts the CAN2.0B standard.Frame ID29bit position is divided into 4 zones, the Bale No. territory of packet type territory, transmission source address territory, reception destination address domain, packets of information.Definition of data frame ID identifier and node address are as follows:
</entry></row></tbody></tgroup></table></tables>
Packet type territory (INFO_ID): in order to represent the priority level of the information of transmitting, most-significant byte definition position packet type with Frame ID, such as fire alarm information, feedback information, failure message, handshaking information, clock synchronization information, its packet id value of important more information is more little; ID21=0 represents that sending node sends packets of information to receiving node, ID21=1 represents the response (success) of receiving node to the packets of information of ID20=0, and data field is the timestamp and the packets of information classification (back will describe in detail) of first byte-transmission packets of information of reception data zero frame.When receiving node receives the packets of information of ID21=1, no longer send response message (otherwise will produce recurrence) to sending node.This shows that the INFO_ID of data packets is an even number, the INFO_ID of its ACK bag is an odd number.Such as, 08 is system recovery ID, and 14 is system state, clock synchronization, the online ID of node, and 32 is the fire alarm ID of system, and 64 is system failure ID etc.
Transmission source address territory (SRC_ADDR) and receive destination address domain (DEST_ADDR): these two address fields all take 8, represent the sending node and the receiving node address of Frame respectively, thus on a bus maximum 256 nodes.Do not comprise source address and destination address domain in the CAN agreement in the data block, must distinguish each node and distributing data stream with the address, so at the source address and the destination address of this section definition packet of Frame ID in fire alarm control field.Receiving node CAN controller whenever receives a CAN Frame, all can interrupt to the master microprocessor application.In order to reduce unnecessary spending between bus node master microprocessor and the CAN controller, improve the service efficiency of master microprocessor, the Frame of the filtering of CAN controller and mask register being arranged to only to allow to send to this node by and to microprocessor application Interrupt Process.
The data frame number territory (INFO_ORDER) of packets of information: this territory takies the 5bit position.Many data messages are all greater than 8 bytes of a CAN Frame maximum transmitted, so application layer protocol is a kind of multiframe host-host protocol.In application layer protocol, the information of a packet is made up of a plurality of CAN Frames.When this territory is zero, have special implication, the same meaning of 1-31, the Frame sequence number of expression packets of information:
INFO_O RDER Implication
0 Represent these frame data or after DATA1 DATA2 DATA3 DATA4 DATA5 DATA6 DATA7 DATA8 Remarks
XXXX0000 User Defined data layout (reporting the small data quantity information such as fire alarm, feedback, fault of main frame as the drive circuit plate). The single frames data packets.
The meaning of continuous frame. XXXX0001 The current information packet length Length is less than the packets of information of 248 bytes.
XXXX0010 The current information packet length Current information bag Bale No. Whole data file length Length is greater than the packets of information (file) of 248 bytes, non-last new packets data.
XXXX0011 The current information packet length Current information bag Bale No. Whole data file length Length is greater than the packets of information (file) of 248 bytes, last packet data.
1-31 Only after the INFO_ORDER=0 Frame occurred, these Frames just may occur.DATA1-DATA8 is the User Defined data.
In last table 1.. whole data file length is the length of file during greater than a packets of information, and when smaller or equal to a packets of information, its value equals the current information packet length if adopt the XXXX0011 pattern to transmit then, and the current information Bale No. is 0.2.. current information bag data frame number is since 0 counting.3. maximum length position 248 bytes of a packets of information, various application can be according to the maximum length of actual provisioning information bag.
2. the structure of Information Level packet:
Under the situation that CAN Frame data are accurately transmitted, need guarantee the reliable transmission of data greater than the data of a Frame with the Information Level agreement.Must be divided into many Frames greater than the data of a Frame sends or receives.Be concrete agreement below:
Each Frame all has an ID identifier, distributes as can be known from the BIT position of top ID identifier, and ID4-ID0 is the frame number of Information Level Frame, is that the implication of different numerical value is described to the data frame number simultaneously:
INFO_ORDER=0 XXXX is the 4Bit width, and the time information packet that expression sends stabs.When the overtime retransmission of information bag of sending node, the data in this territory are constant.After sending the packets of information success, when sending next packets of information, this territory adds one, represents different packets of information. Represent that this Frame is the beginning (packet data can at a data frame end) of packet data, the concrete meaning of these frame data relies on the value of DATA1: DATA1=xxxx0000 represents that this packet data only is included in this Frame, and the implication of the data of back 7 bytes is defined by user oneself; DATA1=xxxx0001 represents that the data of this packets of information are greater than 7 bytes, must be by a plurality of data frame transfer, the maximum length of this information frame is less than the 8*31=248 byte simultaneously.The length of this packets of information of value representation of DATA2.Router and reception program must rely on this to be worth to judge whether this packets of information is sent completely.DATA1=xxxx0010 represents that the data volume (file transfer) that transmits can not be finished by a packets of information, must come segment transmissions by a plurality of packets of information.The value of DATA2 is the data length of this packets of information.DATA3*256+DATA4 is in this file transfer, the bag sequence number of current information bag.DATA5*65536+DATA6*256+DATA7 is the length of this file transfer.Current information bag bag sequence number counts from zero.Therefore the maximum length of file transfer is 248*65536=16,252,928 bytes.This packet type is used to transmit the data greater than the packets of information maximum length, and last packets of information of right and wrong.DATA1=xxxx0011 represents that the data volume (file transfer) that transmits can not be finished by a packets of information, must come segment transmissions by a plurality of packets of information.The value of DATA2 is the data length of this packets of information.DATA3*256+DATA4 is in this file transfer, the bag sequence number of current information bag.DATA5*65536+DATA6*256+DATA7 is the length of this file transfer.Current information bag bag sequence number counts from zero.Therefore the maximum length of file transfer is 248*65536=16,252,928 bytes.This packet type is used to transmit the data greater than the packets of information maximum length, and is last packets of information.Other reservations of DATA1=.
INFO_ORDER=1-31 Each frame data of this packets of information are formed in expression.DATA1-DATA8 all can be used as the transmission of valid data.Receiving node can judge whether present frame is the repeating data frame or falls frame data according to the value of Info_Order.Simultaneously by the Frame of Info_0rder=0 with packet length information information judge whether that packets of information is sent completely.
3. receiving node acknowledgement mechanism:
Reply with overtime retransmission mechanism be Control Flow and accurately and reliably the transmission the basis.After receiving node receives a complete packets of information, must send this packets of information of ACK signal indication by complete reception to sending node.The INFO_ORDER=0 of ACK packets of information.Data length is 2, and data content is for receiving first byte DATA1 (timestamp and packets of information classification) of packet data zero frame.ACK packet type (INFO_ID) adds 1 for receiving packet type.Such as, if the INFO_ID=10 of fire alarm packets of information, the INFO_ID=11 of the ACK bag of then fire alarm packets of information.
INFO_ORD ER Implication
0 DATA1 DATA2 ATA3-DATA Remarks
XXXX0000 Timestamp and packets of information classification (equaling to receive first byte of the CAN Frame of packet data Info-order=0) The single frames data packets.
4. overtime retransmission mechanism:
When sending node sends a packet data, wait for that receiving node sends ACK and confirms reception information.In designated time intervals, if do not receive the ack signal bag of receiving node, sending node starts overtime retransmission mechanism.When the repeating transmission number of times reaches maximum number of retransmissions, send failure.At present, sending timeout interval is 2.5 seconds, and maximum number of retransmissions is 5.
When receiving node is received the packets of information that INFO_ID is identical and timestamp is also identical that same sending node sends, think sending node because the duplicate packages that retransmission mechanism sends must abandon this duplicate message bag.Otherwise many command action (as recovery, noise elimination etc.) may take place repeatedly.
5. sending node and receiving node processing that packets of information is sent and receives:
Sending node 1 (data priority is low, and first log-on data sends) Sending node 2 (data priority height, back log-on data sends) Receiving node
Put data to be sent in order
Send the Info_order=0 Frame Receive the Frame of sending node 1 Info_order=0
Send the Info_order=1 Frame Receive the Frame of the Info_order=1 of sending node 1
Send the Info_order=N Frame Put data to be sent in order Receive the Frame of the Info_order=N of sending node 1
Microprocessor send Info_order=N+1 data to the CAN controller Send the Info_order=0 Frame Receive the Frame of the Info_order=0 of sending node 2
Send the Info_order=1 Frame Receive the Frame of the Info_order=1 of sending node 2
Send Info_order=N+1 Frame (may make this node keep sending pending status due to the Frame that sending node 2 sends Info_order=2) Microprocessor send the Info_order=2 data (if this operation is enough fast to the CAN controller; Also may form the situation with sending node 1 competition bus, by the Frame of bus president mechanism Info_order=2, be sent) The Frame of the Info_order=2 of the Frame of the Info_order=N+1 of reception sending node 1 or reception sending node 2
Send the Info_order=N Frame Receive the Frame of the Info_order=N of sending node 2
Transmission finishes, and waits for that the ACK of receiving node confirms Frame Send ACK to node 1 and confirm Frame
Transmission finishes, and waits for that the ACK of receiving node confirms Frame Send ACK to node 2 and confirm Frame
1. receive that ACK confirms, sends successfully.Enter next packets of information transmit status.2. overtime for receiving that ACK confirms, resends this packets of information.
1. receive that ACK confirms, sends successfully.Enter next packets of information transmit status.2. overtime for receiving that ACK confirms, resends this packets of information.
6. handshaking information bag, status information bag and clock synchronization information bag-online information bag:
These packets of information all are the packet of data length less than 7 bytes, can transmit to finish in a CAN2.0B protocol data frame, and the data packets that transmission and reception mechanism and other are general is identical.Use identical Info_ID, its value is 14.These three kinds of packets of information all belong to online handshaking information bag.Each node is according to the needs of self character and system, and other nodes on bus regularly send three kinds, two kinds or a kind of in these three kinds of packets of information.Following table is the concrete implication of these three kinds of contents of packet:
The packets of information classification Packets of information character Contents of packet Remarks
DATA1 DATA2 DATA3 DATA4 DATA5 DATA6 DATA7 DATA8
The title content X0 00 Year Month Day The time Divide Second Length is 8, forms clock sync signal by a Frame
Byte length
1 1 1 1 1 1 1 1
The title content X0 01 Length is 2, forms handshake by a Frame
Byte length
1 1
The title content X0 02 Isolation General interlock Sound interlock far away Manual interlock State of alarm Malfunction Length is 8, forms status signal by a Frame
Byte length
1 1 1 1 1 1 1 1
As seen from the above table, all DATA1 byte datas are X0, represent that online packets of information is by a CAN2.The 0B Frame is formed.DATA2 represents the character of online packets of information, and expands more eurypalynous online information bag according to the needs of system.
7. node failure detects:
CAN2.0B agreement regulation, CAN controller are responsible for detecting the transmission of each Frame and are received mistake.And any node that detects mistake can mark this message and damage, and this message can lose efficacy and will begin automatically to retransfer, and the numerical value of error counter will increase simultaneously.When error counter is increased to certain numerical value, alarm to the master microprocessor reporting errors.These mechanism have guaranteed the accurate transmission of CAN message.But the CAN agreement is used coding (11 or 29) sign to the data message, there is not the node address notion, if a node breaks down (contacting bad) as power down, bifurcated bus, other nodes might not know that this node breaks down, in fire protection rule, stipulate, must show this node failure at other nodes (main frame).Therefore, must use more perfect node failure testing mechanism.
This agreement adopts following rule detection node failure: each node on the bus regularly sends online signal (three kinds of online signals of front) to associated node with it when it is idle, each node all has one group of node that interrelates with it at thread count.Each counter is provided with initial value when powering on and recovering, when receiving the packet of certain node, certain node counts device value adds 1, until a maximal value (by the time range and the interval determination of detection failure).Periodically (such as 500 milliseconds) subtract 1 to the online Counter Value of each node simultaneously, when the value of counter reduces to 0, quote this node communication failure.The time interval that sends online signal is less than the periodically time interval of down counter.Like this, each node can know that certain node breaks down and shows.
8. buffer zone weighs trigger mechanism:
For the packets of information that sends (overtime repeating transmission) failure, sending node is opened up a new buffer zone and is preserved these packets of information, as long as this node is in the transmission idle condition, this node will attempt retransmitting these packets of information.Like this, for the node that those re-power or other reasons temporarily can not receive,, still can receive these packets of information in case be in normal condition.The big I of buffer zone is provided with according to system's needs.
In Fig. 3, listed the fire alarm system network structure signal of forming by two CAN buses.On the CAN bus of alarm host machine networking, every main frame is by CAN driver 82C250, CAN controller MCP2510 on the mainboard and central processing unit S3C44B0X and other main frames exchange mutual information.On drive circuit plate CAN bus, the drive circuit plate is by CAN driver 82C250, CAN controller SJA1000 and microprocessor 8051 interactive information.When the drive circuit plate detects a fire alarm generation, will the detector physical address of this fire alarm and the fire alarm type sends this drive circuit plate to by the form of fire alarm packets of information 1 alarm host machine take place, alarm host machine is compiled more information then, be assembled into the form of fire alarm packets of information 2, transmit to other main frames.After every main frame on the network was received fire alarm information, the calculation process that links in conjunction with the interlock enabled state, provided action command to corresponding module.
Fig. 4 and Fig. 5 are respectively the fire alarm data structure of transmitting between fire alarm data structure (fire alarm packets of information 1) that the drive circuit plate reports and the alarm host machine (fire alarm packets of information 2).As seen from the figure, the fire alarm data message length that the drive circuit plate reports is 4 bytes, less than 7 bytes, this fire alarm data message can be in the Frame of a CAN agreement end of transmission, fire alarm data length between the main frame is 70 bytes, could end of transmission according to 10 CAN protocol data frames of application-layer data transmission method the foregoing description needs of the present invention.
Fig. 1 and Fig. 2 are respectively sending node and send data packets and the main schematic flow sheet of receiving node receiving data information bag.When the drive circuit plate is reported a fire on main frame, the fire alarm packing data need be become the form of fire alarm packets of information 1: 29 frame identifier is by INFO_ID, SRC_ADDR, and DEST_ADDR, INFO_ORDER forms.The length of this CAN protocol data frame (DLC) is set to 5, and the numerical value of DATA1 is xxxx0000, and wherein xxxx represents the timestamp of packets of information, and scope is from the 0-15 value, and sending node is every successfully to send a packets of information, and the numerical value of xxxx will add 1; The classification of 0000 expression packets of information, the data length of representing this packets of information is less than 7.The fire alarm data of 4 bytes are included among subsequently the DATA2-DATA5.DATA1-DATA5 is effective content of CAN Frame data, so length (DLC) is set to 5.The form of the fire alarm packets of information 2 between the main frame is: 29 frame identifier and fire alarm packets of information 1 constitutes basic identical owing to need a plurality of CAN protocol data frames of transmission, in the scope of INFO_ORDER from the 0-9 value.The numerical value of DATA1 need be arranged to xxxx0001 because the fire alarm data content that is transmitted is 70 bytes greater than 7 bytes.When the numerical value of INFO_ORDER was 0, CAN protocol data frame length (DLC) was 2, and the numerical value of DATA2 is 70, the length of expression fire alarm packets of information 2.When the numerical value of INFO_ORDER during from 1-8, CAN protocol data frame length (DLC) is 8, and the numerical value of DATA1-DATA8 is filled by the fire alarm data between the main frame successively.When the numerical value of INFO_ORDER was 9, remaining fire alarm data were 6 bytes, were the last frame data of this packets of information, and the Frame length (DLC) of CAN agreement is 6, and 6 remaining byte fire alarm data are filled into DATA1-DATA6.
Sending node sends to receiving node according to transmission flow with data packets, and receiving node is according to receiving flow process receiving data information bag.The heavy trigger mechanism of the ACK acknowledgement mechanism of receiving node, transmission timeout mechanism and buffer zone will guarantee that data send accurately and reliably.

Claims (9)

1, a kind of fire alarm application-layer data transmission method based on CAN2.0B is characterized in that, comprises the steps:
A, calculate the length of this self-defined information bag or whole file,, make up the Information Level packet according to maximum length, the maximum data length that allows length, this transmission of Information Level packet of allowing of Frame; According to the data length of this transmission, when length is not more than 8 bytes, be the single frames send mode; Otherwise be the multiframe send mode; With described send mode information architecture in the information packet classification of first Information Level packet;
B, make up identifier, the 29bit of Frame ID identifier is divided at least four zones, be respectively packet type territory, transmission source address territory, receive destination address domain, packet data frame number territory;
C, judge described send mode information, determine the send mode of this packet; The Frame that is not more than 8 bytes with each is a unit, sends the Information Level packet according to the reception destination address domain in the above-mentioned identifier to its destination address that provides;
After D, receiving node receive complete packets of information, at the appointed time in, send response signal according to the transmission source address territory in the identifier to transmission source address, confirm that data receive, this sends successfully, enters next packets of information transmit status.
2, transmission method according to claim 1, it is characterized in that, the step of described single frames send mode: the packets of information classification of judging first Information Level packet, when this value shows that this is sent as the single frames data packets, indicate the Information Level packet that time information packet stamp, User Defined data are arranged at least to its destination address that provides transmission according to the reception destination address domain in the above-mentioned identifier.
3, transmission method according to claim 1, it is characterized in that, the step of described multiframe send mode is: judge the packets of information classification of first Information Level packet, when this value shows that current data packet needs multiframe to send, then further judge information such as current information packet length; Number of information layers is sent according to pack subframe, subpackage.
4, transmission method according to claim 3, it is characterized in that: when the length of whole file allowed length greater than an Information Level packet is maximum, also indicating in packet data frame number domain identifier is zero first Information Level packet had whole data file length information and current information bag Bale No. information; During transmission whole file is divided into a plurality of Information Level packets, each packet is divided into the multiframe data frame transfer.
5, according to each described transmission method among the claim 1-4, it is characterized in that: also comprise overtime retransmission mechanism, when the affirmation that promptly at the appointed time interior sending node end receives the receiving node transmission receives information, sending node starts repeating transmission automatically, receive the affirmation reception information that receiving node sends until sending node, or the repeating transmission number of times has reached predetermined maximum number of retransmissions.
6, transmission method according to claim 5, it is characterized in that, described retransmission mechanism also comprises the method for judging duplicate packages: receiving node is judged the packet type territory and the timestamp of the packets of information sign that sending node sends, when the two and paid-in certain information in package bag type field, timestamp are identical respectively, think that then this information that receives is duplicate packages, abandon this duplicate packages.
7, according to each described transmission method among the claim 1-4, it is characterized in that, also comprise the node failure testing mechanism: each node regularly sends online signal to associated node with it on the bus when it is idle, and each node all has one group of node that interrelates with it at thread count; Each counter is provided with initial value when powering on and recovering, when receiving the online signal data bag of certain node, counter is carried out a forward operation, until certain predetermined value; Periodically counter is carried out once opposite with aforementioned positive computing direction reverse computing simultaneously, when the value of counter is 0, then quote this node communication failure.
8, transmission method according to claim 7, it is characterized in that: send the time interval of the time interval of online signal less than the periodicity down counter, described counter is provided with the non-zero initial value when powering on and recovering, when described node counts device is received the online signal data bag of certain node, carry out a forward operation and add 1, until a predetermined maximum value.Periodically each node is carried out once oppositely computing at thread count simultaneously and subtract 1, when the value of counter reduces to 0, quote this node communication failure.
9, transmission method according to claim 5, it is characterized in that, also comprise the heavy trigger mechanism of buffer zone: for the packets of information that in described overtime retransmission mechanism, sends failure, sending node is opened up a new buffer zone and is preserved these packets of information, when this node was in the transmission idle condition, this node attempted retransmitting these packets of information.
CNB2004100264294A 2004-03-04 2004-03-04 Fire alarm application layer data transmission method based on CAN2.0B Expired - Lifetime CN1333376C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB2004100264294A CN1333376C (en) 2004-03-04 2004-03-04 Fire alarm application layer data transmission method based on CAN2.0B

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB2004100264294A CN1333376C (en) 2004-03-04 2004-03-04 Fire alarm application layer data transmission method based on CAN2.0B

Publications (2)

Publication Number Publication Date
CN1560806A CN1560806A (en) 2005-01-05
CN1333376C true CN1333376C (en) 2007-08-22

Family

ID=34441211

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB2004100264294A Expired - Lifetime CN1333376C (en) 2004-03-04 2004-03-04 Fire alarm application layer data transmission method based on CAN2.0B

Country Status (1)

Country Link
CN (1) CN1333376C (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101778028A (en) * 2009-01-12 2010-07-14 上海华魏自动化设备有限公司 Automatic recovery device of partial bus node
CN101808132A (en) * 2010-03-23 2010-08-18 武汉若比特机器人有限公司 Communication method of application layer in CAN bus system
CN101819710B (en) * 2010-03-30 2011-12-21 西安盛赛尔电子有限公司 Two-way serial communication protocol based communication method for fire alarm system
CN103368915A (en) * 2012-04-03 2013-10-23 朱正兴 CAN bus based communication method
CN102724082A (en) * 2012-05-22 2012-10-10 奇瑞汽车股份有限公司 CAN communication monitoring method based on LabView
CN103701675A (en) * 2013-12-18 2014-04-02 中联重科股份有限公司 Information transmission method, system, reading equipment, source equipment and engineering machine
CN104333517A (en) * 2014-09-28 2015-02-04 航天科工深圳(集团)有限公司 Automation equipment communication method based on CAN bus
CN104524730A (en) * 2015-01-09 2015-04-22 广州市泰昌实业有限公司 Data information transmission method and device for fire extinguishing system
CN104836636B (en) * 2015-02-17 2019-02-26 华为技术有限公司 The method, apparatus and system communicated based on novel CAN frame
CN104780086A (en) * 2015-05-08 2015-07-15 中国电子科技集团公司第四十七研究所 CAN bus communication method and system for environment monitoring
CN106292403A (en) * 2015-06-01 2017-01-04 南京普爱医疗设备股份有限公司 A kind of CAN communication agreement of controlling system of medical equipments
CN106846748A (en) * 2017-03-07 2017-06-13 上海伟梦物联网科技有限公司 A kind of fire information is classified processing system and hierarchical processing method
CN109379264B (en) * 2018-10-16 2021-07-06 西北铁道电子股份有限公司 Multi-board card communication equipment, method and system based on CAN2.0
CN110601944A (en) * 2019-09-19 2019-12-20 成都埃克思智创科技有限公司 CAN protocol communication method applied to Internet of things
CN111654523A (en) * 2020-04-28 2020-09-11 珠海格力电器股份有限公司 Data processing method and device, storage medium and server
CN112383844A (en) * 2020-11-10 2021-02-19 珠海华瑞诚科技有限公司 Interactive communication method of power grid monitoring data, computer device and readable storage medium
CN113079074A (en) * 2021-03-25 2021-07-06 成都纵横自动化技术股份有限公司 Protocol stack communication method, device and storage medium based on CAN bus
CN114374575A (en) * 2021-09-13 2022-04-19 中国航空工业集团公司沈阳飞机设计研究所 Airborne distributed node CAN bus network architecture data transmission method
CN113765938B (en) * 2021-09-24 2023-06-06 天津津航计算技术研究所 CAN2.0B protocol-based application layer protocol implementation method

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
CAN总线和基于CAN总线的高层协议 王桂荣,计算机测量与控制,第11卷第5期 2003 *
CAN总线和基于CAN总线的高层协议 王桂荣,计算机测量与控制,第11卷第5期 2003;CAN总线应用在火灾报警系统中的性能分析 姚键欣,微计算机信息,第17卷第1期 2001;分布式控制系统的CAN总线通信网络 杨源,国外建材料技,第23卷第2期 2003;基于CAN总线的船舶火灾报警系统的设计 吴恒,青岛大学学报,第17卷第1期 2004;基于CAN总线的智能火灾报警系统的设计与实现 刘辉,工业控制计算机,第14卷第6期 2001 *
CAN总线应用在火灾报警系统中的性能分析 姚键欣,微计算机信息,第17卷第1期 2001 *
分布式控制系统的CAN总线通信网络 杨源,国外建材料技,第23卷第2期 2003 *
基于CAN总线的智能火灾报警系统的设计与实现 刘辉,工业控制计算机,第14卷第6期 2001 *
基于CAN总线的船舶火灾报警系统的设计 吴恒,青岛大学学报,第17卷第1期 2004 *

Also Published As

Publication number Publication date
CN1560806A (en) 2005-01-05

Similar Documents

Publication Publication Date Title
CN1333376C (en) Fire alarm application layer data transmission method based on CAN2.0B
CN101262401B (en) A method for realizing network recovery in loop network
CN102664719B (en) Distributed secure transmission method applied to distributed control system (DCS)
CN105120439B (en) Beidou long message communication means
CN100414466C (en) Multi-event sequential recording and testing system
CN103490966B (en) A kind of dual-redundant CAN bus method for receiving and processing data
CN106776436B (en) A kind of communication means of the high-speed serial bus suitable for multiple spot interconnection
CN102984042B (en) Deterministic scheduling method and system for realizing bus communication
CN102984059A (en) Gigabit Ethernet redundant network card and link switching condition determination result control method thereof
CN103023715A (en) Fault monitoring method based on RS485 bus communication link
CN102332971B (en) Field-bus full duplex reliable communication method for numerical control system
CN109932966B (en) Real-time efficient data transmission method based on M-LVDS bus
JP3268456B2 (en) Communication control device and information transmission method
CN103442035A (en) Method for achieving dual-network hot standby redundancy of blank pipe automatic system
CN102970157A (en) Link failure processing method, intelligent resilient framework (IRF) member device and data communication device
CN100574224C (en) The detection method of Industrial Ethernet data monitoring and device
CN105183687A (en) Time-sharing serial communication method and system
CA1191919A (en) Communications network access rights arbitration
CN102368711B (en) Communication system facing parallel file system
CN206470580U (en) safety programmable logic controller communication system
CN104486047B (en) Self-aided terminal monitoring method, device and system
CN102843265B (en) Not resetting without the hot standby dual link method of perturbation of a kind of communication protocol
CN210670118U (en) Gun cabinet control management system based on CAN communication protocol
CN101924662A (en) Alarm transmission method
CN104168313B (en) One kind remote control underwater work system communication network and its dispatching method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C56 Change in the name or address of the patentee
CP01 Change in the name or title of a patent holder

Address after: Shenzhen City, Guangdong province Nanyou 518054 first industrial zone 111

Patentee after: SHENZHEN FANHAI SANJIANG ELECTRONICS Co.,Ltd.

Address before: Shenzhen City, Guangdong province Nanyou 518054 first industrial zone 111

Patentee before: SHENZHEN FANHAI SANJIANG ELECTRONICS Co.,Ltd.

CP03 Change of name, title or address

Address after: 518000 the three floor of the new world apartment, Nanshan Avenue, Nanshan District, Shenzhen, Guangdong (for office only).

Patentee after: Shenzhen hi tech investment Sanjiang Electronics Co.,Ltd.

Address before: Shenzhen City, Guangdong province Nanyou 518054 first industrial zone 111

Patentee before: SHENZHEN FANHAI SANJIANG ELECTRONICS Co.,Ltd.

CP03 Change of name, title or address
CX01 Expiry of patent term

Granted publication date: 20070822

CX01 Expiry of patent term