CN104836636A - Method, device and system for communication based on novel CAN frame - Google Patents

Method, device and system for communication based on novel CAN frame Download PDF

Info

Publication number
CN104836636A
CN104836636A CN201510086524.1A CN201510086524A CN104836636A CN 104836636 A CN104836636 A CN 104836636A CN 201510086524 A CN201510086524 A CN 201510086524A CN 104836636 A CN104836636 A CN 104836636A
Authority
CN
China
Prior art keywords
node
frame
bus
bus mode
frame format
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.)
Granted
Application number
CN201510086524.1A
Other languages
Chinese (zh)
Other versions
CN104836636B (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.)
Fudan University
Huawei Technologies Co Ltd
Original Assignee
Fudan University
Huawei Technologies 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 Fudan University, Huawei Technologies Co Ltd filed Critical Fudan University
Priority to CN201510086524.1A priority Critical patent/CN104836636B/en
Publication of CN104836636A publication Critical patent/CN104836636A/en
Priority to PCT/CN2016/073765 priority patent/WO2016131404A1/en
Application granted granted Critical
Publication of CN104836636B publication Critical patent/CN104836636B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • 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/403Bus networks with centralised control, e.g. polling

Abstract

An embodiment of the invention provides a method, a device and a system for communication based on a novel CAN frame. In the embodiment, through expanding the data domain of an original CAN 2.0 frame, more data can be transmitted. Furthermore, fixed values are added into some fixed positions in the data domain and verification domain of a new frame, so that CAN 2.0 equipment can sample the fixed values and finish correctness verification, thereby preventing errors and realizing compatibility with existing CAN 2.0 equipment.

Description

