CAN bus node health degree evaluation method and device
By recording and comparing error logs in the CAN bus node, the problem of traditional diagnostic methods requiring new hardware is solved, and diagnostic accuracy and system reliability are improved.
Patent Information
- Application Number
- CN202411756722.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-02-28
AI Technical Summary
Traditional CAN node health diagnosis methods require the introduction of new hardware devices, which increases system complexity and communication logic complexity.
By recording the log of error types and error times in the CAN bus node, and using the logging system to compare the error types and error times of each node, we can judge whether the health of the node has decreased.
It reduces the system complexity and communication logic complexity, improves the accuracy of CAN node health diagnosis, and increases the reliability and security of information transmission in the CAN bus.
Smart Images

Figure CN119544455A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of communication technology, and further to the field of data processing technology, and in particular to a method and device for evaluating the health of a CAN bus node. Background Art
[0002] CAN bus communication technology is widely used in automobiles, train control systems, industrial control systems, etc. However, due to various reasons, the health of CAN nodes decreases, and various erroneous communication data frames may be frequently generated, resulting in a decrease in communication quality and affecting the normal operation of the system. In order to identify and diagnose these faults, the evaluation of CAN bus communication quality and CAN node health is generally achieved by adding hardware, collecting CAN bus waveforms, or adding special diagnostic frames.
[0003] Although these methods can realize the CAN bus communication quality evaluation, they need to introduce new hardware devices, increase the complexity of the system, or insert special data frames, which increases the complexity of the communication logic.
[0004] The present invention is based on the error types and sent error flags on each directly discovered bus, and identifies data anomalies of a certain node through error type and quantity comparison, and further determines the health problem of this node. Summary of the invention
[0005] The present invention provides a CAN bus node health evaluation method and device, which solves the technical problem that the traditional CAN node health diagnosis method needs to introduce new hardware equipment.
[0006] According to a first aspect of the present disclosure, a CAN bus node health assessment method is provided, which is applied to a CAN bus communication system, wherein the CAN bus communication system has two mutually redundant CAN buses and at least three CAN nodes, wherein at least one CAN node is used as a log recording system, and the method comprises:
[0007] Each CAN node records its own error type and the number of transmission errors of different error types in a log, and sends the log;
[0008] The log recording system compares the error types of the CAN nodes and the number of transmission errors of different error types based on the logs sent by the CAN nodes that are received and summarized, and then determines whether the health of the CAN nodes has declined.
[0009] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the error type includes:
[0010] Bit error, ACK error, stuff error, CRC error, and format error.
[0011] According to the above aspects and any possible implementation, an implementation is further provided, wherein each CAN node records its own error type and the number of transmission errors of different error types in a log, including:
[0012] When any node in the system sends a data frame as a sending node, other nodes will detect the data frame as receiving nodes;
[0013] If any receiving node in the system misjudges a received correct data frame as an error frame, an active error flag and an error frame are sent to the system and the error type and the corresponding error count are recorded in the log;
[0014] After receiving the error frame, other receiving nodes in the system will detect the current CAN bus status. If an abnormality is detected, an active error flag and an error frame will be sent to the system and the filling error and the corresponding error count will be recorded in the log;
[0015] When the sending node recognizes that the sent data is inconsistent with the read-back data, it will immediately interrupt the data frame sending and record the error type in the log and increase the corresponding error count;
[0016] When the number of misjudgments of the receiving node exceeds the preset threshold, its error frame flag will change from active to passive, and when a misjudgment occurs again, the receiving node will record the error type and increase the corresponding error number in the log again, and issue a passive error flag and error frame, but the other receiving nodes will no longer respond to this passive error flag.
[0017] According to the above aspects and any possible implementation, an implementation is further provided, wherein each CAN node records its own error type and the number of transmission errors of different error types in a log, and further includes:
[0018] When any node in the system acts as a sending node to send a data frame, other nodes, acting as receiving nodes, detect the data frame;
[0019] If the receiving node detects an error in the data frame, it sends an active error flag and an error frame to the system and records the error type and increases the corresponding error count in the log;
[0020] After receiving the active error flag and the error frame, the sending node immediately interrupts the sending of the data frame and records the error type and increases the corresponding error count in the log.
[0021] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein sending the log includes:
[0022] If a certain type of error in each CAN node reaches or exceeds a count threshold, each CAN node sends out the log; and / or
[0023] If within a set monitoring period, the number of messages on the CAN bus reaches or exceeds a preset minimum number of messages, and the number of errors of at least one CAN node is not zero, each CAN node sends out the log.
[0024] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein comparing the error type of each CAN node and the number of transmission errors of different error types, and then judging whether the health of each CAN node decreases includes:
[0025] By comparing the number of sending errors of the CAN nodes, if the number of sending errors of a certain CAN node is greater than that of other CAN nodes, and its number of sending errors accounts for more than the threshold of the number of sending errors of all CAN nodes, it is determined that the health of the CAN node has decreased.
[0026] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein the error type of each CAN node and the number of transmission errors of different error types are compared to determine whether the health of each CAN node is reduced, and further includes:
[0027] Comparing the number of transmission errors of other error types except fill errors in the CAN nodes, if the number of transmission errors of a certain CAN node in any one or more error types is greater than that of other CAN nodes, and its number of transmission errors accounts for more than the threshold of the number of transmission errors of all CAN nodes, it is determined that the health of the CAN node has decreased; and / or
[0028] By comparing the number of sending errors of the filling error type in each CAN node, if the number of sending errors of the filling error type of a certain CAN node is less than the threshold of other CAN nodes, and the difference in the number of sending errors of the filling error type in the other CAN nodes is less than the preset threshold, it is determined that the health of the CAN node has decreased.
[0029] According to a second aspect of the present disclosure, a CAN bus node health assessment device is provided.
[0030] The device includes:
[0031] The log recording module is used for each CAN node to record its own error type and the number of sending errors of different error types in the log, and send the log;
[0032] The health judgment module is used for the log recording system to compare the error types of each CAN node and the number of transmission errors of different error types based on the logs sent by each CAN node received and summarized, and then judge whether the health of each CAN node has decreased.
[0033] According to a third aspect of the present disclosure, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0034] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method according to the first aspect and / or the second aspect of the present disclosure is implemented.
[0035] In an embodiment of the present disclosure, the method is applied to a CAN bus communication system, wherein the CAN bus communication system has two mutually redundant CAN buses and at least three CAN nodes, wherein at least one CAN node serves as a log recording system, and the method comprises: first, each CAN node can record its own error type and the number of errors sent for different error types in a log, and send the log; secondly, the log recording system can compare the error type of each CAN node and the number of errors sent for different error types based on the logs received and summarized from each CAN node, and then judge whether the health of each CAN node has decreased. In this way, the problem that the traditional diagnostic method needs to introduce new hardware equipment can be solved, which not only reduces the complexity of the system and the complexity of the communication logic, but also improves the accuracy of the CAN node health diagnosis, and increases the reliability and security of information transmission in the CAN bus.
[0036] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0038] Figure 1The structure diagram of a CAN bus communication system provided by an embodiment of the present disclosure is shown.
[0039] Figure 2 A flow chart of a CAN bus node health assessment method provided by an embodiment of the present disclosure is shown;
[0040] Figure 3 A structural diagram of a CAN bus node health assessment device provided by an embodiment of the present disclosure is shown;
[0041] Figure 4 A structural diagram of an exemplary electronic device capable of implementing an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0043] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0044] In an embodiment of the present disclosure, the method is applied to a CAN bus communication system, wherein the CAN bus communication system has two mutually redundant CAN buses and at least three CAN nodes, wherein at least one CAN node serves as a log recording system, and the method comprises: first, each CAN node can record its own error type and the number of errors sent for different error types in a log, and send the log; secondly, the log recording system can compare the error type of each CAN node and the number of errors sent for different error types based on the logs received and summarized from each CAN node, and then judge whether the health of each CAN node has decreased. In this way, the problem that the traditional diagnostic method needs to introduce new hardware equipment can be solved, which not only reduces the complexity of the system and the complexity of the communication logic, but also improves the accuracy of the CAN node health diagnosis, and increases the reliability and security of information transmission in the CAN bus.
[0045] In conjunction with the accompanying drawings, a CAN bus node health assessment method and device provided by the embodiment of the present disclosure are described in detail through specific embodiments.
[0046] Figure 1 FIG. 4 shows a structural diagram of a CAN bus communication system provided by an embodiment of the present disclosure, such as Figure 1 As shown, a CAN bus communication system 100 may include:
[0047] The CAN bus communication system has two mutually redundant CAN buses and at least three CAN nodes, wherein at least one CAN node serves as a logging system.
[0048] For example, the two CAN buses are independent of each other at the physical and logical levels, ensuring that when one of the CAN buses fails, the other CAN bus can seamlessly take over the communication task, thereby ensuring the continuous operation of the system and significantly improving the reliability and fault tolerance of the system.
[0049] Exemplarily, each CAN node has independent processing capabilities and can send and receive data. These CAN nodes may include sensors, controllers, actuators, etc., which can be flexibly configured according to system requirements.
[0050] For example, the logging system can capture and record all communication activities on the CAN bus in real time, including data sending, receiving, error reporting, etc. By analyzing the aggregated log data, the system can automatically detect potential communication failures or abnormal behaviors, and issue early warnings so that operation and maintenance personnel can take timely measures.
[0051] For example, the system adopts a modular design concept, which makes it easy to add or reduce nodes and upgrade hardware or software according to actual needs; and in addition to basic point-to-point communication, the system also supports multiple communication modes such as broadcast and multicast to meet the needs of different application scenarios.
[0052] Figure 2 A flow chart of a CAN bus node health evaluation method provided by an embodiment of the present disclosure is shown, Figure 2 As shown, a CAN bus node health assessment method 200 may include the following steps:
[0053] S210, each CAN node records its own error type and the number of sending errors of different error types in a log, and sends the log.
[0054] In some embodiments, the error types include: bit error, ACK error, stuffing error, CRC error and format error.
[0055] In some embodiments, each CAN node records its own error type and the number of transmission errors of different error types in the log, including:
[0056] When any node in the system sends a data frame as a sending node, the data frame will be broadcast to the entire CAN bus. At this time, all other nodes as receiving nodes will listen and try to receive this data frame.
[0057] If any receiving node in the system misjudges a received correct data frame as an error frame, an active error flag and an error frame are sent to the system and the error type and the corresponding error count are recorded in the log;
[0058] Exemplarily, the error frame may be caused by hardware failure, software error, interference, etc.
[0059] After receiving the error frame, other receiving nodes in the system will detect the current CAN bus status. If an abnormality is detected, an active error flag and an error frame will be sent to the system and the filling error and the corresponding error count will be recorded in the log;
[0060] Exemplarily, the abnormality may be a bus short circuit, an open circuit, or signal interference.
[0061] When the sending node recognizes that the sent data is inconsistent with the read-back data, it will immediately interrupt the data frame sending and record the error type in the log and increase the corresponding error count;
[0062] When the number of misjudgments of the receiving node exceeds the preset threshold, its error frame flag will change from active to passive, and when a misjudgment occurs again, the receiving node will record the error type and increase the corresponding error number in the log again, and issue a passive error flag and error frame, but the other receiving nodes will no longer respond to this passive error flag.
[0063] In some embodiments, each CAN node records its own error type and the number of transmission errors of different error types in a log, further comprising:
[0064] When any node in the system acts as a sending node to send a data frame, other nodes, acting as receiving nodes, detect the data frame;
[0065] Exemplarily, the detection content may include: data integrity, format correctness, and CRC check code matching, etc.
[0066] If the receiving node detects an error in the data frame, it sends an active error flag and an error frame to the system and records the error type and increases the corresponding error count in the log;
[0067] After receiving the active error flag and the error frame, the sending node immediately interrupts the sending of the data frame and records the error type and increases the corresponding error count in the log.
[0068] For example, the above steps enable the CAN bus communication system to record the error type and error number of each node in real time and accurately, and take effective error handling measures, which not only improves the stability and reliability of the system, but also reduces the risk of data errors and communication failures.
[0069] In some embodiments, the sending the log includes:
[0070] If a certain type of error in each CAN node reaches or exceeds a count threshold, each CAN node sends out the log; and / or
[0071] If within a set monitoring period, the number of messages on the CAN bus reaches or exceeds a preset minimum number of messages, and the number of errors of at least one CAN node is not zero, each CAN node sends out the log.
[0072] S220, the log recording system compares the error types of the CAN nodes and the number of transmission errors of different error types based on the logs sent by the CAN nodes that are received and summarized, and then determines whether the health of the CAN nodes has decreased.
[0073] For example, the logging system will first compare the number of transmission errors of each CAN node. This step is intended to identify whether there is an abnormally high error rate of a node, which may indicate that its health is not good; if the number of transmission errors of a CAN node in the system is significantly higher than that of other nodes, and the proportion of its transmission errors exceeds the preset threshold (such as 10%, 20% of the total number of errors, etc., the specific threshold is set according to the actual situation of the system), then the system will automatically determine that the health of the node has declined.
[0074] In some embodiments, comparing the error type of each CAN node and the number of transmission errors of different error types, and then judging whether the health of each CAN node decreases includes:
[0075] By comparing the number of sending errors of the CAN nodes, if the number of sending errors of a certain CAN node is greater than that of other CAN nodes, and its number of sending errors accounts for more than the threshold of the number of sending errors of all CAN nodes, it is determined that the health of the CAN node has decreased.
[0076] For example, in addition to the basic comparison of the number of sending errors, the logging system will further analyze the error type of each CAN node and its number of sending errors.
[0077] In some embodiments, by comparing the number of transmission errors of other error types except fill errors in the CAN nodes, if the number of transmission errors of a certain CAN node in any one or more error types is greater than that of other CAN nodes, and its number of transmission errors accounts for more than the threshold of the number of transmission errors of all CAN nodes, it is determined that the health of the CAN node has decreased; and / or
[0078] By comparing the number of sending errors of the filling error type in each CAN node, if the number of sending errors of the filling error type of a certain CAN node is less than the threshold of other CAN nodes, and the difference in the number of sending errors of the filling error type in the other CAN nodes is less than the preset threshold, it is determined that the health of the CAN node has decreased.
[0079] In an embodiment of the present disclosure, the method is applied to a CAN bus communication system, wherein the CAN bus communication system has two mutually redundant CAN buses and at least three CAN nodes, wherein at least one CAN node serves as a log recording system, and the method comprises: first, each CAN node can record its own error type and the number of errors sent for different error types in a log, and send the log; secondly, the log recording system can compare the error type of each CAN node and the number of errors sent for different error types based on the logs received and summarized from each CAN node, and then judge whether the health of each CAN node has decreased. In this way, the problem that the traditional diagnostic method needs to introduce new hardware equipment can be solved, which not only reduces the complexity of the system and the complexity of the communication logic, but also improves the accuracy of the CAN node health diagnosis, and increases the reliability and security of information transmission in the CAN bus.
[0080] In conjunction with a specific embodiment, a CAN bus node health evaluation method 200 provided by the present disclosure is described in detail below, as shown below:
[0081] Step 1: Each CAN node records its own error type and the number of transmission errors of different error types in the log, where the error types include: bit error, ACK error, stuffing error, CRC error and format error;
[0082] When any node in the system sends a data frame as a sending node, other nodes as receiving nodes will detect the data frame;
[0083] If the receiving node misjudges the received correct data frame as an error frame, it will send an active error flag and error frame to the system, and record the type of "misjudgment error" and increase the corresponding error count in the log;
[0084] If the receiving node detects a data frame error (not a misjudgment), it will detect the current CAN bus status. If an abnormality is detected, it will also send an active error flag and error frame, and record the corresponding error type (such as bit error, CRC error, etc.) in the log and increase the corresponding error count;
[0085] When the sending node recognizes that the sent and read-back data are inconsistent, it will interrupt the data frame transmission, record the error type in the log and increase the corresponding error count;
[0086] When the number of misjudgments of a receiving node exceeds the preset threshold, its error frame flag will change from active to passive. When a misjudgment occurs again, the receiving node will record the error type and increase the corresponding error count in the log again, and send out a passive error flag and error frame, but other receiving nodes will no longer respond to this passive error flag.
[0087] If a certain type of error in a node reaches or exceeds a count threshold (e.g., 10 times), the log of the node is emitted; and / or
[0088] Within the set monitoring period (such as 1 hour), when the number of messages on the CAN bus reaches or exceeds the preset minimum number of messages (such as 1000), and the error count of at least one node is not zero, the node will send a log.
[0089] Step 2: The logging system will compare the number of sending errors of each node based on the logs received and summarized from each CAN node. If the number of sending errors of a node is greater than that of other nodes, and its number of sending errors accounts for more than the threshold of the number of sending errors of all nodes (such as 50%), then it is determined that the health of the node has decreased; and / or
[0090] Compare the number of sending errors of other error types except filling errors in each node. If a node has a greater number of sending errors of any one or more error types than other nodes, and the proportion also exceeds a threshold (such as 50%), then the health of the node is determined to be degraded; and / or
[0091] By comparing the number of sending errors of the filling error type in each node, if the number of filling errors of a certain node is less than the threshold of other nodes (such as 50% of the average value), and the difference in the number of filling errors of other nodes is less than the preset threshold (such as 10 times), then the health of the node is also determined to be reduced, because this means that the node may have failed to correctly detect the abnormality on the bus.
[0092] Step 3: Based on the above analysis results, the system will mark the nodes that are determined to have decreased health and trigger corresponding early warning mechanisms, such as sending alarm information to the system administrator.
[0093] Based on the alarm information, the system administrator will conduct further inspection and repair of the problem node to ensure the stable operation of the system.
[0094] Through the above method, we can evaluate the health of each CAN node in real time and accurately, and promptly detect and handle potential faults or anomalies. This not only improves the stability and reliability of the system, but also reduces the system downtime caused by node failures, thereby ensuring the normal operation of the entire CAN bus communication system.
[0095] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0096] The above is an introduction to the method embodiment. The following is a further explanation of the scheme disclosed in the present invention through an apparatus embodiment.
[0097] Figure 3 FIG. 4 shows a structural diagram of a CAN bus node health evaluation device provided by an embodiment of the present disclosure, such as Figure 3 As shown, a CAN bus node health assessment device 300 may include:
[0098] The log recording module 310 is used for each CAN node to record its own error type and the number of sending errors of different error types in a log, and send the log;
[0099] The health judgment module 320 is used for the log recording system to compare the error types of each CAN node and the number of transmission errors of different error types based on the logs sent by each CAN node received and summarized, and then judge whether the health of each CAN node has decreased.
[0100] Understandably, Figure 3 Each module / unit in the CAN bus node health evaluation device 300 shown has the following functions: Figure 2 The functions of the various steps in the CAN bus node health assessment method 200 shown can achieve their corresponding technical effects, and for the sake of brevity, they will not be repeated here.
[0101] Figure 4A block diagram of an exemplary electronic device capable of implementing an embodiment of the present disclosure is shown. Electronic device 400 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 400 may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0102] like Figure 4 As shown, the electronic device 400 may include a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0103] Multiple components in the electronic device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0104] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as method 200. For example, in some embodiments, the method 200 may be implemented as a computer program product, including a computer program, which is tangibly contained in a computer-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the method 200 in any other appropriate manner (e.g., by means of firmware).
[0105] The various embodiments described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include: being implemented in one or more computer programs, which may be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general programmable processor, which may receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0106] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0107] In the context of the present disclosure, a computer-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. A more specific example of a computer-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0108] It should be noted that the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute method 200 and achieve the corresponding technical effect achieved by the embodiments of the present disclosure executing the method. For the sake of concise description, they are not repeated here.
[0109] In addition, the present disclosure also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the method 200 is implemented.
[0110] To provide interaction with a user, the above-described embodiments may be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0111] The embodiments described above can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0112] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0113] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of this disclosure can be achieved, and this document is not limited here.
[0114] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A CAN bus node health assessment method is applied to a CAN bus communication system, wherein the CAN bus communication system has two mutually redundant CAN buses and at least three CAN nodes, wherein: At least one CAN node as a logging system, characterized by comprising: Each CAN node records its own error type and the number of transmission errors of different error types in a log, and sends the log; The log recording system compares the error types of the CAN nodes and the number of transmission errors of different error types based on the logs sent by the CAN nodes that are received and summarized, and then determines whether the health of the CAN nodes has declined.
2. The method according to claim 1, characterized in that The error types include: Bit error, ACK error, stuff error, CRC error, and format error.
3. The method according to claim 2, characterized in that Each CAN node records its own error type and the number of transmission errors of different error types in the log, including: When any node in the system sends a data frame as a sending node, other nodes will detect the data frame as receiving nodes; If any receiving node in the system misjudges a received correct data frame as an error frame, an active error flag and an error frame are sent to the system and the error type and the corresponding error count are recorded in the log; After receiving the error frame, other receiving nodes in the system will detect the current CAN bus status. If an abnormality is detected, an active error flag and an error frame will be sent to the system and the filling error and the corresponding error count will be recorded in the log; When the sending node recognizes that the sent data is inconsistent with the read-back data, it will immediately interrupt the data frame sending and record the error type in the log and increase the corresponding error count; When the number of misjudgments of the receiving node exceeds the preset threshold, its error frame flag will change from active to passive, and when a misjudgment occurs again, the receiving node will record the error type and increase the corresponding error number in the log again, and issue a passive error flag and error frame, but the other receiving nodes will no longer respond to this passive error flag.
4. The method according to claim 2 is characterized in that each CAN node records its own error type and the number of transmission errors of different error types in a log, and further comprises: When any node in the system acts as a sending node to send a data frame, other nodes, acting as receiving nodes, detect the data frame; If the receiving node detects an error in the data frame, it sends an active error flag and an error frame to the system and records the error type and increases the corresponding error count in the log; After receiving the active error flag and the error frame, the sending node immediately interrupts the sending of the data frame and records the error type and increases the corresponding error count in the log.
5. The method according to claim 2, characterized in that: The sending of the log includes: If a certain type of error in each CAN node reaches or exceeds a count threshold, each CAN node sends out the log; and / or If within a set monitoring period, the number of messages on the CAN bus reaches or exceeds a preset minimum number of messages, and the number of errors of at least one CAN node is not zero, each CAN node sends out the log.
6. The method according to claim 2, characterized in that The comparing the error types of the CAN nodes and the number of transmission errors of different error types, and then judging whether the health of the CAN nodes is reduced, comprises: By comparing the number of sending errors of the CAN nodes, if the number of sending errors of a certain CAN node is greater than that of other CAN nodes, and its number of sending errors accounts for more than the threshold of the number of sending errors of all CAN nodes, it is determined that the health of the CAN node has decreased.
7. The method according to claim 6, characterized in that The comparing the error types of the CAN nodes and the number of transmission errors of different error types, and then judging whether the health of the CAN nodes is reduced, further includes: Comparing the number of transmission errors of other error types except fill errors in the CAN nodes, if a CAN node has a greater number of transmission errors of any one or more error types than other CAN nodes, and its number of transmission errors accounts for more than a threshold of the number of transmission errors of all CAN nodes, it is determined that the health of the CAN node has decreased; and / or By comparing the number of sending errors of the filling error type in each CAN node, if the number of sending errors of the filling error type of a certain CAN node is less than the threshold of other CAN nodes, and the difference in the number of sending errors of the filling error type in the other CAN nodes is less than the preset threshold, it is determined that the health of the CAN node has decreased.
8. A CAN bus node health assessment device, characterized in that: include: The log recording module is used for each CAN node to record its own error type and the number of sending errors of different error types in the log, and send the log; The health judgment module is used for the log recording system to compare the error types of each CAN node and the number of transmission errors of different error types based on the logs sent by each CAN node received and summarized, and then judge whether the health of each CAN node has decreased.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.