CN111650915A - CAN bus control method and device, vehicle control unit, storage medium and vehicle - Google Patents

CAN bus control method and device, vehicle control unit, storage medium and vehicle Download PDF

Info

Publication number
CN111650915A
CN111650915A CN201910972407.3A CN201910972407A CN111650915A CN 111650915 A CN111650915 A CN 111650915A CN 201910972407 A CN201910972407 A CN 201910972407A CN 111650915 A CN111650915 A CN 111650915A
Authority
CN
China
Prior art keywords
mailbox
target information
node
frame format
bus
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910972407.3A
Other languages
Chinese (zh)
Inventor
王晓辉
李原
孙增光
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Modern Auto Co Ltd
Original Assignee
Modern Auto 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 Modern Auto Co Ltd filed Critical Modern Auto Co Ltd
Priority to CN201910972407.3A priority Critical patent/CN111650915A/en
Publication of CN111650915A publication Critical patent/CN111650915A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B23/00Testing or monitoring of control systems or parts thereof
    • G05B23/02Electric testing or monitoring
    • G05B23/0205Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults
    • G05B23/0208Electric testing or monitoring by means of a monitoring system capable of detecting and responding to faults characterized by the configuration of the monitoring system
    • G05B23/0213Modular or universal configuration of the monitoring system, e.g. monitoring system having modules that may be combined to build monitoring program; monitoring system that can be applied to legacy systems; adaptable monitoring system; using different communication protocols
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24065Real time diagnostics

Abstract

The invention discloses a CAN bus control method, which CAN allocate mailboxes for nodes according to target information when the nodes are positioned on a CAN bus and the target information in a CAN communication message corresponding to the nodes is obtained, and finally, the mailboxes are used for communicating with the nodes, wherein each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency. In addition, the invention also discloses a CAN bus control device, a whole vehicle controller, a storage medium and an automobile.

Description