The method, the Apparatus and system that communicate is carried out based on novel CAN frame
Technical field
The embodiment of the present invention relates to the communication technology, particularly relates to the data communication method in a kind of bus, Apparatus and system.
Background technology
(Controller Area Network, is called for short: CAN) be standardized serial communication bus agreement, and (Physical layer is called for short: PHY) speed is 1Mbps/s its highest physical layer in controller local area network.(CAN with Flexible Data rate is called for short: CAN-FD) by the bus communication speed to speed more than the lifting implementation 1Mbps/s of the PHY of CAN the CAN of Flexible Data Rate.
But when CAN-FD node and existing CAN 2.0 node co-operation, CAN 2.0 node there will be data stuffing mistake, cyclic redundancy check (CRC) code (Cyclic Redundancy Check when processing the data of CAN-FD node, be called for short: CRC) check errors, cause CAN 2.0 node interrupts current C AN communication, therefore, CAN-FD can not be compatible with existing CAN mode.
Summary of the invention
The embodiment of the present invention provides data communication method, Apparatus and system in a kind of bus, to realize node compatible existing bus mode while the speed promoting PHY of the first bus mode, solve when two kinds of bus modes coexist and there will be data stuffing mistake, CRC check mistake, cause the problem of CAN 2.0 node interrupts current C AN communication.
First aspect, the embodiment of the present invention provides the data communication method in a kind of bus, and described method is applicable to the controller local area network CAN comprising the node of at least one the first bus mode and the node of at least one the second bus mode, and described method comprises:
Node is according to the bus mode presetting bus frame determination data communication, the frame format of described default bus frame comprises the first frame format and the second frame format, described first frame format is corresponding with described first bus mode, described second frame format is corresponding with described second bus mode, described default bus frame comprises identify label, has a predetermined number bit for identifying described frame format in described identify label;
Described node adopts the frame format corresponding with the bus mode of the described data communication determined to carry out communication.
In conjunction with first aspect, in the first possible implementation of first aspect, described node is host node;
Described node, according to the bus mode presetting bus frame determination data communication, comprising:
Described node, when default poll time arrives, determines the bus mode of described data communication according to described default bus frame;
Described node adopts the frame format corresponding with the bus mode of described data communication to carry out communication, comprising:
Described node, when described default poll time does not arrive, adopts the frame format corresponding with the bus mode of described data communication to carry out communication.
In conjunction with the first possible implementation of first aspect, in the implementation that the second of first aspect is possible, described node is the node of described first bus mode;
Described node, when default poll time arrives, is determined the bus mode of described data communication, being comprised according to described default bus frame:
Described node, when described default poll time arrives, adopts the described default bus frame of described first frame format to carry out poll to every other node;
Described node receives first information response, and described first information response is described first frame format;
Described node obtains the described identify label of the node sending the response of the described first information according to described first information response, and the node of described for described transmission first information response is defined as the node of described first bus mode, determine to adopt the node of described first bus mode and described first bus mode to carry out communication;
Described node, when described default poll time arrives, adopts the described default bus frame of described second frame format to carry out poll to other nodes except the described node being defined as described first bus mode;
Described node receives the second information answer, and described second information answer is described second frame format;
Described node obtains the described identify label of the node sending described second information answer according to described second information answer, and the node of described for described transmission the second information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.
In conjunction with the implementation that the second of first aspect is possible, in the third possible implementation of first aspect, described node, when described default poll time does not arrive, adopts the frame format corresponding with the bus mode of described data communication to carry out communication, comprising:
Described node, when described default poll time does not arrive, carries out communication by described first frame format with the node of described first bus mode and described first bus mode; And/or,
Described node, when described default poll time does not arrive, carries out communication by described second frame format with the node of described second bus mode and described second bus mode.
In conjunction with the first possible implementation of first aspect, in the 4th kind of possible implementation of first aspect, described node is the node of described second bus mode;
Described node, when default poll time arrives, is determined the bus mode of described data communication, being comprised according to described default bus frame:
Described node, when described default poll time arrives, adopts the described default bus frame of described second frame format to carry out poll to every other node;
Described node receives the 3rd information answer, and described 3rd information answer is described second frame format;
Described node obtains the described identify label of the node sending described 3rd information answer according to described 3rd information answer, and the node of described for described transmission the 3rd information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.
In conjunction with the 4th kind of possible implementation of first aspect, in the 5th kind of possible implementation of first aspect, described node, when described default poll time does not arrive, adopts the frame format corresponding with the bus mode of described data communication to carry out communication, comprising:
Described node, when described default poll time does not arrive, carries out communication by described second frame format with the node of described second bus mode and described second bus mode.
In conjunction with the first of first aspect to any one possible implementation in the 5th kind, in the 6th kind of possible implementation of first aspect, described node, according to before the bus mode presetting bus frame determination data communication, also comprises:
Described node starts polling tasks, and the cycle judges whether described default poll time arrives.
In conjunction with first aspect, in the 7th kind of possible implementation of first aspect, described node is from node;
Described node, according to the bus mode presetting bus frame determination data communication, comprising:
Described node initiatively initiates carrying out shake communication to host node, determines the bus mode of described data communication according to described default bus frame.
In conjunction with the 7th kind of possible implementation of first aspect, in the 8th kind of possible implementation of first aspect, described node is the node of described first bus mode;
Described node initiatively initiates carrying out shake communication to host node, determines the bus mode of described data communication, comprising according to described default bus frame:
Described node sends the described default bus frame of described first frame format to described host node;
Described node receives the 4th information answer that described host node sends, and described 4th information answer is described first frame format;
Described node determines that described host node is the node of described first bus mode, and adopts described first bus mode and described host node to carry out communication.
In conjunction with the 7th kind of possible implementation of first aspect, in the 9th kind of possible implementation of first aspect, described node is the node of described first bus mode;
Described node initiatively initiates carrying out shake communication to host node, determines the bus mode of described data communication, comprising according to described default bus frame:
Described node sends the described default bus frame of described first frame format to described host node;
Described node does not also receive described 4th information answer that described host node sends after default time-out, then described node determines that described host node is the node of described second bus mode, and sends the described default bus frame of described second frame format to described host node;
Described node receives the 5th information answer that described host node sends, and described 5th information answer is described second frame format;
Described node is determined to adopt described second bus mode and described host node to carry out communication.
In conjunction with the 7th kind of possible implementation of first aspect, in the tenth kind of possible implementation of first aspect, described node is the node of described second bus mode;
Described node initiatively initiates carrying out shake communication to host node, determines the bus mode of described data communication, comprising according to described default bus frame:
Described node sends the described default bus frame of described second frame format to described host node;
Described node receives the 6th information answer that described host node sends, and described 6th information answer is described second frame format, and described host node comprises the node of described first bus mode and the node of described second bus mode;
Described node is determined to adopt described second bus mode and described host node to carry out communication.
Second aspect, the embodiment of the present invention provides a kind of controller local area network CAN node, namely carry out the CAN equipment communicated based on novel CAN frame, described CAN comprises the node of at least one the first bus mode and the node of at least one the second bus mode, and described node comprises:
Determination module, for the bus mode according to default bus frame determination data communication, the frame format of described default bus frame comprises the first frame format and the second frame format, described first frame format is corresponding with described first bus mode, described second frame format is corresponding with described second bus mode, described default bus frame comprises identify label, has a predetermined number bit for identifying described frame format in described identify label;
Communication module, carries out communication for adopting the frame format corresponding with the bus mode of the described data communication determined.
In conjunction with second aspect, in the first possible implementation of second aspect, described node is host node;
Described determination module, specifically for when default poll time arrives, determines the bus mode of described data communication according to described default bus frame;
Described communication module, specifically for when described default poll time does not arrive, adopts the frame format corresponding with the bus mode of described data communication to carry out communication.
In conjunction with the first possible implementation of second aspect, in the implementation that the second of second aspect is possible, described node is the node of described first bus mode;
Described determination module, specifically for when described default poll time arrives, adopts the described default bus frame of described first frame format to carry out poll to every other node; The reception first information is replied, and described first information response is described first frame format; The described identify label of the node sending the response of the described first information is obtained according to described first information response, and the node of described for described transmission first information response is defined as the node of described first bus mode, determine to adopt the node of described first bus mode and described first bus mode to carry out communication; When described default poll time arrives, the described default bus frame of described second frame format is adopted to carry out poll to other nodes except the described node being defined as described first bus mode; Receive the second information answer, described second information answer is described second frame format; The described identify label of the node sending described second information answer is obtained according to described second information answer, and the node of described for described transmission the second information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.
In conjunction with the implementation that the second of second aspect is possible, in the third possible implementation of second aspect, described communication module, specifically for when described default poll time does not arrive, carry out communication by described first frame format with the node of described first bus mode and described first bus mode; And/or, when described default poll time does not arrive, carry out communication by described second frame format with the node of described second bus mode and described second bus mode.
In conjunction with the first possible implementation of second aspect, in the 4th kind of possible implementation of second aspect, described node is the node of described second bus mode;
Described determination module, specifically for when described default poll time arrives, adopts the described default bus frame of described second frame format to carry out poll to every other node; Receive the 3rd information answer, described 3rd information answer is described second frame format; The described identify label of the node sending described 3rd information answer is obtained according to described 3rd information answer, and the node of described for described transmission the 3rd information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.
In conjunction with the 4th kind of possible implementation of second aspect, in the 5th kind of possible implementation of second aspect, described communication module, specifically for when described default poll time does not arrive, carry out communication by described second frame format with the node of described second bus mode and described second bus mode.
In conjunction with the first of second aspect to any one possible implementation in the 5th kind, in the 6th kind of possible implementation of second aspect, also comprise:
Judge module, for starting polling tasks, and the cycle judge whether described default poll time arrives.
In conjunction with second aspect, in the 7th kind of possible implementation of second aspect, described node is from node;
Described determination module, specifically for initiatively initiating carrying out shake communication to host node, determines the bus mode of described data communication according to described default bus frame.
In conjunction with the 7th kind of possible implementation of second aspect, in the 8th kind of possible implementation of second aspect, described node is the node of described first bus mode;
Described determination module, specifically for sending the described default bus frame of described first frame format to described host node; Receive the 4th information answer that described host node sends, and described 4th information answer is described first frame format; Determine that described host node is the node of described first bus mode, and adopt described first bus mode and described host node to carry out communication.
In conjunction with the 7th kind of possible implementation of second aspect, in the 9th kind of possible implementation of second aspect, described node is the node of described first bus mode;
Described determination module, specifically for sending the described default bus frame of described first frame format to described host node; After default time-out, also do not receive described 4th information answer that described host node sends, then described node determines that described host node is the node of described second bus mode, and sends the described default bus frame of described second frame format to described host node; Receive the 5th information answer that described host node sends, and described 5th information answer is described second frame format; Determine to adopt described second bus mode and described host node to carry out communication.
In conjunction with the 7th kind of possible implementation of second aspect, in the tenth kind of possible implementation of second aspect, described node is the node of described second bus mode;
Described determination module, specifically for sending the described default bus frame of described second frame format to described host node; Receive the 6th information answer that described host node sends, and described 6th information answer is described second frame format, described host node comprises the node of described first bus mode and the node of described second bus mode; Determine to adopt described second bus mode and described host node to carry out communication.
The third aspect, the embodiment of the present invention provides a kind of controller local area network CAN system, it is characterized in that, comprise: the node of at least one the first bus mode and the node of at least one the second bus mode, wherein, the node of described first bus mode adopts second aspect, the first of second aspect is to the third, node in 6th kind to the 9th kind described in any one possible implementation, the node of described second bus mode adopts second aspect, the first of second aspect, 4th kind to the 7th kind, any one node described in possible implementation in tenth kind.
Data communication method in embodiment of the present invention bus, Apparatus and system, the node in CAN is made to determine to carry out the bus mode of communication by default bus frame, realize node compatible existing bus mode while promoting transmission rate of the first bus mode, solve when two kinds of bus modes coexist and there will be data stuffing mistake, CRC check mistake, cause the problem of CAN 2.0 node interrupts current C AN communication.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the structural representation of an embodiment of CAN system of the present invention;
Figure 1A is the bus frame format schematic diagram in the embodiment of the present invention;
Fig. 2 is the flow chart of an embodiment of data communication method in bus of the present invention;
Fig. 3 is the flow chart of another embodiment of data communication method in bus of the present invention;
Fig. 4 is the flow chart of another embodiment of data communication method in bus of the present invention;
Fig. 5 is the flow chart of the 4th embodiment of data communication method in bus of the present invention;
Fig. 6 is the flow chart of the 5th embodiment of data communication method in bus of the present invention;
Fig. 7 is the flow chart of the 6th embodiment of data communication method in bus of the present invention;
Fig. 8 is the structural representation of an embodiment of CAN node of the present invention;
Fig. 9 is the structural representation of another embodiment of CAN node of the present invention;
Figure 10 is the structural representation of another embodiment of CAN system of the present invention;
Figure 11 is the structural representation of an embodiment of the node of the present invention first bus mode;
Figure 12 is the structural representation of another embodiment of the node of the present invention first bus mode.
Embodiment
For making the object of the embodiment of the present invention, technical scheme and advantage clearly, below in conjunction with the accompanying drawing in the embodiment of the present invention, technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
In order to the following embodiment of more convenient understanding, first CAN protocol is carried out some here and simply introduce.Through development for many years, the CAN protocol of existing industry indication and the CAN protocol of indication of the present invention all refer to CAN 2.0 agreement (hereinafter referred to as " CAN 2.0 "), CAN 2.0 comprises two technical specifications, CAN 2.0A and CAN 2.0B respectively, wherein, CAN 2.0A provides the form of standard, uses 11 ID; CAN 2.0B expands on reference format, uses 29 ID.Because both are except having some little difference in formal definition, all the other process are basically identical, therefore, for convenience of description, strictly do not distinguish CAN 2.0A and CAN 2.0B in the following embodiment of the present invention, and the unified CAN 2.0 that uses are described.For some concrete illustrating, acquiescence is all for CAN 2.0B, and those skilled in the art can realize based on CAN 2.0A when not paying creative work.
To be specifically described the present invention program by each embodiment below.
Embodiment one
The embodiment of the invention discloses a kind of method of carrying out communicating based on novel CAN frame, the method is applied to CAN network as shown in Figure 1, this CAN network comprise one or more traditional CAN 2.0 node (as node 3, node 4) and the present embodiment one or more novel CAN (CAN-HW) node that provides, as node 1, node 2).Each node is linked together by printing board PCB cabling or cable, realizes bus communication.CAN differential lines build-out resistor set-up mode shown in figure is identical with prior art, repeats no more here.
Communication in CAN network carries out based on CAN frame, in the embodiment of the present invention, novel CAN-HW node can use new CAN frame and other CAN-HW nodes to carry out communicating faster than existing CAN 2.0 speed, simultaneously, the CAN-FD mentioned in background technology can be avoided again in the various mistakes with output during CAN 2.0 node co-operation, realize realizing compatibility with existing CAN 2.0.
Concrete, a kind of method of carrying out communicating based on novel CAN frame of the embodiment of the present invention comprises the steps:
S11, generation novel CAN frame;
Wherein, novel CAN frame generates based on the frame format of CAN 2.0 frame.Here " based on " refer to that all the other can carry out see the frame format of existing CAN 2.0 protocol definition except the content (definition as some territory) revised that the present embodiment is hereafter described.
See Figure 1A, it is the form schematic diagram of the present embodiment CAN 2.0 frame and novel CAN frame (CAN-HW) frame.Wherein, novel CAN frame comprises new types of data territory and novel verification territory (the CRC territory namely in figure), and new types of data territory and novel verification territory obtain after modifying to the described data field based on CAN 2.0 frame and verification territory.
Concrete, new types of data territory comprises user data subdomain and fixed data subdomain, wherein:
The effect of user data subdomain is the same with the data field in existing CAN 2.0, be all for transmitting real user data, but in the present embodiment, the figure place of user data subdomain is greater than the figure place of the data field in CAN 2.0 frame; In another embodiment, the figure place of user data subdomain can approximate the integral multiple of existing CAN 2.0 maximum data position number.Such as, suppose existing CAN 2.0 frame maximum support 8 byte totally 64 bit data, so the figure place of user data subdomain can be 128 (16 bytes) or 512 (64 byte), or 1024 (128 bytes) etc.Here do not require strictly equal in " approximating " expression reality, can be more less slightly than integral multiple, few part is used to the subdomain of fixed data subdomain or other needs expansions.
Fixed data subdomain comprises the multiple first fixing hyte, each first fixing hyte comprises the first identical fixed bit of one or more continuous print value (0 or 1), the multiple first fixing hyte be arranged on one by one multiple can by the position sampled during CAN 2.0 equipment (as the node 3 in Fig. 1, node 4) sampling CAN 2.0 data field based on CAN 2.0 agreement; Preferably, the figure place of the data bits certificate that the first quantity of fixing hyte will be sampled with CAN 2.0 equipment is the same, such as, supposes that the data field in CAN 2.0 frame has 64 bit data, so in novel CAN frame, correspondingly arranges 64 group first and fix hyte.It should be noted that, prefix " first " in " first fixing hyte " in the present embodiment only for distinguish follow-up mention for the fixing hyte in other places (as verification territory), there is no other particular meanings, in like manner, the prefix also implication like representation class of follow-up " second ", " the 3rd " mentioned and so on.
In the present embodiment, " CAN 2.0 equipment based on CAN 2.0 agreement " refers to the existing various equipment that can process CAN 2.0 agreement, as the node 3 in Fig. 1, node 4, these CAN 2.0 equipment are not familiar with the frame format of novel CAN frame, corresponding to these equipment, what no matter in fact receive is the novel CAN frame that novel CAN equipment (as node 1) sends, or CAN 2.0 frame that CAN 2.0 equipment sends, all processes according to the mode of process CAN 2.0 protocol frame.In the present embodiment, due to position when each first fixing hyte is arranged on multiple CAN 2.0 equipment sampling CAN 2.0 data field one by one, the i.e. sampling instant of corresponding CAN 2.0 equipment of each first fixing hyte, after CAN 2.0 equipment receives novel CAN frame, if go sampling according to the mode of CAN 2.0 device definition, what so sample is exactly that each first value of fixing hyte (is defined as the value of any in this group, the value of one or more first fixed bits comprised due to the first fixing hyte is all identical, therefore, the value of this first fixing hyte can be represented) with " value of any ".
Introduce the number of the position how the first fixing hyte is set and the fixed bit comprised below, the first fixing hyte can be sampled by CAN 2.0 equipment.Concrete, existing CAN 2.0 equipment, when sampling, can allow it sample with certain characteristic frequency by configuration, and, which relative instant can also be configured in and sample.Such as, see Figure 1A, can configure allow CAN 2.0 equipment its carry out sending and sampling with the frequency of 1MHz, and, 2/3 place of the signal waveform of sampling instant corresponding to this data bit, in this case, suppose that the data field in network in CAN 2.0 frame is 64, the figure place in new types of data territory is original 8 times after expansion, each data bit be equivalent in original CAN 2.0 frame is split into 8 parts in same time, and like this, in CAN 2.0 equipment, 1us transmits data, after splitting, novel CAN equipment will accomplish that 1us transmits 8 data.Owing to sampling at 2/3 place, as calculated, 2/3 of 1us approximates 0.667us, namely corresponds to the 6th, then can arrange fixed bit (being set to fixed value 0 as shown in Figure 1A) at the 6th.If the figure place of novel CAN 2.0 frame to original data field is expanded more, now, be equivalent to that each data bit in original CAN 2.0 frame is split in same time gets more (such as splitting into 32 times), now, cannot accurately in the sampling of 2/3 place in order to prevent CAN 2.0 equipment clock from not accurately causing, then can increase some figure places again near 2/3, like this, even if CAN's morning 2.0 samples some time, or late sampling some time can sample the value of fixed bit.
Modify similar with above-mentioned to the data field in CAN 2.0 frame, the present embodiment also carries out similar amendment to the verification territory (or also claiming CRC territory) in CAN 2.0 frame.Novel verification territory figure place after amendment in novel CAN frame is greater than the figure place in the verification territory in CAN 2.0 frame, novel verification territory comprises user data verification subdomain and fixed data verification subdomain, wherein, the value of user data verification subdomain is the first check value after verifying user data subdomain; Fixed data verification subdomain is verify to the value of each the first fixing hyte the second check value obtained, fixed data verification subdomain comprises the multiple second fixing hyte, each second fixing hyte comprises the second identical fixed bit of one or more continuous print value, and the value (i.e. any one fixing place value in group) of each the second fixing hyte forms above-mentioned second check value; Multiple second fixing hyte is arranged on multiple position of sampling when can be verified territory by CAN 2.0 equipment sampling CAN 2.0 one by one, and concrete method to set up, with similar to the method to set up of the first fixing hyte in new types of data territory, repeats no more here.
S12, send described novel CAN frame, wherein, described new types of data territory and described novel verification territory send with the most high transmission rate higher than CAN 2.0 protocol definition.
Because the present embodiment is expanded the data field in CAN 2.0 frame and verification territory, adding figure place, in order to realize high-speed transfer, these territories extended being sent with higher frequency.Such as, if expand to 8 times, then also can by frequency upgrading to 8 times, if expand to 16 times, accordingly, frequency also can rise to 16 times.Certainly, also accurately can rise to 8 times or 16 times in reality, as long as the data bits of expansion can be sent, so other transmission frequency are also fine.
For other data fields, if do not expanded, then the transmission rate still specified by CAN 2.0 agreement sends.In specific implementation, novel CAN 2.0 equipment is equivalent to need two registers to control transmission rate, a register is used for control and extends figure place, need the transmitting-receiving frequency in the territory promoting transmitting-receiving frequency, another register is the same with existing CAN 2.0 speed control register, for controlling the transmitting-receiving speed in the territory of not modifying.
After novel CAN frame is sent to CAN network, other novel CAN equipment due to this frame can be identified, therefore, can correctly receive, and, owing to having extended the figure place of the data field of CAN 2.0 frame when sending, and strengthen frequency to send, therefore, increase transmission rate.Simultaneously, existing CAN 2.0 equipment is after receiving this frame, can still sample by original sample mode, due to the present embodiment CAN 2.0 sampled data territory and verification territory position be all fixed value, like this, CAN 2.0 samples the value of fixed data subdomain, and after carrying out verify calculation, its value must be consistent with the second check value that the fixed data sampled verifies indicated by subdomain, like this, would not check errors be there is, thus achieve the compatibility with CAN 2.0 equipment.
Embodiment two
Based on embodiment one, the present embodiment carries out further description to this programme.
Owing to there being two kinds of CAN frames (CAN equipment) in the networking shown in Fig. 1, in order to distinguish this two kinds of frames, in the present embodiment, novel CAN frame can also comprise: the type instruction subdomain being used to indicate CAN frame type, for being shown to be CAN 2.0 frame, or new types of frame.
Index of classification subdomain can be realized by reserved place in arbitration territory, such as, utilizes reserved two, 00 represents CAN 2.0 frame, and 11 represent new types of frame, certainly, in this case, CAN 2.0 software also needs to judge these reserved places, is which kind of frame format with what judge to receive.
Index of classification subdomain also can be realized by least one position in R1, R0 in the control domain in CAN 2.0 frame two, by least one position in these two as described type instruction subdomain.
Owing to now not expanding the figure place in these territories, therefore, the speed transmission that CAN 2.0 defines still is pressed in these territories.
In the present embodiment, novel CAN frame can also comprise: the figure place indication information subdomain being used to indicate the user data subdomain figure place quantity in new types of data territory.
Figure place indication information subdomain can be realized by the mode expanded the data bit in the control domain in CAN2.0, and its principle is similar with the mode in growth data territory, owing to expanding, therefore, follow-uply also needs the transmitting-receiving speed promoting this part.In addition, if by the reserved bit table mark in other territories, so then do not need the transmitting-receiving speed promoting this territory.
In the embodiment of the present invention, also arranging hard heavy synchronous, specifically can arranging between two along becoming corresponding in CAN 2.0 device data territory in the new types of data territory in novel CAN frame.Such as, the data field of novel CAN frame to CAN 2.0 frame extends 8 times, suppose that 8 after to CAN 2.0 frame data territory the 1st Bits Expanding for A1-A8, be B1-B8 to 8 after the Bits Expanding of CAN 2.0 frame data territory the 2nd, then hopping edge can be set between A8 and B1 these two, so corresponding, these two also need to be arranged to fixed value.
Arrange and hard heavy synchronously can to verify frequency, prevent due to frequency departure do not stop cumulative after the sample error that causes.
Embodiment three
Based on the various embodiments described above, the embodiment of the present invention is introduced concrete application scenarios.See Fig. 1, as shown in aforementioned two embodiments, first bus mode is the newly-designed bus mode of the present invention, CAN-HW can be referred to as, second bus mode is existing bus mode, i.e. CAN 2.0, the frame format of the first bus mode and the frame format of the second bus mode can be compatible, namely the former frame format is identical with the frame format of the latter, difference is that the content inserted in frame format is different, therefore the node of the second bus mode can receive the frame of two kinds of bus modes and resolve, frame is distinguished by the bit of the bus type of identification nodes, and the node of the first bus mode also can receive the frame of two kinds of bus modes, and the bus type corresponding according to frame determines the bus mode of carrying out communication.The node of the first bus mode can adopt two kinds of bus modes simultaneously, compatible existing bus protocol again while promoting transmission rate, thus realizes the data communication of two kinds of bus mode hybrid networks.
Fig. 2 is the flow chart of an embodiment of data communication method in bus of the present invention, and as shown in Figure 2, the method for the present embodiment is applicable to the application scenarios shown in Fig. 1, and the method can comprise:
Step 101, node are according to the bus mode presetting bus frame determination data communication;
In the present embodiment, the frame format of described default bus frame comprises the first frame format and the second frame format, described first frame format is corresponding with described first bus mode, described second frame format is corresponding with described second bus mode, described default bus frame comprises identify label, has a predetermined number bit for identifying described frame format in described identify label.Executive agent node can be any one node in Fig. 1.The present invention designs the first frame format: (Acknowledgement, is called for short: ACK) territory and frame end position and the second frame format (CAN 2.0 form) corresponding territory compatibility for the arbitration territory in the first frame format, acknowledge character; Design the reserved bit position in control domain in the first frame format and arbitration territory, make the node of the first bus mode can identification bus type of functionality automatically, and carry out frame format switching; Design the data field in the first frame format and CRC territory, doubly (N can be 1,2,3 the speed of PHY can be promoted to original N ...); When design data territory and CRC territory, adopt the mode of filling bit position, fixed position to guarantee to cause the node of the second bus mode to produce bit mistake, CRC check mistake to the second frame format by mistake, thus cause communicating interrupt.Preset bus frame and have two kinds of forms, corresponding with above-mentioned two kinds of bus modes respectively, the bus mode of its correspondence can be determined by default bus frame node.
Step 102, described node adopt the frame format corresponding with the bus mode of the described data communication determined to carry out communication.
Node is after determining bus mode, this bus mode can be adopted, and carry out communication by frame format corresponding to this bus mode and other nodes, even this node is the node of the first bus mode, then this node can adopt the first bus mode to send the default bus frame of the first frame format to the node of other the first bus modes, and the second bus mode can also be adopted to send the default bus frame of the second frame format to the node of other the second bus modes; If this node is the node of the second bus mode, then this node is only to adopt the second bus mode to send the default bus frame of the second frame format to other nodes, because the node of the first bus mode can carry out communication with two kinds of bus modes, therefore other nodes here can comprise the node of the first bus mode and the node of the second bus mode.
The present embodiment, the node in CAN is made to determine to carry out the bus mode of communication by default bus frame, realize node compatible existing bus mode while the speed promoting PHY of the first bus mode, solve when two kinds of bus modes coexist and there will be data stuffing mistake, CRC check mistake, cause the problem of CAN 2.0 node interrupts current C AN communication.
Further, the node in above-described embodiment is host node, then the implementation method that step 101 is concrete can be: described node, when default poll time arrives, determines the bus mode of described data communication according to described default bus frame; The implementation method that step 102 is concrete can be: described node, when described default poll time does not arrive, adopts the frame format corresponding with the bus mode of described data communication to carry out communication.
Specifically, said process, according to the difference of node, can have two kinds of realization flows.The following detailed description of.
Be that described node is host node and is the node of described first bus mode, described node, when described default poll time arrives, adopts the described default bus frame of described first frame format to carry out poll to every other node; Described node receives first information response, and described first information response is described first frame format; Described node obtains the described identify label of the node sending the response of the described first information according to described first information response, and the node of described for described transmission first information response is defined as the node of described first bus mode, determine to adopt the node of described first bus mode and described first bus mode to carry out communication; Described node, when described default poll time arrives, adopts the described default bus frame of described second frame format to carry out poll to other nodes except the described node being defined as described first bus mode; Described node receives the second information answer, and described second information answer is described second frame format; Described node obtains the described identify label of the node sending described second information answer according to described second information answer, and the node of described for described transmission the second information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.Described node, when described default poll time does not arrive, carries out communication by described first frame format with the node of described first bus mode and described first bus mode; And/or described node, when described default poll time does not arrive, carries out communication by described second frame format with the node of described second bus mode and described second bus mode.
Fig. 3 is the flow chart of another embodiment of data communication method in bus of the present invention, and as shown in Figure 3, the method for the present embodiment is applicable to the application scenarios shown in Fig. 1, and the node 1 of the first bus mode is as host node, and the method can comprise:
S201, node 1 start polling tasks, and the cycle judges whether preset poll time arrives;
When the node of the first bus mode is as host node, adopt other node communication in token mode and CAN.Node 1 starts automatic regular polling addressing function by application layer software, and Starting mode can be electrifying startup or timer timing, and namely node 1 carries out poll to all addresses in CAN in the moment that poll time arrives, and all addresses correspond to all nodes in CAN.
S202, node 1, when default poll time arrives, adopt the default bus frame of the first frame format to carry out poll to node 2 (3,4);
The node that first node 1 adopts the first frame format poll all, is the default bus frame sending the first frame format to node 2 (3,4) in the present embodiment.
S203, node 2 adopt the first frame format to send first information response to node 1;
Node 2 can receive simultaneously and resolve the first frame format and the second frame format, determines the first frame format of receiving according to the bus type bit in default bus frame, and therefore node 2 is automatically set to the first frame format and sends first information response to node 1.
S204, node 3 (4) are not replied the default bus frame of the first frame format that node 1 sends;
Node 3 (4) to receive after the default bus frame of the first frame structure by ID filter function, does not process, can directly abandon this frame, and do not reply this default bus frame the default bus frame of the first frame structure from node 1.
S205, node 1 obtain the ID of the node 2 sending first information response according to first information response, and node 2 are defined as the node of the first bus mode, determine that employing first bus mode and node 2 carry out communication;
On node 1, application software extracts the first information response in CAN, obtain the ID of the node 2 sending first information response, the node that all transmission first information are replied can be classified as the node of the first bus mode by node 1 by the mode of building table, build Table A, be node 2 in the present embodiment, node 1 refreshes new in CAN insertion or deletion of node by the change of Table A.
S206, node 1, when default poll time arrives, adopt the default bus frame of the second frame format to carry out poll to node 3 (4);
Node 1 adopts the node of the second frame format poll except the node in Table A again, is the default bus frame sending the second frame format to node 3 (4) in the present embodiment.
S207, node 3 (4) adopt the second frame format to send the second information answer to node 1;
Node 3 (4) can be resolved the default bus frame of the second frame format, and therefore node 3 (4) adopts the second frame format to send the second information answer to node 1.
S208, node 1 obtain the ID of the node 3 (4) of transmission second information answer according to the second information answer, and node 3 (4) is defined as the node of the second bus mode, determine that employing second bus mode and node 3 (4) carry out communication;
On node 1, application software extracts the second information answer in CAN, obtain the ID of the node 3 (4) of transmission second information answer, the node of all transmission second information answer can be classified as the node of the second bus mode by node 1 equally by the mode of building table, build table B, be node 3 (4) in the present embodiment, node 1 refreshes new in CAN insertion or deletion of node by the change of table B.
S209, node 1, when default poll time does not arrive, carry out communication by the first frame format with the first bus mode and node 2;
On node 1, application layer software judges not start poll, node 1 if with Table A interior joint (node 2) communication, the mode that can initiatively arrange frame format by software adopts the first frame format and node 2 to carry out communication.
S210, node 1, when default poll time does not arrive, carry out communication by the second frame format with the second bus mode and node 3 (4).
On node 1, application layer software judges not start poll, node 1 if with table B interior joint (node 3 (4)) communication, the mode that can initiatively arrange frame format by software adopts the second frame format and node 3 (4) to carry out communication.
Another kind is that described node is host node and is the node of described second bus mode, and described node, when described default poll time arrives, adopts the described default bus frame of described second frame format to carry out poll to every other node; Described node receives the 3rd information answer, and described 3rd information answer is described second frame format; Described node obtains the described identify label of the node sending described 3rd information answer according to described 3rd information answer, and the node of described for described transmission the 3rd information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.Described node, when described default poll time does not arrive, carries out communication by described second frame format with the node of described second bus mode and described second bus mode.
Fig. 4 is the flow chart of another embodiment of data communication method in bus of the present invention, and as shown in Figure 4, the method for the present embodiment is applicable to the application scenarios shown in Fig. 1, and the node 3 of the second bus mode is as host node, and the method can comprise:
S301, node 3 start polling tasks, and the cycle judges whether preset poll time arrives;
When the node of the second bus mode is as host node, adopt other node communication in token mode and CAN.Node 3 starts automatic regular polling addressing function by application layer software, and Starting mode can be electrifying startup or timer timing, and namely node 3 carries out poll to all addresses in CAN in the moment that poll time arrives, and all addresses correspond to all nodes in CAN.
S302, node 3, when default poll time arrives, adopt the default bus frame of the second frame format to carry out poll to node 1 (2,4);
Node 3 is nodes of the second bus mode, only supports the second frame format, and therefore node 3 node that adopts the second frame format poll all, is the default bus frame sending the second frame format to node 1 (2,4) in the present embodiment.
S303, node 1 (2) adopt the second frame format to send the 3rd information answer to node 3;
Node 1 (2) can receive simultaneously and resolve the first frame format and the second frame format, determine the second frame format received according to the bus type bit in default bus frame, therefore node 1 (2) is automatically set to the second frame format and sends the 3rd information answer to node 3.
S304, node 4 adopt the second frame format to send the 3rd information answer to node 3;
Node 4 can only process the second frame format, and determine the second frame format received according to the bus type bit in default bus frame, therefore node 4 is automatically set to the second frame format and sends the 3rd information answer to node 3.
S305, node 3 obtain the ID of the node 1 (2,4) of transmission the 3rd information answer according to the 3rd information answer, and determine that employing second bus mode and node 1 (2,4) carry out communication;
On node 3, application software extracts the 3rd information answer in CAN, obtain the ID of the node 1 (2,4) of transmission the 3rd information answer, the node of all transmissions the 3rd information answer can be classified as the node of the second bus mode by node 3 by the mode of building table, build table C, be node 1 (2,4) in the present embodiment, node 3 refreshes new in CAN insertion or deletion of node by the change of table C.
S306, node 3, when default poll time does not arrive, carry out communication by the second frame format with the second bus mode and node 1 (2,4).
On node 3, application layer software judges not start poll, node 3 and table C interior joint (1 (2,4)) communication, and the mode that can initiatively arrange frame format by software adopts the second frame format and node 1 (2,4) to carry out communication.
Further, the node in above-described embodiment is from node, then the implementation method that step 101 is concrete can be: described node initiatively initiates carrying out shake communication to host node, determines the bus mode of described data communication according to described default bus frame.
Specifically, said process, according to the difference of node, can have three kinds of realization flows.The following detailed description of.
To be described node be from node and be the node of described first bus mode, and described node sends the described default bus frame of described first frame format to described host node; Described node receives the 4th information answer that described host node sends, and described 4th information answer is described first frame format; Described node determines that described host node is the node of described first bus mode, and adopts described first bus mode and described host node to carry out communication.
The node of this situation to be host node be the first bus mode, when the first bus mode initiatively initiate carrying out shake communication from node time, also do not know that host node is the node of what type, therefore the default bus frame of the first frame format can first be sent, if the 4th information answer that have received the first frame format that host node sends from node of the first bus mode, illustrate that host node to parse the default bus frame sent from node, and this node only has the node of the first bus mode just can accomplish, therefore just communication can be carried out with the first bus mode and host node from node.
Fig. 5 is the flow chart of the 4th embodiment of data communication method in bus of the present invention, as shown in Figure 5, the method for the present embodiment is applicable to the application scenarios shown in Fig. 1, and the node 1 of the first bus mode is as from node, the node 2 of the first bus mode is as host node, and the method can comprise:
S401, initiate carrying out shake communication from node 1, send the default bus frame of the first frame format to host node 2;
S402, host node 2 adopt the first frame format to send the 4th information answer to from node 1;
S403, determine that host node 2 is the node of the first bus mode from node 1;
S404, the first bus mode and host node 2 is adopted to carry out communication from node 1.
Preferably, host node 2 according to the type of the recent default bus frame from node 1 received and can carry out communication from node 1.
To be described node be another kind from node and be the node of described first bus mode, and described node sends the described default bus frame of described first frame format to described host node; Described node does not also receive described 4th information answer that described host node sends after default time-out, then described node determines that described host node is the node of described second bus mode, and sends the described default bus frame of described second frame format to described host node; Described node receives the 5th information answer that described host node sends, and described 5th information answer is described second frame format; Described node is determined to adopt described second bus mode and described host node to carry out communication.
The node of this situation to be host node be the second bus mode, when the first bus mode initiatively initiate carrying out shake communication from node time, first send the default bus frame of the first frame format, and after default time-out, the response of host node is not still received from node, illustrate that host node is not replied the default bus frame of the first frame structure sent from node, preferably, timer can be started from node while sending the default bus frame of the first frame format.The node of the second bus mode cannot carry out dissection process to the second frame structure under normal circumstances, therefore can think that host node is the node of the second bus mode from node, the default bus frame of the second frame structure is sent to it, identify this frame according to the bus type bit in its ID after host node receives this default bus frame and send the 5th information answer of the second frame structure, after receive the 5th information answer from node, the second bus mode and host node can be adopted to carry out communication.
Fig. 6 is the flow chart of the 5th embodiment of data communication method in bus of the present invention, as shown in Figure 6, the method for the present embodiment is applicable to the application scenarios shown in Fig. 1, and the node 1 of the first bus mode is as from node, the node 3 of the second bus mode is as host node, and the method can comprise:
S501, initiate carrying out shake communication from node 1, send the default bus frame of the first frame format to host node 3;
S502, host node 3 are not replied the default bus frame of the first frame format sent from node 1;
S503, after default time-out, send the default bus frame of the second frame format again to host node 3 from node 1;
S504, host node 3 adopt the second frame format to send the 5th information answer to from node 1;
S505, determine that host node 3 is the node of the second bus mode from node 1;
S506, the second bus mode and host node 3 is adopted to carry out communication from node 1.
Also have that a kind of to be described node be from node and be the node of described second bus mode, described node sends the described default bus frame of described second frame format to described host node; Described node receives the 6th information answer that described host node sends, and described 6th information answer is described second frame format, and described host node comprises the node of described first bus mode and the node of described second bus mode; Described node is determined to adopt described second bus mode and described host node to carry out communication.
The host node of this situation both can be the node of the first bus mode, also can be the node of the second bus mode, when the second bus mode initiatively initiate carrying out shake communication from node time, the default bus frame of the second frame structure can only be sent, if host node is the node of the first bus mode, after the default bus frame receiving the second frame structure sent from node, the second bus mode can be set to accordingly, return the 6th information answer of the second frame format, if host node is the node of the second bus mode, after the default bus frame receiving the second frame structure sent from node, can identify it and resolve, therefore the 6th information answer of the second frame format can also be returned.The second bus mode and host node is then adopted to carry out communication from node.
Fig. 7 is the flow chart of the 6th embodiment of data communication method in bus of the present invention, as shown in Figure 7, the method for the present embodiment is applicable to the application scenarios shown in Fig. 1, and the node 3 of the second bus mode is as from node, the node 1 of the first bus mode is as host node, and the method can comprise:
S601, initiate carrying out shake communication from node 3, send the default bus frame of the second frame format to host node 1;
S602, host node 1 are arranged to the second frame format and are sent the 6th information answer to from node 3;
S603, determine that host node 1 is the node of the second bus mode from node 3;
S604, the second bus mode and host node 1 is adopted to carry out communication from node 3.
In addition, the node of the second bus mode is host node, is again be prior art from the situation of node, repeats no more herein.
Fig. 8 is the structural representation of an embodiment of CAN node of the present invention, as shown in Figure 8, node in the present embodiment is any node in application scenarios shown in Fig. 1, the node of the present embodiment can comprise: determination module 11 and communication module 12, wherein, determination module 11, for the bus mode according to default bus frame determination data communication, the frame format of described default bus frame comprises the first frame format and the second frame format, described first frame format is corresponding with described first bus mode, described second frame format is corresponding with described second bus mode, described default bus frame comprises identify label, a predetermined number bit is had for identifying described frame format in described identify label, communication module 12, carries out communication for adopting the frame format corresponding with the bus mode of the described data communication determined.
The node of the present embodiment, may be used for the technical scheme performing embodiment of the method shown in Fig. 2, it realizes principle and technique effect is similar, repeats no more herein.
Further, described node is from node; Described determination module 11, specifically for initiatively initiating carrying out shake communication to host node, determines the bus mode of described data communication according to described default bus frame.
Further, described node is the node of described first bus mode; Described determination module 11, specifically for sending the described default bus frame of described first frame format to described host node; Receive the 4th information answer that described host node sends, and described 4th information answer is described first frame format; Determine that described host node is the node of described first bus mode, and adopt described first bus mode and described host node to carry out communication.
Above-mentioned node may be used for the technical scheme performing embodiment of the method shown in Fig. 5, and it realizes principle and technique effect is similar, repeats no more herein.
Further, described node is the node of described first bus mode; Described determination module 11, specifically for sending the described default bus frame of described first frame format to described host node; After default time-out, also do not receive described 4th information answer that described host node sends, then described node determines that described host node is the node of described second bus mode, and sends the described default bus frame of described second frame format to described host node; Receive the 5th information answer that described host node sends, and described 5th information answer is described second frame format; Determine to adopt described second bus mode and described host node to carry out communication.
Above-mentioned node may be used for the technical scheme performing embodiment of the method shown in Fig. 6, and it realizes principle and technique effect is similar, repeats no more herein.
Further, described node is the node of described second bus mode; Described determination module 11, specifically for sending the described default bus frame of described second frame format to described host node; Receive the 6th information answer that described host node sends, and described 6th information answer is described second frame format, described host node comprises the node of described first bus mode and the node of described second bus mode; Determine to adopt described second bus mode and described host node to carry out communication.
Above-mentioned node may be used for the technical scheme performing embodiment of the method shown in Fig. 7, and it realizes principle and technique effect is similar, repeats no more herein.
Fig. 9 is the structural representation of another embodiment of CAN node of the present invention, as shown in Figure 9, node in the present embodiment is any node in application scenarios shown in Fig. 1, the node of the present embodiment is on the basis of node structure shown in Fig. 8, further, can also comprise: judge module 13, for starting polling tasks, and the cycle judge whether described default poll time arrives.
Described node is the node of described first bus mode; Described determination module 11, specifically for when described default poll time arrives, adopts the described default bus frame of described first frame format to carry out poll to every other node; The reception first information is replied, and described first information response is described first frame format; The described identify label of the node sending the response of the described first information is obtained according to described first information response, and the node of described for described transmission first information response is defined as the node of described first bus mode, determine to adopt the node of described first bus mode and described first bus mode to carry out communication; When described default poll time arrives, the described default bus frame of described second frame format is adopted to carry out poll to other nodes except the described node being defined as described first bus mode; Receive the second information answer, described second information answer is described second frame format; The described identify label of the node sending described second information answer is obtained according to described second information answer, and the node of described for described transmission the second information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.Described communication module 12, specifically for when described default poll time does not arrive, carries out communication by described first frame format with the node of described first bus mode and described first bus mode; And/or, when described default poll time does not arrive, carry out communication by described second frame format with the node of described second bus mode and described second bus mode.
Above-mentioned node may be used for the technical scheme performing embodiment of the method shown in Fig. 3, and it realizes principle and technique effect is similar, repeats no more herein.
Described node is the node of described second bus mode; Described determination module 11, specifically for when described default poll time arrives, adopts the described default bus frame of described second frame format to carry out poll to every other node; Receive the 3rd information answer, described 3rd information answer is described second frame format; The described identify label of the node sending described 3rd information answer is obtained according to described 3rd information answer, and the node of described for described transmission the 3rd information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.Described communication module 12, specifically for when described default poll time does not arrive, carries out communication by described second frame format with the node of described second bus mode and described second bus mode.
Above-mentioned node may be used for the technical scheme performing embodiment of the method shown in Fig. 4, and it realizes principle and technique effect is similar, repeats no more herein.
Figure 10 is the structural representation of an embodiment of CAN system of the present invention, as shown in Figure 10, the system of the present embodiment comprises: the node 11,12 of at least one the first bus mode and the node 13,14 of at least one the second bus mode, wherein, the node 11,12 of described first bus mode adopts the structure of Fig. 8 or Fig. 9 shown device embodiment, and it can perform the technical scheme of either method embodiment in Fig. 2 ~ Fig. 7 accordingly, it realizes principle and technique effect is similar, repeats no more herein; The node 13,14 of described second bus mode adopts the structure of Fig. 8 or Fig. 9 shown device embodiment, and it can perform the technical scheme of either method embodiment in Fig. 2 ~ Fig. 7 accordingly, and it realizes principle and technique effect is similar, repeats no more herein.
Figure 11 is the structural representation of an embodiment of the node of the present invention first bus mode, as shown in figure 11, the node 10 of the present embodiment can comprise: controller 11 and CAN driver 12, wherein, controller 11 can be micro-control unit (Micro Control Unit, MCU) or field programmable gate array (Field Programmable Gate Array be called for short:, be called for short: FPGA), for performing the technical scheme of either method embodiment in Fig. 2 ~ Fig. 7, repeat no more herein, CAN driver 12 converts the output of controller 11 signal of CAN differential lines to, export CAN to, or feed back to controller 11 after being changed by the signal that CAN inputs, realize node and the CAN network data exchange of the first bus mode.
Figure 12 is the structural representation of another embodiment of the node of the present invention first bus mode, as shown in figure 12, the controller of the node of the first bus mode hangs over Advanced High-Performance Bus (Advanced High Performance Bus, be called for short: AHB) in bus, and ahb bus is connected with control register, the controller of the node of the first bus mode can comprise: data transmission blocks 11, data reception module 12 and control module 13, wherein, data transmission blocks 11 can also comprise: send cache module 111, for receive and buffer memory from the data that namely will send of AHB, and parallel-serial conversion is carried out to transmission data, protocol selection module 112, sends the frame format of data acquisition according to control register command selection, and encodes to transmission data according to the frame format determined, transmission data after coding are issued CAN driver according to control register order by sending module 113, data reception module 12 can also comprise: Frame identification module 121, for receiving the data that CAN driver sends, and to receiving, data are arbitrated, data frame type identification, result is fed back to control register, whether continues to make control register determination data sending module 11 to send, protocol selection module 122, carries out sampling demodulation according to control register order to the frame format receiving data acquisition corresponding, receive cache module 123, for the reception data after protocol selection module demodulation are carried out serioparallel exchange and buffer memory, and provide ahb bus access function, control module 13, for realizing AHB access control, transmission frame format sends, transmission rate is arranged, receive data mode query function.
One of ordinary skill in the art will appreciate that: all or part of step realizing above-mentioned each embodiment of the method can have been come by the hardware that program command is relevant.Aforesaid program can be stored in a computer read/write memory medium.This program, when performing, performs the step comprising above-mentioned each embodiment of the method; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
Last it is noted that above each embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to foregoing embodiments to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein some or all of technical characteristic; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the scope of various embodiments of the present invention technical scheme.

