CN113726598B - Communication method and device and electronic equipment - Google Patents

Communication method and device and electronic equipment Download PDF

Info

Publication number
CN113726598B
CN113726598B CN202110960086.2A CN202110960086A CN113726598B CN 113726598 B CN113726598 B CN 113726598B CN 202110960086 A CN202110960086 A CN 202110960086A CN 113726598 B CN113726598 B CN 113726598B
Authority
CN
China
Prior art keywords
node
communication
line
message
abnormal
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.)
Active
Application number
CN202110960086.2A
Other languages
Chinese (zh)
Other versions
CN113726598A (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.)
Guangzhou Xiaopeng Motors Technology Co Ltd
Original Assignee
Guangzhou Xiaopeng Motors Technology 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 Guangzhou Xiaopeng Motors Technology Co Ltd filed Critical Guangzhou Xiaopeng Motors Technology Co Ltd
Priority to CN202110960086.2A priority Critical patent/CN113726598B/en
Publication of CN113726598A publication Critical patent/CN113726598A/en
Priority to PCT/CN2022/112675 priority patent/WO2023020458A1/en
Application granted granted Critical
Publication of CN113726598B publication Critical patent/CN113726598B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0631Management of faults, events, alarms or notifications using root cause analysis; using analysis of correlation between notifications, alarms or events based on decision criteria, e.g. hierarchy, tree or time analysis
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • 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
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40215Controller Area Network CAN
    • 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
    • H04L2012/40267Bus for use in transportation systems
    • H04L2012/40273Bus for use in transportation systems the transportation system being a vehicle

Abstract

The embodiment of the application discloses a communication method, an electronic device and a vehicle. The method comprises the following steps: if the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a state inquiry message through the second line, wherein the state inquiry message corresponds to the identifier of the communication node in the second node, which is abnormal in communication; and receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with abnormal communication in the second node through the second line, and unreasonable measures are avoided because the state of the communication node with abnormal communication in the second node cannot be determined when the first line communication is abnormal.

Description