CAN bus control method and device, vehicle control unit, storage medium and vehicle
Technical Field
The invention relates to the field of automobiles, in particular to a CAN bus control method and device, a whole automobile controller, a storage medium and an automobile.
Background
With the continuous development of automobile technology, hybrid electric vehicles gradually become one of the current mainstream technologies, a large number of electronic control systems are used in the hybrid electric vehicles, and mainly include a finished automobile control system, an engine management system, a battery management system, a motor control system, a braking energy recovery system, a voltage conversion system, an electronic stability control system and the like, and the finished automobile control system and other electronic control systems are communicated with each other.
The communication mode among the electronic control systems is a serial communication protocol (CAN) which is an international standardized serial communication protocol and is widely applied to the fields of automobiles, ships, industrial automation and the like due to high performance and reliability. The CAN bus communication frame types comprise data frames, remote frames, error frames, overload frames and the like, wherein in all the frame types, the data frames and the remote frames are set by a user, and other frames are set by CAN hardware. Among them, the data frame and the remote frame have two formats, i.e., a standard frame format and an extended frame format, and the CAN frame having the identifier of 11 bits is called a standard frame. A CAN frame with a 29 bit identifier is called an extension frame.
Because the frame formats adopted by the electronic control systems in the hybrid electric vehicle are not completely the same due to the complexity of the electronic control systems, when the vehicle control unit communicates with the other electronic control systems, because the vehicle control unit cannot be compatible with the communication frames of the standard frame and the extended frame at the same time, when the CAN network architecture is made, the corresponding CAN buses CAN be respectively distributed only for the electronic control systems (nodes) with the same frame format, since the number of the electronic control system having the standard frame format and the number of the nodes having the extended frame format are not balanced, the load amounts allocated to the two CAN buses are not balanced, therefore, not only the load capacity of the CAN bus with more distributed nodes is increased, but also simultaneously, due to the introduction of a plurality of CAN buses and the unbalanced load distribution on each CAN bus, the communication efficiency of the entire communication network is also low.
Disclosure of Invention
The invention aims to solve the problem of low communication efficiency caused by introduction of a plurality of CAN buses and imbalance of load distributed on the plurality of CAN buses in the prior art. Therefore, the invention provides a CAN bus control method and device, a vehicle controller, a storage medium and a vehicle, which avoid introducing a plurality of CAN buses and solve the problem of low communication efficiency caused by imbalance during load distribution on the plurality of CAN buses.
In order to solve the above problems, an embodiment of the present invention discloses a CAN bus control method, where the CAN bus has a plurality of nodes, including; acquiring target information in the CAN communication message corresponding to each node;
distributing mailboxes for the nodes respectively according to the target information and a predefined rule;
wherein each mailbox supports different frame formats.
By adopting the technical scheme, when each node is positioned on the CAN bus and target information in the CAN communication message corresponding to each node is obtained, the mailbox CAN be allocated to each node according to the target information, and finally, each mailbox is used for communicating with each node, wherein each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
Further, in an embodiment of the present invention, the allocating mailboxes to the nodes according to the target information by using a predefined rule respectively includes:
resolving a first identifier in the target information;
determining a mailbox number bound to the first identifier;
and distributing the configured mailbox corresponding to the mailbox number to the corresponding node.
By adopting the technical scheme, the mailbox numbers are predefined and bound according to the first identifier in the CAN communication message, so that the efficiency of distributing the mailboxes for the corresponding nodes is improved, and the communication efficiency is further improved.
Further, in the embodiment of the present invention, the configuration process of the configured mailbox specifically includes:
configuring a first frame format and transceiving attribute information of the mailbox;
configuring a mailbox corresponding to the first frame format and the transceiving attribute as a mailbox bound to the first identifier.
By adopting the technical scheme, the mailbox can be configured in a targeted manner according to the first frame format and the transceiving attribute, redundant data are filtered, the interference of the redundant data on the configuration of the mailbox is avoided, and the configuration efficiency of the mailbox is improved.
Further, in an embodiment of the present invention, the allocating mailboxes to the nodes according to the target information and predefined rules respectively specifically includes:
resolving a second identifier in the target information;
randomly distributing a mailbox for the node corresponding to the second identifier;
carrying out initialization configuration on the mailbox according to the frame format and the transceiving attribute in the target information;
and determining the mailbox after the initialization configuration as a final mailbox of the node corresponding to the CAN communication message.
By adopting the technical scheme, the mailbox distributed by each node CAN be configured after the CAN communication message is received, so that each mailbox CAN be flexibly initialized and configured, and the communication efficiency is improved.
Further, in an embodiment of the present invention, the initializing and configuring the mailbox according to the frame format and the transceiving attribute in the target information includes:
determining a second frame format and transceiving attribute information of a communication frame of the target information;
and configuring the communication frame format and the transceiving attribute of the mailbox as the second frame format and the transceiving attribute information respectively.
Further, in the embodiment of the present invention, the frame format specifically includes a standard frame format and an extended frame format, and the receiving and sending attribute information includes receiving the CAN communication message and sending the CAN communication message.
The embodiment of the invention discloses a CAN bus control device, wherein a plurality of nodes are arranged on a CAN bus, and the CAN bus control device comprises:
the acquisition module is used for acquiring target information in the CAN communication message corresponding to each node;
and the distribution module is used for distributing mailboxes for the nodes according to the target information by a predefined rule, wherein each mailbox supports different frame formats.
By adopting the technical scheme, when the acquisition module acquires the target information in the CAN communication message corresponding to each node, the distribution module CAN distribute the mailboxes for each node according to the target information, and finally, each mailbox corresponds to a different frame format to communicate with each node. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
Further, in an embodiment of the present invention, the allocation module includes:
the first analysis unit is used for analyzing a first identifier in the target information;
a first determination unit for determining a mailbox number bound to the first identifier;
and the first allocation unit is used for allocating the configured mailbox corresponding to the mailbox number to the corresponding node.
Further, in an embodiment of the present invention, the allocation module includes:
the second analysis unit is used for analyzing a second identifier in the target information;
the second distribution unit is used for distributing the mailbox to the node corresponding to the second identifier at random;
the initialization configuration unit is used for carrying out initialization configuration on the mailbox according to the frame format and the transceiving attribute in the target information;
and the second determining unit is used for determining the mailbox after the initialization configuration as the final mailbox of the node corresponding to the CAN communication message.
Further, in an embodiment of the present invention, the initialization configuration unit includes:
the determining subunit is used for determining the second frame format and the transceiving attribute information of the communication frame of the target information;
and the configuration subunit is used for configuring the communication frame format and the transceiving attribute of the mailbox into second frame format and transceiving attribute information respectively.
The embodiment of the invention discloses a vehicle control unit, which comprises a processor and a memory, wherein the memory is stored with control instructions,
the processor is configured to execute the control instructions stored in the memory to implement the steps in the CAN bus control method according to any one of the above embodiments.
By adopting the technical scheme, when each node is positioned on the CAN bus, and the processor acquires the target information in the CAN communication message corresponding to each node, the processor CAN allocate the mailbox to each node according to the target information, and finally, each mailbox is used for communicating with each node, wherein each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
The embodiment of the invention discloses a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program is executed by a processor to realize the steps of the CAN bus control method.
By adopting the technical scheme, when each node is positioned on the CAN bus, and the processor acquires the target information in the CAN communication message corresponding to each node, the processor CAN allocate the mailbox to each node according to the target information, and finally, each mailbox is used for communicating with each node, wherein each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
The embodiment of the invention discloses an automobile, which comprises the vehicle control unit.
By adopting the technical scheme, the automobile comprises the vehicle control unit, so that the automobile disclosed by the embodiment of the invention has the beneficial effects of any one of the above embodiments.
Additional features and corresponding advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
Fig. 1 is a schematic flow chart of a CAN bus control method disclosed in embodiment 1 of the present invention;
fig. 2 is a schematic structural diagram of a plurality of nodes on a CAN bus disclosed in embodiment 1 of the present invention;
fig. 3 is a schematic diagram illustrating a principle of using mailboxes to transmit and receive messages between nodes on a CAN bus disclosed in this embodiment 1;
fig. 4 is a schematic structural diagram of a CAN bus control device disclosed in embodiment 2 of the present invention;
fig. 5 is a schematic structural diagram of a vehicle control unit disclosed in embodiment 3 of the present invention.
Detailed Description
The following description of the embodiments of the present invention is provided for illustrative purposes, and other advantages and effects of the present invention will become apparent to those skilled in the art from the present disclosure. While the invention will be described in conjunction with the preferred embodiments, it is not intended that features of the invention be limited to these embodiments. On the contrary, the invention is described in connection with the embodiments for the purpose of covering alternatives or modifications that may be extended based on the claims of the present invention. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. The invention may be practiced without these particulars. Moreover, some of the specific details have been left out of the description in order to avoid obscuring or obscuring the focus of the present invention. It should be noted that the embodiments and features of the embodiments may be combined with each other without conflict.
It should be noted that in this specification, like reference numerals and letters refer to like items in the following drawings, and thus, once an item is defined in one drawing, it need not be further defined and explained in subsequent drawings.
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Example 1
Fig. 1 is a schematic flow diagram of a CAN bus control method disclosed in embodiment 1 of the present invention, fig. 2 is a schematic structural diagram of a plurality of nodes on a CAN bus disclosed in embodiment 1 of the present invention, and fig. 3 is a schematic diagram of a principle that a mailbox is used for transmitting and receiving messages between nodes on a CAN bus disclosed in embodiment 1.
In a CAN bus control method disclosed in embodiment 1 of the present invention, a CAN bus includes a plurality of nodes, including:
s10: and acquiring target information in the CAN communication message corresponding to each node.
Specifically, the target information of the CAN communication message may be an identifier (ID number), a frame format of a communication frame in the CAN communication message, and a transmission/reception attribute of the CAN communication message; the type of the frame format of the communication frame in the CAN communication message may be an extension frame and a standard frame, and the transceiving attribute of the CAN communication message may be transmission and reception. In addition, the CAN communication message also includes a message to be transmitted or received.
Further, as shown in fig. 2, a plurality of nodes are all located on the same CAN bus, in the following implementation scheme of this embodiment, the frame formats required to be supported by each Node CAN be respectively satisfied according to the requirements of each Node, for example, the Node a CAN support a standard frame and an extended frame, the Node B CAN support a standard frame, the Node C CAN support an extended frame, and the Node N CAN support a standard frame or an extended frame.
S11: and respectively allocating mailboxes for the nodes according to the target information by a predefined rule, wherein each mailbox corresponds to a different frame format.
Specifically, the predefined rules may be the following three types: the first method is that each mailbox is predefined in advance, then a unique corresponding identifier is set for each mailbox, the transceiving attribute of the mailbox and the frame format of a communication frame are predefined, the mailbox is bound with a corresponding CAN communication message, and after the CAN communication message of a certain node is obtained, the mailbox bound with the CAN communication message is correspondingly distributed according to the identifier of the CAN communication message. Secondly, after the CAN communication message of a certain node is acquired, a mailbox is randomly allocated to the node, then the mailbox is initialized and configured, and finally the mailbox after initialization and configuration is put into use. And thirdly, predefining each mailbox in advance, setting a unique corresponding identifier for each mailbox, correspondingly allocating mailboxes bound with the identifiers of the CAN communication messages after the CAN communication messages of a certain node are obtained, and then carrying out initialization configuration on each mailbox according to the transceiving attributes of each CAN communication message and the frame format of the communication frame.
Based on this, as an alternative embodiment of the present invention, step S11 includes:
the first identifier in the target information is resolved.
A mailbox number bound to the first identifier is determined.
And allocating the configured mailbox corresponding to the mailbox number to the corresponding node.
Further, as an optional embodiment of the present invention, a configuration process of the configured mailbox specifically includes:
configuring a first frame format and transceiving attribute information of the mailbox, and setting the mailbox number of the mailbox corresponding to the first frame format and transceiving attribute as the mailbox number bound with the first identifier.
This alternative embodiment is described below in conjunction with fig. 3:
if the node a serves as a main control chip, n mailboxes are arranged in a CAN module of the main control chip of the node a, the number of n mailboxes CAN be determined according to the type of the main control chip, and if the main control chip is 32 bits, the number of the mailboxes CAN be 256.
The node A and the node B and the node C respectively have a first identifier (ID number) as follows: the CAN communication messages of 0x01, 0x02, 0x03 and 0x04 are communicated with each other, wherein the communication frame formats (first frame formats) of the CAN communication messages with the ID numbers of 0x01 and 0x02 are standard frame formats, and the communication frame formats of the CAN communication messages with the ID numbers of 0x03 and 0x04 are extended frame formats. For the node a, the transmission/reception attribute of the CAN communication message with ID numbers 0x01 and 0x03 is transmission, and the transmission/reception attribute of the CAN communication message with ID numbers 0x02 and 0x04 is reception. For the node B, the transmission/reception attribute of the CAN communication message with the ID number 0x01 is reception, and the transmission/reception attribute of the CAN communication message with the ID number 0x02 is transmission. For node C, the CAN communication message with ID number 0x03 is received, and the CAN communication message with ID number 0x04 is transmitted.
Each mailbox of a CAN module of a node A main control chip is predefined in advance, wherein a mailbox No. 1 is predefined as a sending mailbox, the frame format of a communication frame is a standard frame, a mailbox No. 2 is predefined as a receiving mailbox, the frame format of the communication frame is the standard frame, a mailbox No. 3 is predefined as the sending mailbox, the frame format of the communication frame is an extension frame, and a mailbox No. 4 is predefined as the receiving mailbox, the frame format of the communication frame is the extension frame. Further, the CAN communication message with the ID number of 0x01 is bound with the mailbox No. 1, the CAN communication message with the ID number of 0x02 is bound with the mailbox No. 2, the CAN communication message with the ID number of 0x03 is bound with the mailbox No. 3, and the CAN communication message with the ID number of 0x04 is bound with the mailbox No. 4. And when the mailbox is distributed to each node, the mailbox is correspondingly distributed according to the binding rule.
Further, as an alternative embodiment of the present invention, step S11 includes:
and resolving the second identifier in the target information.
And randomly allocating a mailbox for the node corresponding to the second identifier.
And carrying out initialization configuration on the mailbox according to the frame format and the transceiving attribute in the target information.
And determining the mailbox after the initialization configuration as a final mailbox of the node corresponding to the CAN communication message.
As an optional embodiment of the present application, the initializing configuration of the mailbox according to the frame format and the transceiving attribute in the target information includes:
and determining a second frame format and transceiving attribute information of the communication frame of the target information.
And respectively configuring the communication frame format and the transceiving attribute of the mailbox as second frame format and transceiving attribute information.
Specifically, the node a, the node B, and the node C have second identifiers (ID numbers) respectively: the CAN communication messages of 0x01, 0x02, 0x03 and 0x04 are communicated with each other, wherein the communication frame formats (second frame formats) of the CAN communication messages with the ID numbers of 0x01 and 0x02 are standard frame formats, and the communication frame formats of the CAN communication messages with the ID numbers of 0x03 and 0x04 are extended frame formats. For the node a, the transmission/reception attribute of the CAN communication message with ID numbers 0x01 and 0x03 is transmission, and the transmission/reception attribute of the CAN communication message with ID numbers 0x02 and 0x04 is reception. For the node B, the transmission/reception attribute of the CAN communication message with the ID number 0x01 is reception, and the transmission/reception attribute of the CAN communication message with the ID number 0x02 is transmission. For node C, the CAN communication message with ID number 0x03 is received, and the CAN communication message with ID number 0x04 is transmitted.
After the CAN communication message is received, randomly distributing the mailbox for each node, and then carrying out initialization configuration on the mailbox according to the frame format and the transceiving attribute in the target information.
The method comprises the following steps: a 5-number mailbox is allocated to the CAN communication message with the ID number of 0x01, a 6-number mailbox is allocated to the CAN communication message with the ID number of 0x02, a 7-number mailbox is allocated to the CAN communication message with the ID number of 0x03, and a 4-number mailbox is allocated to the CAN communication message with the ID number of 0x 04. Then, configuring a 5 # mailbox as a sending mailbox, configuring a frame format of a communication frame as a standard frame, configuring a 6 # mailbox as a receiving mailbox, configuring a frame format of a communication frame as a standard frame, configuring a 7 # mailbox as a sending mailbox, configuring a frame format of a communication frame as an extension frame, and configuring a receiving mailbox of an 8 # mailbox and a frame format of a communication frame as an extension frame in a CAN module of a node A main control chip.
And then, determining the mailbox after the initialization configuration as the final mailbox of the node corresponding to the CAN communication message, and communicating with each node.
Further, as an optional embodiment of the present invention, the frame format specifically includes a standard frame format and an extended frame format, and the transmitting and receiving attribute information includes receiving a CAN communication message and transmitting a CAN communication message.
In the CAN bus control method disclosed in embodiment 1 of the present invention, when each node is in a CAN bus and target information in a CAN communication message corresponding to each node is obtained, a mailbox CAN be allocated to each node according to the target information, and finally, each mailbox communicates with each node, where each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
Example 2
A CAN bus control device disclosed in embodiment 2 of the present invention is described below with reference to fig. 4, and fig. 4 is a schematic structural diagram of a CAN bus control device disclosed in embodiment 2 of the present invention.
The CAN bus control device includes:
and the obtaining module 40 is configured to obtain target information in the CAN communication message corresponding to each node.
And the allocating module 41 is configured to allocate mailboxes to the nodes according to the target information by using a predefined rule, where each mailbox supports a different frame format.
Further, as an alternative embodiment of the present invention, the allocating module 41 includes:
the first analysis unit is used for analyzing a first identifier in the target information;
a first determination unit for determining a mailbox number bound to the first identifier;
and the first allocation unit is used for allocating the configured mailbox corresponding to the mailbox number to the corresponding node.
Further, as an alternative embodiment of the present invention, the allocating module 41 includes:
the second analysis unit is used for analyzing a second identifier in the target information;
the second distribution unit is used for distributing the mailbox to the node corresponding to the second identifier at random;
the initialization configuration unit is used for carrying out initialization configuration on the mailbox according to the frame format and the transceiving attribute in the target information;
and the second determining unit is used for determining the mailbox after the initialization configuration as the final mailbox of the node corresponding to the CAN communication message.
Further, as an optional embodiment of the present invention, the initialization configuration unit includes:
the determining subunit is used for determining the second frame format and the transceiving attribute information of the communication frame of the target information;
and the configuration subunit is used for configuring the communication frame format and the transceiving attribute of the mailbox into second frame format and transceiving attribute information respectively.
A CAN bus control device disclosed in embodiment 2 of the present invention is a device corresponding to the CAN bus control method disclosed in embodiment 1, and the details CAN be referred to the description of the above embodiments, and embodiment 2 of the present invention is not described herein again.
In the CAN bus control device disclosed in embodiment 2 of the present invention, when each node is in a CAN bus and the acquisition module acquires target information in a CAN communication message corresponding to each node, the allocation module may allocate mailboxes to each node according to the target information, and finally communicate with each node using each mailbox, where each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
Example 3
A vehicle control unit disclosed in embodiment 3 of the present invention is described below with reference to fig. 5, and fig. 5 is a schematic structural diagram of the vehicle control unit disclosed in embodiment 3 of the present invention.
The vehicle control unit 5 includes: a processor 50 and a memory 51.
The memory 51 stores therein control instructions.
A processor 50 for executing the control instructions stored in the memory 51 to implement the steps of the CAN-bus control method as mentioned in any of the above embodiments.
The vehicle control unit 5 includes: a power supply 52, at least one wired or wireless network interface 53, at least one data input output interface 54.
The power supply 52 is connected to the memory 51 and the processor 50, respectively, for supplying power. The wired or wireless network interface 53 and the data input/output interface 54 are used for interfacing with external devices for data communication and transmission. The memory 51 may be a transient or persistent storage.
In the vehicle control unit disclosed in embodiment 3 of the present invention, when each node is in the CAN bus, and the processor is capable of allocating mailboxes to each node according to target information when the processor obtains the target information in the CAN communication message corresponding to each node, and finally communicating with each node by using each mailbox, where each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
Example 4
Embodiment 4 of the present invention discloses a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the steps in the CAN bus control method according to any one of the above embodiments.
In the computer-readable storage medium disclosed in embodiment 4 of the present invention, when each node is located on the CAN bus, and when the processor obtains target information in a CAN communication message corresponding to each node, the processor CAN allocate mailboxes to each node according to the target information, and finally communicate with each node using each mailbox, where each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
Example 5
Embodiment 5 of the present invention discloses an automobile, including: the vehicle control unit as mentioned in embodiment 3.
In the automobile disclosed in embodiment 5 of the present invention, when each node is in the CAN bus, the processor CAN allocate mailboxes to each node according to the target information when the processor obtains the target information in the CAN communication message corresponding to each node, and finally, each mailbox communicates with each node, where each mailbox corresponds to a different frame format. Because each mailbox CAN correspond to different frame formats, the scheme of the invention CAN utilize the mailbox to simultaneously realize data receiving and transmitting of multiple frame formats on the CAN bus, thereby avoiding the introduction of a plurality of CAN buses, avoiding the problem of unbalanced load distribution on the plurality of CAN buses and improving the communication efficiency.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A CAN bus control method, the CAN bus having a plurality of nodes thereon, the control method comprising:
acquiring target information in the CAN communication message corresponding to each node;
distributing mailboxes for the nodes respectively according to the target information and a predefined rule;
wherein each mailbox supports different frame formats.
2. The CAN bus control method of claim 1, wherein the allocating mailboxes to the nodes, respectively, according to the target information with a predefined rule comprises:
resolving a first identifier in the target information;
determining a mailbox number bound to the first identifier;
and distributing the configured mailbox corresponding to the mailbox number to the corresponding node.
3. The CAN bus control method of claim 2, wherein the configuration process of the configured mailbox specifically comprises:
configuring a first frame format and transceiving attribute information of the mailbox;
configuring a mailbox corresponding to the first frame format and the transceiving attribute as a mailbox bound to the first identifier.
4. The CAN bus control method of claim 1, wherein the allocating mailboxes to the respective nodes according to the target information with predefined rules specifically comprises:
resolving a second identifier in the target information;
randomly distributing a mailbox for the node corresponding to the second identifier;
carrying out initialization configuration on the mailbox according to the frame format and the transceiving attribute in the target information;
and determining the mailbox after the initialization configuration as a final mailbox of the node corresponding to the CAN communication message.
5. The CAN bus control method of claim 4, wherein the initializing configuration of the mailbox according to the frame format and the transceiving attribute in the target information comprises:
determining a second frame format and transceiving attribute information of a communication frame of the target information;
and configuring the communication frame format and the transceiving attribute of the mailbox as the second frame format and the transceiving attribute information respectively.
6. The CAN-bus control method of any of claims 1-5, wherein the frame format specifically comprises a standard frame format and an extended frame format, and wherein transmitting and receiving attribute information comprises receiving the CAN communication message and transmitting the CAN communication message.
7. A CAN bus control apparatus having a plurality of nodes on a CAN bus, comprising:
the acquisition module is used for acquiring target information in the CAN communication message corresponding to each node;
and the distribution module is used for distributing mailboxes for the nodes according to the target information by a predefined rule, wherein each mailbox supports different frame formats.
8. The vehicle control unit comprises a processor and a memory, and is characterized in that,
the memory has stored therein control instructions that,
the processor is configured to execute the control instructions stored in the memory to implement the steps of the CAN bus control method according to any one of claims 1 to 6.
9. A computer-readable storage medium, having a computer program stored thereon, the computer program being executable by a processor to implement the steps in the CAN-bus control method of any one of claims 1-6.
10. An automobile, comprising: the vehicle control unit of claim 8.
CN201910972407.3A 2019-10-14 2019-10-14 CAN bus control method and device, vehicle control unit, storage medium and vehicle Pending CN111650915A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910972407.3A CN111650915A (en) 2019-10-14 2019-10-14 CAN bus control method and device, vehicle control unit, storage medium and vehicle

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910972407.3A CN111650915A (en) 2019-10-14 2019-10-14 CAN bus control method and device, vehicle control unit, storage medium and vehicle