Claims (20)

1. carry out the method communicated based on novel CAN frame, it is characterized in that, comprising:
Generate novel CAN frame;
Wherein, described novel CAN frame generates based on the frame format of CAN 2.0 frame, described novel CAN frame comprises new types of data territory and novel verification territory, and described new types of data territory and novel verification territory obtain after modifying to the described data field based on CAN 2.0 frame and verification territory;
Described new types of data territory comprises user data subdomain and fixed data subdomain, and the figure place of described user data subdomain is greater than the figure place of the data field in described CAN 2.0 frame; Described fixed data subdomain comprises the multiple first fixing hyte, each described first fixing hyte comprises the first identical fixed bit of one or more continuous print value, the multiple first fixing hyte be arranged on one by one multiple can by the position sampled during CAN 2.0 equipment sampling CAN 2.0 data field based on CAN 2.0 agreement;
Novel verification territory comprises user data verification subdomain and fixed data verification subdomain, and wherein, the value of user data verification subdomain is the first check value after verifying described user data subdomain; Described fixed data verification subdomain is verify to the value of each the first fixing hyte the second check value obtained, wherein, described fixed data verification subdomain comprises the multiple second fixing hyte, each second fixing hyte comprises the second identical fixed bit of one or more continuous print value, and the value of each the second fixing hyte forms above-mentioned second check value; Multiple second fixing hyte is arranged on multiple position of sampling when can be verified territory by CAN 2.0 equipment sampling CAN2.0 one by one;
Send described novel CAN frame, wherein, described new types of data territory and described novel verification territory send with the most high transmission rate higher than described CAN 2.0 protocol definition.
2. the method for claim 1, is characterized in that, described novel CAN frame also comprises:
Be used to indicate the type instruction subdomain of the CAN frame type of transmission.
3. the method as described in as arbitrary in claim 1-2, is characterized in that: index of classification subdomain can be realized by reserved place in arbitration territory; Or realized by least one position in R1, R0 in the control domain in CAN 2.0 frame two.
4. the method as described in as arbitrary in claim 1-3, is characterized in that: described novel CAN frame also comprises: the figure place indication information subdomain being used to indicate the user data subdomain figure place quantity in new types of data territory.
5. method as claimed in claim 4, it is characterized in that: figure place indication information subdomain can be realized by the mode expanded the data bit in the control domain in CAN2.0, when sending described new types of frame, the speed after promoting is adopted to send to the control domain after expansion.
6. the method as described in as arbitrary in claim 1-5, is characterized in that:
The value arranged by register when sending determines the speed sent, and comprises two registers, and one of them is for configuring the rear transmission rate of speed-raising; Another is for configuring the transmission rate based on CAN 2.0.
7. the method as described in as arbitrary in claim 1-6, is characterized in that, also comprise: arrange hard heavy synchronous.
8. method as claimed in claim 7, is characterized in that, arranges hard weight and synchronously comprises: correspond in the new types of data territory in novel CAN frame in CAN 2.0 device data territory and arrange between two along becoming.
9. a controller local area network CAN node, is characterized in that, described CAN comprises the node of at least one the first bus mode and the node of at least one the second bus mode, and described node comprises:
Determination module, for the bus mode according to default bus frame determination data communication, the frame format of described default bus frame comprises the first frame format and the second frame format, described first frame format is corresponding with described first bus mode, described second frame format is corresponding with described second bus mode, described default bus frame comprises identify label, has a predetermined number bit for identifying described frame format in described identify label;
Communication module, carries out communication for adopting the frame format corresponding with the bus mode of the described data communication determined.
10. node according to claim 12, is characterized in that, described node is host node;
Described determination module, specifically for when default poll time arrives, determines the bus mode of described data communication according to described default bus frame;
Described communication module, specifically for when described default poll time does not arrive, adopts the frame format corresponding with the bus mode of described data communication to carry out communication.
11. nodes according to claim 13, is characterized in that, described node is the node of described first bus mode;
Described determination module, specifically for when described default poll time arrives, adopts the described default bus frame of described first frame format to carry out poll to every other node; The reception first information is replied, and described first information response is described first frame format; The described identify label of the node sending the response of the described first information is obtained according to described first information response, and the node of described for described transmission first information response is defined as the node of described first bus mode, determine to adopt the node of described first bus mode and described first bus mode to carry out communication; When described default poll time arrives, the described default bus frame of described second frame format is adopted to carry out poll to other nodes except the described node being defined as described first bus mode; Receive the second information answer, described second information answer is described second frame format; The described identify label of the node sending described second information answer is obtained according to described second information answer, and the node of described for described transmission the second information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.
12. nodes according to claim 14, it is characterized in that, described communication module, specifically for when described default poll time does not arrive, carries out communication by described first frame format with the node of described first bus mode and described first bus mode; And/or, when described default poll time does not arrive, carry out communication by described second frame format with the node of described second bus mode and described second bus mode.
13. nodes according to claim 13, is characterized in that, described node is the node of described second bus mode;
Described determination module, specifically for when described default poll time arrives, adopts the described default bus frame of described second frame format to carry out poll to every other node; Receive the 3rd information answer, described 3rd information answer is described second frame format; The described identify label of the node sending described 3rd information answer is obtained according to described 3rd information answer, and the node of described for described transmission the 3rd information answer is defined as the node of described second bus mode, determine to adopt the node of described second bus mode and described second bus mode to carry out communication.
14. nodes according to claim 16, it is characterized in that, described communication module, specifically for when described default poll time does not arrive, carries out communication by described second frame format with the node of described second bus mode and described second bus mode.
15. nodes according to any one of claim 13 ~ 17, is characterized in that, also comprise:
Judge module, for starting polling tasks, and the cycle judge whether described default poll time arrives.
16. nodes according to claim 12, is characterized in that, described node is from node;
Described determination module, specifically for initiatively initiating carrying out shake communication to host node, determines the bus mode of described data communication according to described default bus frame.
17. nodes according to claim 19, is characterized in that, described node is the node of described first bus mode;
Described determination module, specifically for sending the described default bus frame of described first frame format to described host node; Receive the 4th information answer that described host node sends, and described 4th information answer is described first frame format; Determine that described host node is the node of described first bus mode, and adopt described first bus mode and described host node to carry out communication.
18. nodes according to claim 19, is characterized in that, described node is the node of described first bus mode;
Described determination module, specifically for sending the described default bus frame of described first frame format to described host node; After default time-out, also do not receive described 4th information answer that described host node sends, then described node determines that described host node is the node of described second bus mode, and sends the described default bus frame of described second frame format to described host node; Receive the 5th information answer that described host node sends, and described 5th information answer is described second frame format; Determine to adopt described second bus mode and described host node to carry out communication.
19. nodes according to claim 19, is characterized in that, described node is the node of described second bus mode;
Described determination module, specifically for sending the described default bus frame of described second frame format to described host node; Receive the 6th information answer that described host node sends, and described 6th information answer is described second frame format, described host node comprises the node of described first bus mode and the node of described second bus mode; Determine to adopt described second bus mode and described host node to carry out communication.
20. 1 kinds of controller local area network CAN systems, it is characterized in that, comprise: the node of at least one the first bus mode and the node of at least one the second bus mode, wherein, the node of described first bus mode adopts the node according to any one of claim 12 ~ 15,18 ~ 21, the node employing claim 12 ~ 13 of described second bus mode, the node according to any one of 16 ~ 19,22.
CN201510086524.1A 2015-02-17 2015-02-17 The method, apparatus and system communicated based on novel CAN frame Active CN104836636B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201510086524.1A CN104836636B (en) 2015-02-17 2015-02-17 The method, apparatus and system communicated based on novel CAN frame
PCT/CN2016/073765 WO2016131404A1 (en) 2015-02-17 2016-02-14 New type can frame based communication method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510086524.1A CN104836636B (en) 2015-02-17 2015-02-17 The method, apparatus and system communicated based on novel CAN frame