Communication method and device and electronic equipment
Technical Field
The present application relates to the field of automobiles, and more particularly, to a communication method, an electronic device, and a vehicle.
Background
Nowadays, automobiles have moved into thousands of households, and the demand of people for driving experience is continuously increasing, so that automobile electronic systems become more complex, and the risk caused by the failure of the electronic and electrical systems is higher and higher. The issue of automobile safety is the most concern of every consumer, and failure of any safety-related component in an automobile may result in irreparable damage, and therefore places greater demands on the electrical and electronic systems. Generally, each system component of an automobile mainly communicates with another system component by using a predetermined protocol. For example, the predetermined protocol may be a CAN (Controller Area Network) protocol.
However, most parts of the existing automobile are placed in a distributed manner, and once a communication abnormality occurs in a certain part, the actual situation of the part with the communication abnormality cannot be known in time.
Disclosure of Invention
In view of the above problems, the present application provides a communication method, a communication device, and a vehicle to improve the above problems.
In a first aspect, the present application provides a communication method applied to an electronic device, the method including: if the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a state inquiry message through the second line, and the state inquiry message corresponds to the identifier of the communication node in the second node, which is abnormal in communication; and receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message.
In a second aspect, the present application provides an electronic device comprising a line comprising a first line and a second line and a plurality of communication nodes comprising a first node and a second node; the first line is used for realizing communication among the plurality of communication nodes; the second line is used for looping the plurality of communication nodes; the first node is configured to detect a communication state of a communication node in the second node based on the first line, and send a state query packet through the second line if it is detected that the communication node in the second node based on the first line is abnormal, where the state query packet corresponds to an identifier of the communication node in which the communication is abnormal; and receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message.
In a third aspect, the present application provides a vehicle comprising the above-described electronic device.
In a fourth aspect, the present application provides a computer-readable storage medium having a program code stored therein, wherein the program code performs the above method when running.
The application provides a communication method, a communication device and a vehicle. And after detecting that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a state inquiry message through the second line, wherein the state inquiry message corresponds to the identifier of the communication node in the second node, which is abnormal in communication, and receives a state confirmation message returned by the communication node in the second node, which is abnormal in communication, responding to the state inquiry message. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with abnormal communication in the second node through the second line, and unreasonable measures are avoided because the state of the communication node with abnormal communication in the second node cannot be determined when the first line communication is abnormal.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 illustrates a schematic view of an electronic device frame as set forth herein;
fig. 2 is a flow chart illustrating a communication method according to an embodiment of the present application;
fig. 3 is a flow chart of a communication method according to another embodiment of the present application;
fig. 4 is a schematic diagram illustrating transmission levels of a message according to the present application;
FIG. 5 is a flow chart illustrating a method of communication according to yet another embodiment of the present application;
FIG. 6 is a schematic diagram illustrating a high voltage interlock loop fault detection method proposed by the present application;
fig. 7 shows a flow chart of a communication method according to a further embodiment of the present application;
fig. 8 is a block diagram of an electronic device according to the present disclosure;
fig. 9 is a storage unit for storing or carrying program codes for implementing a parameter obtaining method according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. 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 application.
Nowadays, automobiles have moved into thousands of households, and the demand of people for driving experience is continuously increasing, so that automobile electronic systems become more complex, and the risk caused by the failure of the electronic and electrical systems is higher and higher. The issue of automobile safety is the most concern of every consumer, and failure of any safety-related component in an automobile may result in irreparable damage, and therefore places greater demands on the electrical and electronic systems. In this context, the various system components of the vehicle communicate with one another primarily using established protocols. For example, the predetermined protocol may be a CAN (Controller Area Network) protocol.
The inventor finds that, in the research on related automobile communication, most parts of the current automobile are placed in a distributed mode, and once a communication abnormality occurs in a certain part, the actual situation of the part with the communication abnormality cannot be known in time.
Therefore, the inventor proposes a communication method, a communication device and a vehicle in the application. And after detecting that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a state inquiry message through the second line, wherein the state inquiry message corresponds to the identifier of the communication node in the second node, which is abnormal in communication, and receives a state confirmation message returned by the communication node in the second node, which is abnormal in communication, responding to the state inquiry message. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with the abnormal communication in the second node through the second line, and the problem that when the first line communication is abnormal, unreasonable measures are taken due to the fact that the state of the communication node with the abnormal communication in the second node cannot be determined, and further potential safety hazards are generated is avoided.
In order to better understand the solution of the embodiment of the present application, a frame of the electronic device of the present application is described below.
Referring to fig. 1, an electronic device of the present application includes a line including a first line and a second line, and a plurality of communication nodes including a first node and a second node. Each communication node is associated with a respective identity, for example, each communication node has a respective address code as its identity. The first line is a line for performing communication between a plurality of communication nodes, for example, the first line may be a CAN bus shown in fig. 1, and the CAN bus is composed of two signal lines CANH and CANL. The CAN communication protocol CAN encode data content instead of address encoding of communication nodes, so that a plurality of communication nodes CAN be loaded as long as the load of a bus is enough, and the serial communication of distributed real-time control among the communication nodes is realized.
The second line is a line that causes a plurality of communication nodes to form a loop, and may be, for example, a high-voltage interlock loop, which is a hard-wired mechanism and may be formed of a high-voltage interlock line 1 and a high-voltage interlock line 2 shown in fig. 1. The high-voltage interlock loop is used for checking the electrical connection integrity of all communication nodes connected with the high-voltage interlock line by using a low-voltage signal. It should be noted that the high-voltage interlock loop may be in bidirectional communication, that is, the communication direction thereof may be either clockwise or counterclockwise, for example, the clockwise communication direction may be understood as that data sent by the node 1 is transmitted along the node 2, the node 3 and the node 4 in sequence, and then may be transmitted to the node 1 by the node 4; the counterclockwise communication direction may be understood as data sent by the node 4, which is transmitted along the node 3, the node 2, and the node 1 in sequence, and then may be transmitted to the node 4 by the node 1.
Each communication node may be a functional device, and may be, for example, a motor control device, a battery management system, a DCDC (Direct Current), or the like. Each communication node may include an MCU (micro controller Unit), a CAN controller, a CAN transceiver, and a functional circuit, where the CAN controller and the CAN transceiver are configured to complete the transceiving of a CAN message, and the CAN controller is configured to implement all functions of a data link layer in a CAN protocol, and may automatically complete the analysis of the CAN protocol. The CAN transceiver is connected with the CAN bus through CANH and CANL and used for realizing the interchange of the logic level of the CAN controller and the differential level on the CAN bus so as to transmit messages. The MCU is provided with an IO port with a timer function, the IO port is connected with an input/output pin of the communication node, and then is connected into the high-voltage interlocking loop through the input/output pin, and the high and low levels are controlled through the timer to obtain an output message; and acquiring an input message by capturing the input level of the pin, so as to realize information transmission on the high-voltage interlocking loop.
It should be noted that, in order to better understand the solution of the embodiment of the present application, the node 1 in fig. 1 may be regarded as a first node, that is, a master node; the other nodes are considered as second nodes. It is to be understood that the first node may also be other nodes, instead of being the node 1.
Furthermore, it should be noted that the number of nodes shown in fig. 1 is only exemplary, and the number of nodes included in the electronic device may be greater or less.
Referring to fig. 2, a communication method provided by the present application is applied to an electronic device, where the electronic device includes a line and a plurality of communication nodes, the line includes a first line and a second line, the first line is used to implement communication among the plurality of communication nodes, the second line is used to enable the plurality of communication nodes to form a loop, the communication nodes connected by the second line are mutually interlocking nodes, and the interlocking nodes include a first node and a second node, and the method includes:
s110: if the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a state inquiry message through the second line, and the state inquiry message corresponds to the identifier of the communication node in the second node, which is abnormal in communication.
The first node can detect the communication state of the second node so as to timely discover the communication node with abnormal communication in the second node. In the embodiment of the present application, the first node may have various ways to detect whether the communication node is abnormal.
By one way, the step of the first node detecting the communication state of the second node based on the first line includes: the first node periodically sends a connection state message through a first line, wherein the connection state message corresponds to the identifier of the first node, and the communication node which receives the connection state message sent by the adjacent last communication node sends the connection state message corresponding to the identifier of the communication node to the adjacent next communication node;
and if the first node does not receive the connection state message of the communication node, determining that the communication node in the second node is abnormal based on the communication of the first line, and sending a state inquiry message by the first node through the second line.
The time period for the first node to periodically send the connection state packet through the first line may be defined according to software requirements, and for example, the time interval for the node 1 (master node) to send the connection state packet each time is 100ms. That is, the first node periodically transmits the connection status message, and transmits the connection status message through the first line every 100ms.
For example, as shown in fig. 1, when the node 3 has an abnormality based on the communication of the first line, the node 1 (master node) sends a connection state message 0xa100 to the node 2 through the first line, where a represents the connection state, 1 is a 16-ary representation of the address code 0001 of the node 1, the node 2 confirms that the state connection message 0xa100 from the last communication node (node 1) adjacent to the node is received and sends 0xa200 to the next communication node (node 3) adjacent to the node after receiving the state connection message 0xa100, the node 3 does not receive a message from the node 2 or cannot send a connection state message with its own identifier to the next communication node (node 4) adjacent to the node 3, and therefore the node 4 and the node 1 cannot receive the connection state message, and when the node 1 determines that the communication of the node 3 based on the first line has an abnormality, the node 1 sends a state inquiry message to the node 3 through the second line.
It should be noted that the specific format of the connection status message may be defined according to the requirement for data.
Alternatively, the step of the first node detecting the communication state of the second node based on the first line includes: and when the first node sends a message to the communication node in the second node through the first line, setting a waiting response time t, and if the waiting response time t is exceeded and the first node does not receive a response message from the communication node in the second node, indicating that the communication of the communication node in the second node based on the first line is abnormal. The message sent by the first node may be any message in the case of normal communication of the first line, for example: and instructing a certain communication node in the second node to complete a message of a certain function class, confirming a message of a current working state class of the certain communication node in the second node and the like.
After the first node detects that the communication node in the second node is abnormal based on the communication of the first line, the first node can send a state inquiry message through the second line in order to further determine the actual state of the communication node with the abnormal communication. In addition, in order to enable the communication node with abnormal communication to recognize that the state query packet is a packet for querying the state of the communication node, the state query packet sent by the first node may correspond to the identifier of the communication node with abnormal communication. Wherein the identification of the communication node may encode the address of the communication node. Illustratively, each node may be encoded using a four-bit binary, e.g., 0001 for node 1, 0010 for node 2, 0011 for node 3, 0100 for node 4, etc. Therefore, the state inquiry message can enable the communication node with abnormal communication to identify that the state inquiry message is a message for inquiring the state of the communication node by carrying the address coding information of the communication node with abnormal communication. Illustratively, the status query message is 0xd301, where d represents the status query, and 3 is a 16-ary representation of the address code 0011 of the node 3, which indicates that the message 0xd301 is a query of the actual status of the node 3.
S120: and receiving a state confirmation message returned by the communication node with abnormal communication in the second node in response to the state inquiry message.
For example, if the first node detects that the node 3 has an abnormality based on the communication of the first line, the first node may send a status query message 0xd301 through the second line, where d represents a status query, 3 is a 16-ary representation of an address code 0011 of the node 3, and 1 represents a CAN bus open circuit. After the node 3 receives the 0xd301, if the state of the node 3 is the CAN bus open circuit, the node 3 sends a state confirmation message 0xe301, where e represents state confirmation, and 3 is a 16-system representation of an address code 0011 of the node 3; if the state is not the CAN bus open circuit, the node 3 sends a state confirmation message 0xe302. If the node 1 receives the signal of 0xe301, the current state of the node 3 is CAN bus open circuit; if the node 1 receives 0xe302, it indicates that the current state of the node 3 is not CAN bus open circuit, and the node 1 will continue to send the next state inquiry packet until the current state of the node 3 is confirmed.
It should be noted that the state query message may be defined according to an abnormal state that may occur in the communication node, and the state query message may also be of various types, for example, the state query message may also be: 0xd302, where 2 represents a CAN transceiver chip failure; 0xd303, where 3 indicates poor contact of the connector, etc.
Furthermore, it should be noted that the specific formats of the status query message and the status confirmation message may be defined according to the requirement for data.
In the communication method provided in this embodiment, after the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a status query message through the second line, where the status query message corresponds to an identifier of the communication node in the second node where the communication is abnormal, and receives a status confirmation message returned by the communication node in the second node where the communication is abnormal in response to the status query message. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with the abnormal communication in the second node through the second line, and the problem that when the first line communication is abnormal, unreasonable measures are taken due to the fact that the state of the communication node with the abnormal communication in the second node cannot be determined, and further potential safety hazards are generated is avoided.
Referring to fig. 3, a communication method provided in the present application is applied to an electronic device, where the electronic device includes a line and a plurality of communication nodes, the line includes a first line and a second line, the first line is used to implement communication among the plurality of communication nodes, the second line is used to enable the plurality of communication nodes to form a loop, the communication nodes connected by the second line are mutually interlocking nodes, and the interlocking nodes include a first node and a second node, and the method includes:
s210: and if the first node detects that the communication node in the second node is abnormal based on the communication of the first line, detecting the communication state of the communication node in the second node with abnormal communication on the second line.
As one mode, the step of detecting the communication state of the communication node on the second line, in which the communication abnormality occurs, in the second node includes: the first node sends an addressing message through a second line, wherein the addressing message corresponds to an identifier of a communication node with abnormal communication in the second node, and if the communication node receiving the addressing message determines that the received addressing message does not correspond to the communication node, the first node sends the addressing message to the next adjacent communication node; if the communication node receiving the addressing message determines that the received addressing message corresponds to the communication node, sending an addressing message to the first node through a second line, wherein the addressing message corresponds to the identifier of the communication node with abnormal communication in the second node;
and if the first node receives an addressing message returned by a communication node with abnormal communication in the second node responding to the addressing message, determining that the communication state of the communication node with abnormal communication in the second node on the second line is normal.
Illustratively, as shown in fig. 1, when a node 3 is abnormal based on communication of the first line, a node 1 (master node) sends a message 0xb301 with an addressing identifier through a second line, where 3 is a 16-ary representation of an address code 0011 of the node 3, b represents fast response processing, after receiving the last 0xb301, the node 2 confirms that the node is not searching for itself and continues to send the message to a next communication node (node 3) adjacent to the node 2, after receiving the last message, the node 3 confirms that the node is searching for itself and quickly sends a message 0xb302 with a fast response addressing identifier to a next communication node (node 4) adjacent to the node 3 to indicate that the node 4 has received the message, the node 4 quickly sends the 0xb back to the node 1, and after receiving the node 1, the node 3 confirms that the communication state on the second line is normal.
It should be noted that the message may be a set of rectangular waves with a specific pulse width T sent by the MCU through the IO port, and each rectangular wave with a specific pulse width T may represent one data valid bit, where a high level is the same as a VCC value and may represent a logic 1; a low level of 0V may represent a logic 0. For example, if a logic 1 needs to be sent, the mcu internal timer module starts to count after sending high level, and outputs low level after reaching time T. Therefore, the sender can convert the 16-system message into 2-system data to be transmitted on the second communication line, the receiver also obtains a group of data comprising 1 and 0 according to the high and low levels of the pins, and the data is further analyzed according to the protocol, so that the communication of the two parties on the second communication line can be realized.
Illustratively, the binary representation of the message 0xb301 is 1011 0011 0000 0001, and fig. 4 represents the transmission level of the message 0xb301 output by the MCU of the node 1 through the IO port with the timer function. It should be noted that the specific formats of the message with the addressing identifier and the message with the quick response addressing identifier are defined according to the data requirements.
S220: and if the communication state is normal, the first node sends a state inquiry message through the second line.
S230: and receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message.
In the communication method provided in this embodiment, after the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the communication state of the communication node in the second node, which is abnormal in communication, on the second line is detected, if the communication state is normal, the first node sends a state inquiry packet through the second line, and receives a state confirmation packet returned by the communication node in the second node, which is abnormal in communication, in response to the state inquiry packet. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with abnormal communication in the second node through the second line, and the problem of potential safety hazard caused by unreasonable measures because the state of the communication node with abnormal communication in the second node cannot be determined when the first line communication is abnormal is avoided. In addition, in this embodiment, before the step of sending the status query packet through the second line after the first node detects that the communication node in the second node is abnormal based on the communication of the first line is executed, the communication status of the communication node in the second node, which is abnormal in communication, on the second line is also detected, so that the reliability of the communication node in the second node, which is abnormal in communication, on the second line is ensured, and the security performance is improved.
Referring to fig. 5, a communication method provided by the present application is applied to an electronic device, where the electronic device includes a line and a plurality of communication nodes, the line includes a first line and a second line, the first line is used to implement communication among the plurality of communication nodes, the second line is used to enable the plurality of communication nodes to form a loop, the communication nodes connected by the second line are mutually interlocking nodes, and the interlocking nodes include a first node and a second node, and the method includes:
s310: and if the first node detects that communication nodes in the second node are abnormal based on the communication of the first line and the connection state of the second line is normal, the first node sends a state inquiry message through the second line.
As one mode, the step for detecting the connection state of the second line includes: the first node periodically sends a connection state message through a second line, wherein the connection state message corresponds to the identifier of the first node, and the communication node which receives the connection state message sent by the adjacent previous communication node sends the connection state message corresponding to the identifier of the communication node to the adjacent next communication node;
and if the first node receives a connection state message of the communication node, determining that the connection state of the second line is normal.
The time period for the first node to periodically send the connection state packet through the second line may be defined according to the software requirement, and illustratively, the time interval for the node 1 (master node) to send the connection state packet each time is 100ms, that is, the first node sends the connection state packet periodically, and sends the connection state packet through the first line every 100ms.
Illustratively, as shown in fig. 1, the node 1 (master node) sends a connection status message 0xa100 to the node 2 via the second line, where a represents the connection status, 1 is a 16-ary representation of the address code 0001 of the node 1, the node 2 sends 0xa200 to the next communication node (node 3) adjacent to the node after confirming the receipt of the status connection message 0xa100 from the last communication node (node 1) adjacent to the node 2, the node 3 sends 0xa300 to the next communication node (node 4) adjacent to the node 3 after confirming the receipt of the status connection message, and the node 4 sends 0xa400 to the node 1 after confirming the receipt of the status connection message, where the node 1 determines that the connection status of the second line is normal and starts to perform the next connection status confirmation.
It should be noted that the specific format of the connection status message may be defined according to the requirement for data.
Optionally, if the first node does not receive a status connection packet of a communication node, it is determined that there is a communication node in the second node that is abnormal based on the connection of the second line, and the first node performs fault detection on the second line.
By one approach, the step of the first node performing fault detection on the second line comprises: and the first node sends a fault address selection message through a second line, wherein the fault address selection message is sent to an adjacent next communication node after the communication node receiving the fault address selection message confirms, and a fault connection confirmation message corresponding to the identifier of the first node is sent to an adjacent previous communication node, wherein the communication node receiving the fault connection confirmation message continues to send the fault connection confirmation message to the adjacent previous communication node.
If the first node does not receive the fault connection confirmation messages of all the communication nodes, determining that the connection of the communication nodes based on the second line is abnormal in the second node, wherein the communication nodes with abnormal connection in the second node are the communication nodes corresponding to the fault connection confirmation messages which are not received by the first node.
It should be noted that each node has a specific faulty connection acknowledgement message, which is defined in advance in the communication protocol.
Illustratively, as shown in fig. 6, a node 1 (master node) sends a failure address message 0xc100 to a node 2, where c represents a failure address, 1 is a 16-ary representation of an address code 0001 of the node 1, after receiving the failure address message, the node 2 continues to transmit the failure address message 0xc100 to a next communication node (node 3) adjacent to the node 2, and sends a failure connection confirmation message 0xc101 to a previous communication node (node 1) adjacent to the node 2, and if the node 1 receives 0xc101, it indicates that the connection between the node 1 and the node 2 is normal; if node 1 does not receive 0xc101, it indicates that the connection between 1 and 2 is abnormal. After receiving the message sent by the node 2, the node 3 continues to transmit the fault addressing message 0xc100 to the next communication node (node 4) adjacent to the node 3, and returns a fault connection confirmation message 0xc102 to the last communication node (node 2) adjacent to the node 3, and after receiving the 0xc102, the node 2 forwards the fault connection confirmation message to the node 1, so that the normal connection among the nodes 1, 2 and 3 can be determined. After receiving the message sent by the node 3, the node 4 returns a failure connection confirmation message 0xc103 to the last communication node (node 3) adjacent to the node 4, and after receiving the 0xc103, the node 3 forwards the failure connection confirmation message to the node 1 through the node 2, so that the normal connection among the nodes 1, 2, 3 and 4 can be determined.
By the above manner, the node 1 (master node) can determine the connection state of each node by whether receiving the failure connection confirmation message (0 xc101, 0xc102, 0xc 103) returned by each node, and further, can find out the node with the connection failure by the connection state of all communication nodes. For example: node 1 received 0xc101 but not 0xc102, indicating an abnormal connection between nodes 2 and 3. For another example: node 1 receives 0xc101 and 0xc102, but does not receive 0xc103, which indicates that the connection between nodes 1, 2, and 3 is normal, and that the connection between nodes 3 and 4 is abnormal, and further indicates that node 4 is a failed node.
It should be noted that the specific formats of the fault address selection message and the fault connection confirmation message may be defined according to the requirement for data.
By the aid of the mode, when the second communication line connection breaks down, the fault detection can be performed on the second communication line connection through the first node, the fault node can be directly found out, the process that the nodes are manually checked one by one is avoided, fault reasons can be found out more quickly, and communication can be recovered to be normal more quickly.
S320: and receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message.
In the communication method provided in this embodiment, after the first node detects that a communication node in the second node is abnormal based on the communication of the first line, and the connection state of the second line is normal, the first node sends a state query message through the second line, and receives a state confirmation message returned by the communication node in the second node, which is abnormal in communication, in response to the state query message. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with abnormal communication in the second node through the second line, and the problem of potential safety hazard caused by unreasonable measures because the state of the communication node with abnormal communication in the second node cannot be determined when the first line communication is abnormal is avoided. In addition, in this embodiment, before the first node sends the status query packet via the second line, the connection status of the second line is also detected, so that when there is an abnormality in communication of the communication node based on the first line in the second node, the first node can send the status query packet via the second line, thereby improving the security performance.
Referring to fig. 7, a communication method provided in the present application is applied to an electronic device, where the electronic device includes a line and a plurality of communication nodes, the line includes a first line and a second line, the first line is used to implement communication among the plurality of communication nodes, the second line is used to enable the plurality of communication nodes to form a loop, the communication nodes connected by the second line are mutually interlocking nodes, and the interlocking nodes include a first node and a second node, and the method includes:
s410: if the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a state inquiry message through the second line, and the state inquiry message corresponds to the identifier of the communication node in the second node, which is abnormal in communication.
S420: and receiving a state confirmation message returned by the communication node with abnormal communication in the second node in response to the state inquiry message.
S430: and the first node sends a state response message through the second line.
Illustratively, if a node 1 (master node) detects that a node 3 has an abnormality in communication on a first line, wherein the node 3 is a motor controller, the node 1 sends a state inquiry message to the node 3 through a second line, the node 3 sends a state confirmation message through the second line to feed back the current state of the node 3 to the node 1, and the node 1 determines the state of the node 3 through the state confirmation message, if the node 3 is found to have an abnormality in communication on the first line due to a CAN bus open circuit, a CAN transceiver chip failure, and the like, and other functions are normal, a state response message 0xf301 CAN be sent, wherein f represents a state response, 3 represents a 16-system representation of an address code 0011 of the node 3, and 1 represents a whole vehicle limp.
It should be noted that there may be a plurality of status response messages, and for example, the status query message may also be: 0xf302, where 2 denotes secure processing mechanism 1;0xf303, where 3 denotes security handling mechanism 2, etc. Furthermore, it should be noted that the specific format of the status response message may be defined according to the requirement for data.
In the communication method provided in this embodiment, after the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a status query message through the second line, where the status query message corresponds to an identifier of the communication node in the second node, where the communication node in the second node has abnormal communication, receives a status confirmation message returned by the communication node in the second node in response to the status query message, and the first node sends a status response message through the second line. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with abnormal communication in the second node through the second line, and the problem of potential safety hazard caused by unreasonable measures which cannot be taken to determine the state of the communication node with abnormal communication in the second node when the first line communication is abnormal is avoided. And after the first node determines the state of the communication node with abnormal communication in the second node, the first node can send a state corresponding message according to the state of the communication node with abnormal communication in the second node, so that the communication node with abnormal communication in the second node can be reasonably processed, and the safety performance is improved.
Referring to fig. 8, an electronic device 600 provided herein includes a circuit including a first circuit 610 and a second circuit 620, and a plurality of communication nodes including a first node 630 and a second node 640;
the first line 610: for enabling communication among the plurality of communication nodes;
the second line 620: for looping the plurality of communication nodes;
the first node 630: the second node is used for detecting the communication state of the communication node in the second node based on the first line, and if the communication node in the second node based on the first line is detected to be abnormal, sending a state inquiry message through the second line, wherein the state inquiry message corresponds to the identifier of the communication node with the abnormal communication; and receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message.
Wherein the identification of the communication node is an address code of the communication node.
The first line is a CAN bus, and the second line is a high-voltage interlocking loop.
As a manner, the first node 630 is specifically configured to, if the first node detects that a communication node in the second node is abnormal based on the communication of the first line, detect a communication state of the communication node in the second node, in which the communication is abnormal, on the second line; and if the communication state is normal, the first node sends a state inquiry message through the second line.
Optionally, the first node 630 is specifically configured to send an addressing packet through a second line, where the addressing packet corresponds to an identifier of a communication node in the second node, where if the communication node that receives the addressing packet determines that the received addressing packet does not correspond to the first node, the first node sends the addressing packet to a next adjacent communication node; if the communication node receiving the addressing message determines that the received addressing message corresponds to the communication node, sending an addressing message to the first node through a second line, wherein the addressing message corresponds to the identifier of the communication node with abnormal communication in the second node;
and if receiving an addressing message returned by a communication node with abnormal communication in the second node responding to the addressing message, determining that the communication state of the communication node with abnormal communication in the second node on the second line is normal.
As another mode, the first node 630 is specifically configured to detect a communication state of a communication node in the second node based on the first line, and send a state query packet through the second line if it is detected that there is an abnormality in communication of the communication node in the second node based on the first line and the connection state of the second line is normal.
Optionally, the first node 630 is specifically configured to periodically send a connection status packet through a second line, where the connection status packet corresponds to the identifier of the first node, and a communication node that receives the connection status packet sent by the previous adjacent communication node sends a connection status packet corresponding to its identifier to the next adjacent communication node;
and if the connection state message of the communication node is received, determining that the connection state of the second line is normal.
And if the connection state message of the communication node is not received, determining that the connection of the communication node based on the second line is abnormal in the second node, and carrying out fault detection on the second line by the first node.
Optionally, the first node 630 is specifically configured to send a fault address selection message through the second line, where after receiving the confirmation of the communication node of the fault address selection message, the first node sends the fault address selection message to the next adjacent communication node, and sends a fault connection confirmation message corresponding to its identifier to the previous adjacent communication node, where the communication node that receives the fault connection confirmation message continues to send the fault connection confirmation message to the previous adjacent communication node;
if the fault connection confirmation messages of all the communication nodes are not received, determining that the communication nodes in the second nodes are abnormal based on the connection of the second line, wherein the communication nodes with abnormal connection in the second nodes are the communication nodes corresponding to the fault connection confirmation messages which are not received.
As another mode, the first node 630 is specifically configured to detect a communication state of a communication node in the second node based on the first line, and send a state query packet through the second line if it is detected that the communication node in the second node based on the first line is abnormal, where the state query packet corresponds to an identifier of the communication node with the abnormal communication; receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message; and sending a state response message through the second line.
According to the electronic device, after the communication state of the communication node based on the first line in the second node is detected, if the communication node based on the first line is detected to be abnormal in the second node, a state inquiry message is sent through the second line, the state inquiry message corresponds to the identifier of the communication node with the abnormal communication, and the state confirmation message returned by the state inquiry message is received by the communication node with the abnormal communication in the second node. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with the abnormal communication in the second node through the second line, and the problem that when the first line communication is abnormal, unreasonable measures are taken due to the fact that the state of the communication node with the abnormal communication in the second node cannot be determined, and further potential safety hazards are generated is avoided.
Referring to fig. 9, a block diagram of a computer-readable storage medium according to an embodiment of the present application is shown. The computer-readable storage medium 800 has stored therein program code that can be called by a processor to execute the methods described in the above-described method embodiments.
The computer-readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read only memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium 800 includes a non-volatile computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 to perform any of the method steps of the method described above. The program code can be read from and written to one or more computer program products. The program code 810 may be compressed, for example, in a suitable form.
In summary, the present application provides a communication method, a communication device and a vehicle. And after detecting that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a state inquiry message through the second line, wherein the state inquiry message corresponds to the identifier of the communication node in the second node, which is abnormal in communication, and receives a state confirmation message returned by the communication node in the second node, which is abnormal in communication, responding to the state inquiry message. By the method, when the communication node in the second node is abnormal based on the first line communication, the first node can determine the state of the communication node with the abnormal communication in the second node through the second line, and the problem that when the first line communication is abnormal, unreasonable measures are taken due to the fact that the state of the communication node with the abnormal communication in the second node cannot be determined, and further potential safety hazards are generated is avoided.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit the same; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not necessarily depart from the spirit and scope of the corresponding technical solutions in the embodiments of the present application.