Publications (1)

Publication Number Publication Date
CN111650915A true CN111650915A (en) 2020-09-11

Family

ID=72346296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910972407.3A Pending CN111650915A (en) 2019-10-14 2019-10-14 CAN bus control method and device, vehicle control unit, storage medium and vehicle

Country Status (1)

Country Link
CN (1) CN111650915A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979058A (en) * 2022-06-30 2022-08-30 东风电驱动系统有限公司 CAN multi-mailbox multiplexing processing method and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102752084A (en) * 2012-07-27 2012-10-24 湖南先步信息股份有限公司 Multi-device controller area network (CAN) communication intelligent retransmission method
US8447826B1 (en) * 2009-09-14 2013-05-21 Symantec Corporation Method and apparatus for providing highly available storage groups
CN106330640A (en) * 2016-08-17 2017-01-11 中国航空工业集团公司西安飞行自动控制研究所 Data cross transmission method based on CAN bus
CN108536114A (en) * 2017-03-01 2018-09-14 北京图森未来科技有限公司 A kind of controller of vehicle
CN109981431A (en) * 2019-03-15 2019-07-05 西安微电子技术研究所 A kind of CAN controller data storage circuitry and date storage method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8447826B1 (en) * 2009-09-14 2013-05-21 Symantec Corporation Method and apparatus for providing highly available storage groups
CN102752084A (en) * 2012-07-27 2012-10-24 湖南先步信息股份有限公司 Multi-device controller area network (CAN) communication intelligent retransmission method
CN106330640A (en) * 2016-08-17 2017-01-11 中国航空工业集团公司西安飞行自动控制研究所 Data cross transmission method based on CAN bus
CN108536114A (en) * 2017-03-01 2018-09-14 北京图森未来科技有限公司 A kind of controller of vehicle
CN109981431A (en) * 2019-03-15 2019-07-05 西安微电子技术研究所 A kind of CAN controller data storage circuitry and date storage method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979058A (en) * 2022-06-30 2022-08-30 东风电驱动系统有限公司 CAN multi-mailbox multiplexing processing method and system
CN114979058B (en) * 2022-06-30 2023-10-03 东风电驱动系统有限公司 CAN multi-mailbox multiplexing processing method and system

