CN106330640A - Data cross transmission method based on CAN bus - Google Patents

Data cross transmission method based on CAN bus Download PDF

Info

Publication number
CN106330640A
CN106330640A CN201610681430.3A CN201610681430A CN106330640A CN 106330640 A CN106330640 A CN 106330640A CN 201610681430 A CN201610681430 A CN 201610681430A CN 106330640 A CN106330640 A CN 106330640A
Authority
CN
China
Prior art keywords
data
mailbox
node
frame
bus
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.)
Pending
Application number
CN201610681430.3A
Other languages
Chinese (zh)
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.)
Xian Flight Automatic Control Research Institute of AVIC
Original Assignee
Xian Flight Automatic Control Research Institute of AVIC
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 Xian Flight Automatic Control Research Institute of AVIC filed Critical Xian Flight Automatic Control Research Institute of AVIC
Priority to CN201610681430.3A priority Critical patent/CN106330640A/en
Publication of CN106330640A publication Critical patent/CN106330640A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40169Flexible bus arrangements

Abstract

The invention belongs to a data cross transmission technology in a multi-redundancy system, and specifically relates to a data cross transmission method based on a CAN bus. The invention provides a multi-redundancy data cross transmission method based on a CAN bus communication technology. Data transmission between multiple redundancies is realized through a CAN bus. Bus load is saved. Data sending and receiving is made simpler. The deficiency of the existing point-to-point transmission is solved by making use of the advantages of broadcast communication. The purposes of high flexibility, low cost, and simple hardware and software processing are achieved.

Description

A kind of data cross transmission method based on CAN
Technical field
The invention belongs to the data cross transmission technology in multiplicated system, be specifically related to a kind of number based on CAN According to Cross transfer method.
Background technology
In multiplicated system, each remaining needs to be counted alternately with other remainings by Cross transfer technology cycle According to so that each remaining can obtain the data of other remainings, the most just can carry out periodically monitoring and the table of system margin Certainly.Need software, hardware for the corresponding data transmission method of Demand Design of multiplicated system to complete the friendship of data for this Fork transmission.
Existing Cross transfer technology uses point-to-point host-host protocol, and each remaining needs and transmission to be interacted Other remainings individually communicate.Assuming that current remaining quantity is n, the corresponding quantity needing point-to-point transmission bus is k;So when When remaining quantity becomes n+1, the corresponding quantity needing point-to-point transmission bus is k+n;So become n+2 when remaining quantity Time, the corresponding quantity needing point-to-point transmission bus is k+n+n+1.
As depicted in figs. 1 and 2, in 3 redundant systems, each remaining needs (to be comprised by 2 point-to-point transmission buses and connect Receive and sending function) communicate with two other remainings respectively, 3 remainings need to design 3 point-to-point biographies the most altogether Defeated bus;In 4 redundant systems, each remaining needs to be entered with two other remainings respectively by 3 point-to-point transmission buses Row communication, 4 remainings need to design 6 point-to-point transfer bus the most altogether.
Existing point-to-point transmission technology has the following disadvantages and defect.
1, very flexible, is required for the quantitative design corresponding hardware transport bus of redundant system, just has several remaining Need the transfer bus of design customization respective numbers;
2, cost is high, and when remaining increasing number, corresponding cost of hardware design can be multiplied;
3, transmitting-receiving processes complexity, needs to receive the data of other remainings from each bus, and the process adding software is born Load.
Controller Area Network BUS (CAN, Controller Area Network) is a kind of serial for application in real time Communications protocol bus, the characteristic of CAN protocol includes the serial data communication of integrity, provides real-time support, transfer rate up to 1Mb/s, has error detecing capability simultaneously, is widely applied in fields such as car industry, aircraft industry, Industry Control, security protections. Node in CAN network regardless of principal and subordinate, any node all can the most on one's own initiative on network other nodes send information, Communication mode is flexible, it is possible to achieve the several ways such as point-to-point, point to multi--point and overall situation broadcast transmit and receive data, it is not necessary to specially The scheduling of door.
Summary of the invention
It is an object of the invention to realize redundance data cross transmission method based on CAN communication technology, utilize wide The advantage broadcasting formula communication solves the problem that existing point-to-point transmission brings, and reaches motility height, low cost, software and hardware process simply Purpose.
Technical scheme is as shown in Figure 3.Each remaining is connected in CAN, due to CAN as a node Bus is broadcast type bus, and each node can receive the data that other nodes send from CAN, and this node is sent out in bus The data sent can be received by other arbitrary nodes, utilizes the strobe utility of CAN, each node only can be arranged as required to Receive the message needed.Each CAN controller provides a number of message mailbox for messaging, can be by Postbox installment is that reception state is to receive the Frame that other nodes send, it is also possible to ID and the data of related data frame are inserted Data are sent by CAN controller from trend bus after mailbox.Owing to being broadcast type bus, when carrying out data and sending, Require to ensure the uniqueness of Frame ID, i.e. each communication node can not send the data of identical ID, each
The data that each node is sent, only need in bus transmission primaries, other all nodes can be made to complete Acquisition to these data, the number of times that the information that greatly reduces is mutual, reduce the load of system.
Using the technical program can reduce the design complexities of hardware, each remaining is only used as a CAN node and connects In CAN system, it is not necessary to individually carry out point-to-point connection with other remainings again, remaining quantity can flexible expansion, as needed Increase remaining, only need to newly-increased remaining be accessed in CAN system, soft as a CAN node at hardware view Part aspect only need to be planned again needs mutual data.Owing to the Frame of CAN itself contains CRC check function, can Fully ensuring that the integrity of data, software, without verifying data, decreases the process of process again.
Accompanying drawing explanation
Fig. 1 is the embodiment of 3 remaining Point-to-Point Data Cross transfer technology;
Fig. 2 is the embodiment of 4 remaining Point-to-Point Data Cross transfer technology;
Fig. 3 is the embodiment of redundance data cross transmission technology based on CAN;
Detailed description of the invention
3 the invention will be further described below in conjunction with the accompanying drawings.Detailed description of the invention is shown in following steps.
Step 1: each CAN node is connected composition CAN communication system;Each CAN node only need to be by CAN_H-height electricity Gentle CAN_L-low level is connected respectively to the high level of CAN and communicates with carrying out realization in low level;
Step 2: analyze the data interaction amount of system, due to message mailbox capacity limit, according to the size of transmission data volume, May need that data are split to multiple ID to send, the corresponding mailbox of each ID, the data therefore sent by each node Plan and split, be allocated by Frame, determine No. ID and the interior data sent of corresponding mailbox of each Frame Form, plan each mailbox be as send or receive capabilities uses;
Step 3: initialize the CAN controller of each node, the traffic rate of bus is set;
Step 4: initial message mailbox, arranges and sends the Frame ID that mailbox is corresponding, and data to be sent in mailbox are temporary Not inserting, arranging simultaneously and receiving the ID of mailbox is corresponding No. ID of Frame needing other remainings received to send, and will connect Receiving postbox installment is reception state;
Step 5: after entering periodic task, each node sends the number of this node according to the planning in step 1 to bus According to, each node is sent to the Frame of CAN and can automatically determine priority according to frame ID and be automatically performed transmission;According to The strobe utility of CAN, when, after the Frame receiving bus, query messages mailbox understood by CAN controller, confirms this data Frame is the Frame that this node needs, and places data in the message mailbox of correspondence, otherwise can filter out this Frame;Pass through Whether the Frame receiving mailbox inquiry other nodes transmission to be received arrives, if had arrived at, reads number in mailbox According to, and data are carried out reverse operating according to step 1, i.e. carry out data merging;
Step 6: the state of inquire-receive mailbox successively, completes to receive data from other nodes;Shape in each node Become remaining data, not only contain the data of self in each node, also contains the data from other nodes;Can enter subsequently Enter monitoring and the voting process of remaining data.
Embodiment
The CAN data cross transmission of 3 redundant systems is described below in detail as a example by MPC5644A processor development board. MPC5644A processor is the SOC(system on a chip) of a kind of high integration, further comprises abundant peripheral hardware, Qi Zhongyou in addition to CPU core 3 independent CAN controllers (CAN_A, CAN_B, CAN_C), each CAN controller provides 64 message mailbox For communicating, each message mailbox can transmit the data of 8 bytes, and the present embodiment uses front 60 mailboxes, last 4 mailboxes Retain.MPC5644A processor development board (hereinafter referred to as development board) has devised relevant CAN driver, only needs 3 CAN_A controller on individual development board can simulate the CAN communication of 3 redundant systems.
The CAN_A driver of the MPC5644A processor in each remaining (hereinafter also referred to as node) is performed both by following Step.
Step 1): the high level of CAN_A on 3 development boards, low level are connected respectively to together, form CAN communication System.
Step 2): communicating planning, in the case of 3 remainings transmission data volumes are identical, each remaining at most can profit It is used for sending the data of self with 20 mailboxes, utilizes 40 mailboxes for receiving the data that two other remaining sends respectively. Under this method of salary distribution, each remaining at most can disposably transmit the data of 160 bytes.
Bus ID is planned: the CAN data ID that remaining 1 sends is 0x0101 to 0x0114, totally 20 different ID;Remaining The CAN data ID of degree 2 transmission is 0x0201 to 0x0214, totally 20 different ID;The CAN data that remaining 3 sends ID is 0x0301 to 0x0314, totally 20 different ID.
Mailbox 1 to mailbox 20 is set and uses for sending data, according to above bus ID planning, be respectively provided with transmission mailbox ID, the ID receiving mailbox is set simultaneously, is used for receiving the data of other two remainings, detailed functions distribution and ID arrange and see below Table:
Step 3): initializing the CAN controller of each node, the traffic rate arranging bus is 1Mb/s.
Step 4): and corresponding mailbox is set according to the planning of step 2, No. ID of the mailbox needing transmission is set, simultaneously The mailbox that setting is to be received is in reception state.
Step 5): after entering periodic task, first send the data of front 20 mailboxes in own node, then inquire about postal Whether the data in case 21 to mailbox 60 have arrived at, if had arrived at, read data in mailbox.
Step 6): it is sequentially completed and receives data from other nodes, in each node, form remaining data, the most each Not only contain the data of self in node, also contains the data from other nodes.Next remaining data can be entered Monitoring and voting process.
The present invention can also have other various embodiments, without departing from the spirit and substance of the case in the present invention, is familiar with this The technical staff in field is when making various corresponding change and deformation according to the present invention, but these change accordingly and deform all The protection domain of appended claims of the invention should be belonged to.