Claims (14)

1. A communication method applied to an electronic device, the electronic device including a line and a plurality of communication nodes, the line including a first line and a second line, the first line being used to implement communication among the plurality of communication nodes, the second line being used to make the plurality of communication nodes form a loop, the communication nodes connected by the second line are mutually interlocking nodes, the interlocking nodes include a first node and a second node, and the method includes:
if the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the first node sends a state inquiry message through the second line, and the state inquiry message corresponds to the identifier of the communication node in the second node, which is abnormal in communication;
and receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message.
2. The method according to claim 1, wherein if the first node detects that there is a communication node in the second nodes that is abnormal based on the communication of the first line, the first node sends a status query message via the second line, including:
if the first node detects that a communication node in the second node is abnormal based on the communication of the first line, the communication state of the communication node in the second node with abnormal communication on the second line is detected;
and if the communication state is normal, the first node sends a state inquiry message through the second line.
3. The method according to claim 2, wherein if the first node detects that there is a communication node in the second nodes that is abnormal based on the communication of the first line, the detecting a communication state of the communication node in the second nodes that is abnormal in communication on the second line comprises:
the first node sends an addressing message through a second line, wherein the addressing message corresponds to an identifier of a communication node with abnormal communication in the second node, and if the communication node receiving the addressing message determines that the received addressing message does not correspond to the communication node, the first node sends the addressing message to the next adjacent communication node; if the communication node receiving the addressing message determines that the received addressing message corresponds to the communication node, sending an addressing message to the first node through a second line, wherein the addressing message corresponds to the identifier of the communication node with abnormal communication in the second node;
and if the first node receives an addressing message returned by a communication node with abnormal communication in the second node responding to the addressing message, determining that the communication state of the communication node with abnormal communication in the second node on the second line is normal.
4. The method according to claim 1, wherein if the first node detects that there is a communication node among the second nodes that is abnormal based on the communication of the first line, the first node sends a status query message via the second line, including:
and if the first node detects that communication nodes in the second node are abnormal based on the communication of the first line and the connection state of the second line is normal, the first node sends a state inquiry message through the second line.
5. The method of claim 4, further comprising:
the first node periodically sends a connection state message through a second line, wherein the connection state message corresponds to the identifier of the first node, and the communication node which receives the connection state message sent by the adjacent previous communication node sends the connection state message corresponding to the identifier of the communication node to the adjacent next communication node;
and if the first node receives a connection state message of the communication node, determining that the connection state of the second line is normal.
6. The method of claim 5, further comprising:
and if the first node does not receive the connection state message of the communication node, determining that the second node has communication nodes which are abnormal based on the connection of the second line, and carrying out fault detection on the second line by the first node.
7. The method according to claim 6, wherein the determining that there is a communication node in the second node that is abnormal based on the connection of the second line if the first node does not receive the connection status packet of the communication node, and the performing, by the first node, fault detection on the second line includes:
the first node sends a fault addressing message through a second line, wherein the communication node receiving the fault addressing message sends the fault addressing message to an adjacent next communication node after confirming, and sends a fault connection confirmation message corresponding to the identifier of the communication node to an adjacent previous communication node, wherein the communication node receiving the fault connection confirmation message continues to send the fault connection confirmation message to the adjacent previous communication node;
if the first node does not receive the fault connection confirmation messages of all the communication nodes, determining that the connection of the communication nodes based on the second line is abnormal in the second node, wherein the communication nodes with abnormal connection in the second node are the communication nodes corresponding to the fault connection confirmation messages which are not received by the first node.
8. The method according to claim 1, wherein if the first node detects that there is a communication node in the second node that is abnormal based on the communication of the first line, the first node sends a status query packet via the second line, including:
the first node periodically sends a connection state message through a first line, wherein the connection state message corresponds to the identifier of the first node, and the communication node which receives the connection state message sent by the adjacent last communication node sends the connection state message corresponding to the identifier of the communication node to the adjacent next communication node;
and if the first node does not receive the connection state message of the communication node, determining that the communication node in the second node is abnormal based on the communication of the first line, and sending a state inquiry message by the first node through the second line.
9. The method according to claim 1, wherein after receiving a status confirmation message returned by a communication node in the second node, which has an abnormal communication, in response to the status inquiry message, further comprising:
and the first node sends a state response message through the second line.
10. The method of claim 1, wherein the identity of the communication node is an address code of the communication node.
11. The method of any one of claims 1-10, wherein the first line is a CAN bus and the second line is a high voltage interlock loop.
12. An electronic apparatus, characterized in that the electronic apparatus comprises a line comprising a first line and a second line, and a plurality of communication nodes comprising a first node and a second node;
the first line is used for realizing communication among the communication nodes;
the second line is used for enabling the plurality of communication nodes to form a loop, the communication nodes connected through the second line are mutually interlocking nodes, and the interlocking nodes comprise a first node and a second node;
the first node is configured to detect a communication state of a communication node in the second node based on the first line, and send a state query packet through the second line if it is detected that the communication node in the second node based on the first line is abnormal, where the state query packet corresponds to an identifier of the communication node in which the communication is abnormal;
receiving a state confirmation message returned by the communication node with abnormal communication in the second node responding to the state inquiry message;
wherein the first node is further configured to perform the method of any of claims 2-11.
13. A vehicle characterized by comprising a vehicle body and the electronic device according to claim 12, the electronic device being provided in the vehicle body.
14. A computer-readable storage medium, having program code stored therein, wherein the program code when executed by a processor performs the method of any of claims 1-11.
CN202110960086.2A 2021-08-20 2021-08-20 Communication method and device and electronic equipment Active CN113726598B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202110960086.2A CN113726598B (en) 2021-08-20 2021-08-20 Communication method and device and electronic equipment
PCT/CN2022/112675 WO2023020458A1 (en) 2021-08-20 2022-08-16 Communication method, electronic apparatus, vehicle, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110960086.2A CN113726598B (en) 2021-08-20 2021-08-20 Communication method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN113726598A CN113726598A (en) 2021-11-30
CN113726598B true CN113726598B (en) 2023-04-07