Similar Documents

Publication Publication Date Title
CN102842939B (en) Battery management system and battery management method
WO2021098212A1 (en) Software upgrade method, apparatus and system
CN112199266B (en) Log transmission method and system for vehicle-mounted machine system, vehicle and storage medium
CN108063775B (en) Communication protocol compatible method, device and system
CN111901387B (en) Connection method and device of cloud special line
CN106899327B (en) Data transmission method and device
WO2021027855A1 (en) Resource allocation method and apparatus
CN114900818A (en) Communication method and device
EP2670107B1 (en) Communication method for wireless terminal and host device, and wireless terminal and host device
CN111650915A (en) CAN bus control method and device, vehicle control unit, storage medium and vehicle
CN112019378A (en) Troubleshooting method and device
CN114039808B (en) CAN/LIN/SENT forwarding protocol of CAN-based multichannel
CN111030902A (en) Vehicle electronic control unit refreshing method and system
CN108891227B (en) Method and system for communication between whole vehicle and air conditioner and control panel
CN106953809B (en) 485 time-sharing communication-based equipment resource acquisition method
CN107633668B (en) Infrared communication method and device for battery management in Internet of vehicles
CN102932208A (en) Site monitoring method and device
CN107257563B (en) Remote low-power-consumption network system and networking method
CN212463256U (en) Wireless terminal equipment of Internet of things and communication module
CN112770370B (en) Method and device for intelligent equipment to access network and intelligent equipment
CN110224908A (en) Vehicle netbios and automobile
CN105207811B (en) Method and device for replacing non-AllJoyn equipment
CN112667555B (en) Communication method and device of micro control unit
CN111131473A (en) Network parameter transmission method and device
CN111447126A (en) Ethernet bus communication method, device, robot, equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200911