Claims (1)

1. a data cross transmission method based on CAN, it is characterised in that comprise the following steps:
Step 1: each CAN node is connected composition CAN communication system;Each CAN node only need to by CAN_H-high level and CAN_L-low level is connected respectively to the high level of CAN and communicates with carrying out realization in low level;
Step 2: analyze the data interaction amount of system, due to message mailbox capacity limit, according to the size of transmission data volume, may Need that data are split to multiple ID to send, the corresponding mailbox of each ID, therefore the data that each node sends are carried out Planning and fractionation, be allocated by Frame, determines No. ID and the lattice of the interior data sent of corresponding mailbox of each Frame Formula, plans that each mailbox is as transmission or receive capabilities uses;
Step 3: initialize the CAN controller of each node, the traffic rate of bus is set;
Step 4: initial message mailbox, arranges and sends the Frame ID that mailbox is corresponding, and data to be sent in mailbox wouldn't be filled out Entering, arranging simultaneously and receiving the ID of mailbox is corresponding No. ID of Frame needing other remainings received to send, and will receive postal Case is set to reception state;
Step 5: after entering periodic task, each node sends the data of this node according to the planning in step 1 to bus, often Individual node is sent to the Frame of CAN and can automatically determine priority according to frame ID and be automatically performed transmission;According to CAN Strobe utility, when after the Frame receiving bus, CAN controller can query messages mailbox, confirm that this Frame is this The Frame that node needs, and place data in the message mailbox of correspondence, otherwise can filter out this Frame;By receiving postal Whether the Frame that other nodes that case inquiry is to be received send arrives, if had arrived at, reads data in mailbox, and Data are carried out reverse operating according to step 1, i.e. carries out data merging;
Step 6: the state of inquire-receive mailbox successively, completes to receive data from other nodes;Formed remaining in each node Degrees of data, not only contains the data of self, also contains the data from other nodes in each node;Can enter remaining subsequently The monitoring of degrees of data and voting process.
CN201610681430.3A 2016-08-17 2016-08-17 Data cross transmission method based on CAN bus Pending CN106330640A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610681430.3A CN106330640A (en) 2016-08-17 2016-08-17 Data cross transmission method based on CAN bus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610681430.3A CN106330640A (en) 2016-08-17 2016-08-17 Data cross transmission method based on CAN bus

Publications (1)

Publication Number Publication Date
CN106330640A true CN106330640A (en) 2017-01-11

Family

ID=57744003

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610681430.3A Pending CN106330640A (en) 2016-08-17 2016-08-17 Data cross transmission method based on CAN bus

Country Status (1)

Country Link
CN (1) CN106330640A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981431A (en) * 2019-03-15 2019-07-05 西安微电子技术研究所 A kind of CAN controller data storage circuitry and date storage method
CN111650915A (en) * 2019-10-14 2020-09-11 摩登汽车有限公司 CAN bus control method and device, vehicle control unit, storage medium and vehicle
CN114979058A (en) * 2022-06-30 2022-08-30 东风电驱动系统有限公司 CAN multi-mailbox multiplexing processing method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003061210A1 (en) * 2002-01-11 2003-07-24 Motorola, Inc. Dynamic can bus system configuration and messaging
CN101482753A (en) * 2009-02-11 2009-07-15 北京华力创通科技股份有限公司 Real-time simulation apparatus and system of redundancy flight control computer
CN202870586U (en) * 2012-09-27 2013-04-10 中国船舶重工集团公司第七一九研究所 Single CAN controller hot-redundancy CAN bus system
CN103490966A (en) * 2013-10-10 2014-01-01 北京航天发射技术研究所 Dual-redundancy CAN bus data receiving and processing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2003061210A1 (en) * 2002-01-11 2003-07-24 Motorola, Inc. Dynamic can bus system configuration and messaging
CN101482753A (en) * 2009-02-11 2009-07-15 北京华力创通科技股份有限公司 Real-time simulation apparatus and system of redundancy flight control computer
CN202870586U (en) * 2012-09-27 2013-04-10 中国船舶重工集团公司第七一九研究所 Single CAN controller hot-redundancy CAN bus system
CN103490966A (en) * 2013-10-10 2014-01-01 北京航天发射技术研究所 Dual-redundancy CAN bus data receiving and processing method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
吴建军,郑国辉,张小林: "中小型无人飞行器二余度CAN总线网络设计", 《计算机测量与控制》 *
王琴: "飞行控制计算机余度管理与总线通信技术研究", 《中国优秀硕士学位论文全文数据库(电子期刊)·工程科技Ⅱ辑》 *
靳红涛,焦宗夏,王少萍,韩鹏霄: "高可靠三余度数字式作动器控制器设计与实现", 《北京航空航天大学学报》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109981431A (en) * 2019-03-15 2019-07-05 西安微电子技术研究所 A kind of CAN controller data storage circuitry and date storage method
CN109981431B (en) * 2019-03-15 2021-09-14 西安微电子技术研究所 CAN bus controller data storage circuit and data storage method
CN111650915A (en) * 2019-10-14 2020-09-11 摩登汽车有限公司 CAN bus control method and device, vehicle control unit, storage medium and vehicle
CN114979058A (en) * 2022-06-30 2022-08-30 东风电驱动系统有限公司 CAN multi-mailbox multiplexing processing method and system
CN114979058B (en) * 2022-06-30 2023-10-03 东风电驱动系统有限公司 CAN multi-mailbox multiplexing processing method and system

Similar Documents

Publication Publication Date Title
CN101852472B (en) Automatic addressing method for air conditioning system and air conditioning controller
CN111147619B (en) Method and system for realizing automatic address allocation of RS485 slave equipment locally
CN104253880B (en) Address distribution to Field bus safety user
CN101977094B (en) Satellite-borne controller area network (CAN) bus communication method applied to multi-master communication
CN104345717A (en) Intelligent remote data acquisition system based on Internet of Things
CN101111807A (en) Control system having a plurality of spatially distributed stations, and method for transmitting data in such a control system
CN104811357B (en) A kind of Internet of things system
CN106330640A (en) Data cross transmission method based on CAN bus
CN103248526A (en) Communication equipment and method for achieving out-of-band monitoring and management, and master-slave switching method
CN107819659B (en) Intelligent cascade communication network based on SPI
CN107249048A (en) Air-conditioning system and its address distribution method and device
CN109510744A (en) Internet of Things device intelligence cut-in method and device
CN105684460A (en) System for connecting smart devices in a building
CN101132364A (en) Data addressing and repeating method and system in control network
CN107205059A (en) Manage method, acquisition terminal and the meter equipment of meter device address
CN107396445A (en) A kind of information reporting dispatching method, system, host device and slave devices
CN104063350B (en) Satellite-borne CAN (controller area network) bus plug and play method
CN114374604A (en) Intelligent home configuration method in offline mode, storage medium and system
CN104484257B (en) A kind of general 1553B bus communication emulation test system and method
CN103744365A (en) Bridging module for communication between room control terminal and upper computer and method thereof
CN108833218A (en) The network system and its method for building up of multi-variable air conditioning unit
CN105245424B (en) The method that PROFIBUS DP and PROFINET communication network are interconnected by shared memory
CN107270484A (en) Air-conditioning system and its data query answer method and device
CN108076680A (en) Bus system, the member stations of bus system and the method for being directed to dynamic communication configuration static bus system
CN208241667U (en) Multi-line system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170111