Family

ID=78677061

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110960086.2A Active CN113726598B (en) 2021-08-20 2021-08-20 Communication method and device and electronic equipment

Country Status (2)

Country Link
CN (1) CN113726598B (en)
WO (1) WO2023020458A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113726598B (en) * 2021-08-20 2023-04-07 广州小鹏汽车科技有限公司 Communication method and device and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491671A (en) * 2019-09-11 2021-03-12 广州汽车集团股份有限公司 Method and system for monitoring whole vehicle feed problem and vehicle CAN network gateway

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104780064A (en) * 2015-03-31 2015-07-15 北京航天发射技术研究所 Fault detection method of dual-redundancy-channel hot-switching CAN bus
US9851387B2 (en) * 2016-04-11 2017-12-26 Lear Corporation HVIL signal generator and detector with loop diagnostics
CN105743755B (en) * 2016-04-19 2018-12-25 上海君协光电科技发展有限公司 A kind of dual-redundant CAN bus communication system
CN109866710A (en) * 2019-02-18 2019-06-11 苏州工业园区职业技术学院 A kind of In-vehicle networking abnormality detection system
CN110696622A (en) * 2019-10-25 2020-01-17 合肥巨一动力系统有限公司 Anti-interference PWM high-voltage interlocking signal detection and compensation control method for electric vehicle
CN111038265A (en) * 2019-12-30 2020-04-21 联合汽车电子有限公司 High-voltage interlocking signal detection circuit and method and motor controller
CN112187507B (en) * 2020-08-21 2022-04-05 珠海格力电器股份有限公司 Fault processing method and device for bus communication network, storage medium and controller
CN112693408A (en) * 2020-12-11 2021-04-23 武汉格罗夫氢能汽车有限公司 Device and method for processing error frame of CAN (controller area network) bus of whole vehicle
CN113726598B (en) * 2021-08-20 2023-04-07 广州小鹏汽车科技有限公司 Communication method and device and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112491671A (en) * 2019-09-11 2021-03-12 广州汽车集团股份有限公司 Method and system for monitoring whole vehicle feed problem and vehicle CAN network gateway

Also Published As

Publication number Publication date
CN113726598A (en) 2021-11-30
WO2023020458A1 (en) 2023-02-23

Similar Documents

Publication Publication Date Title
US5696904A (en) Data transmission method and system therefor
CN102804698B (en) For running the method for bus system, especially CAN
JP3978617B2 (en) Safety unit input device
CN105700510A (en) Error variance detection method of CAN communication system and the CAN communication system
JP2009161148A (en) Fault location detecting device, communication device, and fault location detecting method
US20210126973A1 (en) Communication method and apparatus, and related device
CN113726598B (en) Communication method and device and electronic equipment
CN112347021A (en) Security module for serial communication device
CN111224837B (en) Method and system for automatically identifying CAN communication baud rate of vehicle ECU
CN114079591A (en) Battery management system and method for transmitting data in battery management system
JP4968169B2 (en) Communication system and communication method
CN105634894A (en) Enhanced type CAN bus data resending method and device
CN111845343B (en) Fuel oil cutting method and device, engine control module and system
CN113904723B (en) Infrared communication method and device, storage medium and electronic device
CN115913884A (en) Communication method, etherCAT system, communication device and storage medium
CN111930582A (en) System management bus detection platform, processor and system management bus detection method
JP2020061655A (en) Communication system
CN111435930B (en) Control PDU (protocol data Unit) sending method and device, electronic equipment and storage medium
CN113844315B (en) Method, device, medium, electronic equipment and server for acquiring battery pack information
CN109101359B (en) Equipment, method and module for transmitting information between equipment components and computer equipment
CN112636762A (en) Battery management system, slave control encoding method and device
CN113169908B (en) Line monitoring device and network switch
JP2018201148A (en) Communication device
WO2006030697A1 (en) Communication device, communication control method, communication control program, and computer-readable recording medium containing the communication control program
CN114500096A (en) Alarm method, system, 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
GR01 Patent grant
GR01 Patent grant