Publications (2)

Publication Number Publication Date
CN104836636A true CN104836636A (en) 2015-08-12
CN104836636B CN104836636B (en) 2019-02-26

Family

ID=53814297

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510086524.1A Active CN104836636B (en) 2015-02-17 2015-02-17 The method, apparatus and system communicated based on novel CAN frame

Country Status (2)

Country Link
CN (1) CN104836636B (en)
WO (1) WO2016131404A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016131404A1 (en) * 2015-02-17 2016-08-25 华为技术有限公司 New type can frame based communication method, device and system
CN109905306A (en) * 2019-01-30 2019-06-18 北京深蓝同创科技有限公司 A kind of low cost multi-master bus communication control system
CN111935728A (en) * 2020-07-10 2020-11-13 展讯半导体(成都)有限公司 Handshaking method, device, related equipment, storage medium and system
CN111935725A (en) * 2020-07-10 2020-11-13 展讯半导体(成都)有限公司 Communication time sequence planning method, device, related equipment, storage medium and system
CN116667971A (en) * 2023-07-28 2023-08-29 常州星宇车灯股份有限公司 CAN data message sending verification method and device, computer equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560806A (en) * 2004-03-04 2005-01-05 深圳市泛海三江电子有限公司 Fire alarm application layer data transmission method based on CAN2.0B
CN101808132A (en) * 2010-03-23 2010-08-18 武汉若比特机器人有限公司 Communication method of application layer in CAN bus system
KR20110057348A (en) * 2009-11-24 2011-06-01 한국전자통신연구원 Can communication security apparatus and can communication security method
CN104301177A (en) * 2014-10-08 2015-01-21 清华大学 CAN message abnormality detection method and system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104836636B (en) * 2015-02-17 2019-02-26 华为技术有限公司 The method, apparatus and system communicated based on novel CAN frame

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1560806A (en) * 2004-03-04 2005-01-05 深圳市泛海三江电子有限公司 Fire alarm application layer data transmission method based on CAN2.0B
KR20110057348A (en) * 2009-11-24 2011-06-01 한국전자통신연구원 Can communication security apparatus and can communication security method
CN101808132A (en) * 2010-03-23 2010-08-18 武汉若比特机器人有限公司 Communication method of application layer in CAN bus system
CN104301177A (en) * 2014-10-08 2015-01-21 清华大学 CAN message abnormality detection method and system

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2016131404A1 (en) * 2015-02-17 2016-08-25 华为技术有限公司 New type can frame based communication method, device and system
CN109905306A (en) * 2019-01-30 2019-06-18 北京深蓝同创科技有限公司 A kind of low cost multi-master bus communication control system
CN111935728A (en) * 2020-07-10 2020-11-13 展讯半导体(成都)有限公司 Handshaking method, device, related equipment, storage medium and system
CN111935725A (en) * 2020-07-10 2020-11-13 展讯半导体(成都)有限公司 Communication time sequence planning method, device, related equipment, storage medium and system
CN111935725B (en) * 2020-07-10 2023-01-31 展讯半导体(成都)有限公司 Communication time sequence planning method, device, related equipment, storage medium and system
CN116667971A (en) * 2023-07-28 2023-08-29 常州星宇车灯股份有限公司 CAN data message sending verification method and device, computer equipment and storage medium
CN116667971B (en) * 2023-07-28 2023-10-27 常州星宇车灯股份有限公司 CAN data message sending verification method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN104836636B (en) 2019-02-26
WO2016131404A1 (en) 2016-08-25

Similar Documents

Publication Publication Date Title
CN106951388B (en) PCIe-based DMA data transmission method and system
CN104836636A (en) Method, device and system for communication based on novel CAN frame
CN104385787B (en) A kind of control method of laser marking machine and laser marking machine
CN104954096B (en) A kind of high-speed synchronous serial communication data transmission method of one master and multiple slaves
RU2596582C2 (en) Method and device for memory size adapted serial data transfer
CN104113517A (en) Timestamp generation method, device and system
CN106959935B (en) Method compatible with I2C communication and IPMB communication
CN103401726A (en) Network path detecting method, device and system
CN107025203B (en) First board card, second board card and equipment
CN102821082A (en) Data transmission method, device and system
US20170286343A1 (en) Transmitting universal serial bus (usb) data over alternate mode connection
CN103178943A (en) Method, device and system for link adaption
CN104615573A (en) Communication method and device
CN102929828B (en) Support data transmission method and the device of standard and non-standard I 2C interface simultaneously
CN110750478A (en) Multi-serial port communication method and system
KR20160147373A (en) Sata host bus adaptor using light signal and method for connecting sata storage using the same
CN104717109A (en) Simulation testing method and system for wide area network links
CN111371799B (en) Method, device and equipment for controlling data receiving and transmitting of MCTP (Multi-channel media Port) controller
CN104899164B (en) Address addressing method for integrated circuit bus, integrated circuit bus device and system
CN105262655B (en) A kind of communication means with higher rate of compatible CAN2.0 buses
CN109753461B (en) DMA device and data transmission method
CN114567445A (en) Signature verification data transmission method, device, equipment and medium
CN106452838A (en) USB (Universal Serial Bus) equipment simulation device and method
CN113961496A (en) Communication circuit system, method, chip and storage medium
US9658970B1 (en) Interconnection of peripheral devices on different electronic devices

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant