Communication method of electronic control unit, storage medium, and electronic device
Patent Information
- Application Number
- CN202511261152.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2045-09-04
AI Technical Summary
然而,目前的电子控制单元的通信方法缺乏对通信安全性的考虑,导致电子控制单元的通信安全性较低
[0028]在本发明实施例中,采用响应于检测到目标车辆的任意两个电子控制单元之间存在通信链路,获取通信链路的通信数据和状态数据;基于通信数据和状态数据,对通信链路的通信状态进行评估,得到通信状态评估结果;响应于通信状态评估结果表征通信链路运行异常,基于通信数据和状态数据,确定通信链路的异常类型;基于异常类型,对通信链路进行调整,并基于调整后的通信链路,重新建立任意两个电子控制单元之间的通信的方式,通过检测目标车辆内部任意两个电子控制单元之间是否存在通信链路,确保所有潜在的通信链路都被监测到,随后,获取上述通信链路的通信数据和状态数据,为后续的通信链路状态评估提供了准确的数据基础。基于收集的上述通信数据和状态数据,对通信链路的通信状态进行评估,以及时识别上述通信链路存在异常,根据上述通信数据和状态数据,对监测到的异常进行细化,确保通信系统可以采取针对性的调整措施,使得上述调整措施可以有效地消除上述通信链路中的异常,从而使得基于调整后的通信链路建立的任意两个电子控制单元之间的通信,具备较高的安全性和稳定性,达到了有效识别并解决通信链路中各类安全隐患的目的,从而实现了提升电子控制单元的通信安全性的技术效果,进而解决了相关技术中电子控制单元的通信安全性较低的技术问题。
Smart Images

Figure CN121397012B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of vehicle technology and communication engineering, and more specifically, to a communication method, storage medium, and electronic device for an electronic control unit. Background Technology
[0002] With the rapid development of the modern vehicle industry, the level of electronification and networking within vehicles is increasing daily. Electronic Control Units (ECUs), as core components of vehicle electronic systems, are also seeing a continuous increase in number and complexity. ECUs communicate with each other through in-vehicle networks to achieve intelligent vehicle control and management. Currently, the main communication protocols used in in-vehicle networks include Controller Area Network (CAN), Local Interconnect Network (LIN), and Ethernet. Among these, CAN is widely used for data exchange in vehicle control systems due to its high reliability and real-time performance. However, current ECU communication methods lack consideration for communication security, resulting in relatively low communication security for ECUs.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This invention provides a communication method, storage medium, and electronic device for an electronic control unit, to at least solve the technical problem of low communication security of electronic control units in related technologies.
[0005] According to one aspect of the present invention, a communication method for an electronic control unit is provided, comprising: in response to detecting that a communication link exists between any two electronic control units of a target vehicle, acquiring communication data and status data of the communication link; evaluating the communication status of the communication link based on the communication data and status data to obtain a communication status evaluation result, wherein the communication status evaluation result is used to characterize whether the communication link is operating normally; in response to the communication status evaluation result characterizing that the communication link is operating abnormally, determining the abnormality type of the communication link based on the communication data and status data; adjusting the communication link based on the abnormality type, and re-establishing communication between any two electronic control units based on the adjusted communication link.
[0006] Furthermore, based on communication data and status data, the communication status of the communication link is evaluated to obtain a communication status evaluation result, including: evaluating the transmission status of the communication link based on communication data to obtain a first evaluation result, wherein the transmission status is used to characterize whether there is an error in the transmission of communication data by the communication link, and the first evaluation result is used to characterize whether there is an error in the first data content sent by the sender in any two electronic control units and the second data content received by the receiver in any two electronic control units; evaluating the operating status of the communication link based on status data to obtain a second evaluation result, wherein the operating status is used to characterize the interruption status of the transmission of communication data by the communication link, and the second evaluation result is used to characterize whether the transmission process of communication data is interrupted; and constructing a communication status evaluation result based on the first evaluation result and the second evaluation result.
[0007] Furthermore, based on the communication data, the transmission status of the communication link is evaluated to obtain a first evaluation result, including: verifying the consistency of the communication data to obtain a consistency verification result, wherein the consistency verification result is used to characterize whether the first data content and the second data content are consistent; verifying the continuity of the communication data to obtain a continuity verification result, wherein the continuity verification result is used to characterize whether the second data content is continuous; verifying the interaction time of the communication data to obtain a timeout verification result, wherein the timeout verification result is used to characterize whether the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time; and constructing the first evaluation result based on the consistency verification result, the continuity verification result, and the timeout verification result.
[0008] Further, the consistency of the communication data is verified to obtain a consistency verification result, including: processing the data bytes in the first data content through preset processing logic to obtain a first checksum; processing the data bytes in the second data content through preset processing logic to obtain a second checksum; in response to the first checksum and the second checksum being consistent, determining that the consistency verification result is that the first data content and the second data content are consistent; in response to the first checksum and the second checksum being inconsistent, determining that the consistency verification result is that the first data content and the second data content are inconsistent.
[0009] Further, the continuity of the communication data is verified to obtain a continuity verification result, including: obtaining the data number in the second data content, wherein the data number is constructed by the sender based on the sending order of the first data content; performing a continuity detection on the data number based on the receiving order of the second data content to obtain a number detection result, wherein the number detection result is used to characterize whether the continuity of the data number meets a preset condition; in response to the number detection result indicating that the continuity of the data number meets the preset condition, determining that the continuity verification result is that the second data content is continuous; in response to the number detection result indicating that the continuity of the data number does not meet the preset condition, determining that the continuity verification result is that the second data content is discontinuous.
[0010] Further, based on the receiving order of the second data content, a continuity detection of the data numbers is performed to obtain a number detection result, including: based on the receiving order, detecting the data numbers of any three adjacent second data contents to obtain a first detection result, wherein the first detection result is used to characterize whether the data numbers of any three adjacent second data contents are the same; based on the receiving order, detecting the data numbers of any two adjacent second data contents to obtain a second detection result, wherein the second detection result is used to characterize whether the difference between the data numbers of any two adjacent second data contents is greater than a preset threshold; in response to the first detection result indicating that the data numbers of any three adjacent second data contents are the same, or the second detection result indicating that the difference between the data numbers of any two adjacent second data contents is greater than the preset threshold, it is determined that the continuity of the data numbers does not meet the preset condition; in response to the first detection result indicating that the data numbers of any three adjacent second data contents are not the same, and the second detection result indicating that the difference between the data numbers of any two adjacent second data contents is less than or equal to the preset threshold, it is determined that the continuity of the data numbers meets the preset condition.
[0011] Furthermore, the interaction time of the communication data is verified to obtain a timeout verification result, including: obtaining the timeout time for the receiver to receive the second data content; in response to the receiver receiving the second data content within the timeout period, determining that the timeout verification result is that the transmission time from the sender sending the first data content to the receiver receiving the second data content does not exceed a preset time; in response to the receiver not receiving the second data content within the timeout period, determining that the timeout verification result is that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time.
[0012] Furthermore, the status data includes network operation data, feedback data sent by the receiver, and the operating voltage of the communication link. The operating status includes: network status, feedback status, and voltage status. Based on the status data, the operating status of the communication link is evaluated to obtain a second evaluation result, including: monitoring the network status of the communication link using the network operation data to obtain a network status monitoring result, wherein the network status monitoring result is used to characterize whether the network status is in a normal state; verifying the integrity of the feedback data sent by the receiver to obtain a feedback status verification result, wherein the feedback status verification result is used to characterize whether the feedback data received by the sender is missing; monitoring the voltage status of the communication link using the operating voltage of the communication link to obtain a voltage status monitoring result, wherein the voltage status monitoring result is used to characterize whether the operating voltage is within a preset voltage range; and constructing the second evaluation result based on the network status monitoring result, the feedback status monitoring result, and the voltage status monitoring result.
[0013] Furthermore, the anomaly types include transmission status anomalies and operational status anomalies. Based on the anomaly type, adjustments are made to the communication link, including: in response to an anomaly type of transmission status anomaly, replacing the communication data based on a data replacement strategy, and adjusting the communication link based on the replaced communication data; in response to an anomaly type of operational status anomaly, adjusting the operational status of the communication link based on a status adjustment strategy.
[0014] Furthermore, based on the data replacement strategy, the communication data is replaced, including: detecting the first data content and determining the operation type corresponding to the first data content, wherein the operation type is used to control the operation mode of the receiver; determining the preset data content from the preset database based on the operation type, wherein the preset database is used to store the association between the operation type and the preset data content; and replacing the first data content based on the preset data content.
[0015] Furthermore, in the event of an abnormal operating state, including network state abnormality, feedback state abnormality, and voltage state abnormality, the operating state of the communication link is adjusted based on a state adjustment strategy. This includes: adjusting the network state in response to an abnormal operating state as a network state abnormality; adjusting the feedback state in response to an abnormal operating state as a feedback state abnormality; and adjusting the voltage state in response to an abnormal operating state as a voltage state abnormality.
[0016] Furthermore, based on the network status adjustment strategy, the network status is adjusted, including: detecting the electronic control unit to determine whether the electronic control unit has a network management module; in response to the fact that both electronic control units are equipped with a network management module and both electronic control units are in a first operating mode, repeatedly executing the initialization of the communication link, and restoring the communication link after a first preset time, until the network status returns to normal, wherein the communication link does not transmit data within the first preset time; in response to the fact that either of the two electronic control units is not equipped with a network management module and either electronic control unit is in a second operating mode, repeatedly executing the initialization of the communication link within a preset number of times, and restoring the communication link after a second preset time, wherein the communication link does not transmit data within the second preset time, and the second preset time is shorter than the first preset time.
[0017] Furthermore, the process of repeatedly initializing the communication link within a preset number of times and restoring the communication link after a second preset time includes: determining that the network status has been successfully restored if the network status returns to normal within the preset number of times; and repeating the initialization of the communication link and restoring the communication link after a third preset time if the network status has not returned to normal within the preset number of times, until the network status returns to normal. During the third preset time, no data transmission occurs on the communication link. The third preset time is greater than the second preset time and less than the first preset time.
[0018] Furthermore, based on the feedback state adjustment strategy, the feedback state is adjusted, including: in response to the communication link being transmitting data and the time when the sender has not received the feedback data sent by the receiver reaching a fourth preset time, the communication link initialization is repeated, and after a fifth preset time, the communication link is restored until the sender receives the feedback data.
[0019] Furthermore, based on the voltage state adjustment strategy, the voltage state is adjusted, including: in response to the operating voltage being outside the preset voltage range, the operating voltage is adjusted so that the operating voltage is within the preset voltage range, wherein the preset voltage range is used to characterize the voltage range when the communication link is operating normally.
[0020] Furthermore, based on communication data and status data, the anomaly type of the communication link is determined, including: in response to the consistency check result indicating that the first data content and the second data content are inconsistent, or the continuity check result indicating that the second data content is discontinuous, or the timeout check result indicating that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time, the anomaly type is determined to be a transmission status anomaly; in response to the network status monitoring result indicating that the network status of the communication link is in an abnormal state, the anomaly type is determined to be a network status anomaly; in response to the feedback status check result indicating that the feedback data received by the sender is missing, the anomaly type is determined to be a feedback status anomaly; in response to the voltage status monitoring result indicating that the operating voltage of the communication link is outside the preset voltage range, the anomaly type is determined to be a voltage status anomaly.
[0021] Furthermore, the method also includes: obtaining a configuration file for the communication link, wherein the configuration file is used to construct a communication link between any two electronic control units; inputting the configuration file into a configuration parsing model, parsing the configuration file using the configuration parsing model to obtain link configuration parameters; and constructing the communication link based on the link configuration parameters.
[0022] According to another aspect of the present invention, a communication device for an electronic control unit is also provided, comprising: a first acquisition device, configured to acquire communication data and status data of the communication link in response to detecting that a communication link exists between any two electronic control units of a target vehicle; a first evaluation module, configured to evaluate the communication status of the communication link based on the communication data and status data, and obtain a communication status evaluation result, wherein the communication status evaluation result is used to characterize whether the communication link is operating normally; a first determination module, configured to determine the abnormality type of the communication link based on the communication data and status data in response to the communication status evaluation result characterizing the communication link as operating abnormally; and a first adjustment module, configured to adjust the communication link based on the abnormality type, and re-establish communication between any two electronic control units based on the adjusted communication link.
[0023] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0024] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0025] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0026] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods in various embodiments of this application.
[0027] According to another aspect of the embodiments of this application, a computer program is also provided, which, when executed by a processor, implements the methods of the various embodiments of this application.
[0028] In this embodiment of the invention, in response to the detection of a communication link between any two electronic control units (ECUs) of the target vehicle, communication data and status data of the communication link are acquired; based on the communication data and status data, the communication status of the communication link is evaluated to obtain a communication status evaluation result; in response to the communication status evaluation result indicating an abnormality in the communication link operation, the abnormality type of the communication link is determined based on the communication data and status data; based on the abnormality type, the communication link is adjusted, and based on the adjusted communication link, the communication mode between any two ECUs is re-established. By detecting whether a communication link exists between any two ECUs within the target vehicle, it is ensured that all potential communication links are monitored. Subsequently, the communication data and status data of the aforementioned communication links are acquired, providing an accurate data foundation for subsequent communication link status evaluation. Based on the collected communication and status data, the communication status of the communication link is evaluated to identify any anomalies in the communication link in a timely manner. The detected anomalies are then refined based on the communication and status data to ensure that the communication system can take targeted adjustment measures. These adjustment measures effectively eliminate the anomalies in the communication link, thereby ensuring that communication between any two electronic control units established based on the adjusted communication link has high security and stability. This achieves the goal of effectively identifying and resolving various security risks in the communication link, thus improving the communication security of the electronic control unit and solving the technical problem of low communication security of electronic control units in related technologies. Attached Figure Description
[0029] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:
[0030] Figure 1This is a flowchart of a communication method for an electronic control unit according to an embodiment of the present invention;
[0031] Figure 2 This is a flowchart of an optional communication link status detection method according to an embodiment of the present invention;
[0032] Figure 3 This is an interactive schematic diagram of an optional electronic control unit according to an embodiment of the present invention;
[0033] Figure 4 This is a schematic diagram of a communication device for an electronic control unit according to an embodiment of the present invention. Detailed Implementation
[0034] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0036] According to an embodiment of the present invention, an embodiment of a communication method for an electronic control unit is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0037] Figure 1 This is a flowchart of a communication method for an electronic control unit according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:
[0038] Step S102: In response to detecting a communication link between any two electronic control units of the target vehicle, acquire communication data and status data of the communication link.
[0039] The aforementioned electronic control unit can be a control unit used to control different subsystems of the target vehicle. For example, the aforementioned subsystems may include at least one or more of the following: engine management system, brake control system, airbag system, etc., but are not limited to these. The aforementioned electronic control unit can receive information input from sensors, process this information, and send control commands to other electronic control units to achieve precise coordinated control of vehicle components.
[0040] The aforementioned communication link can refer to the physical path used for data exchange between two or more of the aforementioned electronic control units. In the target vehicle, the aforementioned communication link can be implemented through an in-vehicle network. For example, the aforementioned communication link can be implemented using at least one or more of the following technologies: CAN, LIN, Ethernet, etc. The aforementioned communication link is responsible for transmitting data and instructions between different electronic control units and is the foundation for network communication in the target vehicle.
[0041] The aforementioned communication data can be specific data transmitted in the aforementioned communication link. For example, the aforementioned communication data may include at least one or more of the following: control signals, engine speed, throttle position, brake pressure, temperature information, alarm signals, etc., but is not limited to these. The aforementioned communication data may be digital values converted from analog signals, or it may be status information, control commands, or diagnostic data, without limitation here.
[0042] The aforementioned status data can describe the current operating status of the communication link. For example, the status data may include at least one or more of the following: communication quality of the communication link, synchronization status between electronic control units, etc., but is not limited to these. The aforementioned status data is crucial for monitoring and maintaining the health of the vehicle's electronic systems and can help the communication system of the electronic control units (hereinafter referred to as the communication system) identify potential communication problems or system failures.
[0043] In one optional embodiment, considering that the target vehicle may face various cybersecurity threats, such as malicious attacks, data tampering, and replay attacks, the communication system can analyze for abnormal data transmission behavior by acquiring communication data and status data on the communication link. This helps the communication system to promptly detect security vulnerabilities in the communication link and take defensive measures, thereby ensuring the security of the entire target vehicle's electronic system. Therefore, when the communication system detects a communication link between any two electronic control units of the target vehicle, it can immediately acquire the communication data and status data in the communication link, providing a data foundation for subsequent communication status assessment of the communication link.
[0044] For example, a communication system can pre-build a lightweight secure communication component. Utilizing the built-in CAN interface monitoring module of this component, the system continuously monitors the target CAN bus. When communication between two electronic control units (ECUs) is detected, the system can record the transmitted and received CAN frames and analyze the identification information within the CAN frames to determine which two ECUs the CAN frame belongs to on the communication link. Subsequently, the system can extract the communication data from the CAN frames and, using the real-time monitoring function of the lightweight secure communication component, obtain the status data of the communication link.
[0045] For example, the aforementioned lightweight safety communication component can be installed on the electronic control unit of the target vehicle, enabling the electronic control unit to have wireless communication capabilities. This lightweight safety communication component can periodically send communication data and status data of the communication link to the communication system. By analyzing the received communication data and status data, the communication system can assess the security and stability of the communication link.
[0046] Step S104: Based on communication data and status data, evaluate the communication status of the communication link to obtain a communication status evaluation result, wherein the communication status evaluation result is used to characterize whether the communication link is operating normally.
[0047] The aforementioned communication status assessment results refer to conclusions drawn from the analysis and evaluation of communication data and status data of the communication link, used to characterize whether the communication link is currently operating normally. These results may include a comprehensive evaluation of multiple indicators of the communication link. For example, the assessment results may include one or more of the following indicators: data transmission integrity, message timeliness, the effectiveness of the error checking mechanism, link connectivity and stability, etc., but are not limited to these. When the communication status assessment results show that all indicators of the communication link meet preset standards or thresholds, it indicates that the communication link is operating normally. Conversely, if one or more indicators fail to meet preset standards or thresholds, it indicates that the communication link has a fault, interference, or other abnormal condition, requiring further inspection and maintenance of the communication system.
[0048] In one optional embodiment, considering that by evaluating the image status of the communication link, the communication system can promptly detect potential communication faults or abnormal behaviors, such as packet loss, duplication, or disordered order, this helps to take corrective measures in the early stages of a fault, avoiding subsequent larger-scale system outages or data losses. Therefore, after acquiring the aforementioned communication data and status data, the communication system can evaluate the communication status of the communication link based on the communication data and status data, thereby determining whether the communication link is operating normally, and thus constructing the aforementioned communication status evaluation result.
[0049] For example, the communication system can utilize various error counters collected in the aforementioned lightweight secure communication components, including but not limited to message timeout error counts, checksum error counts, liveness counter error counts, and DLC (Data Length Code) error counts. If any one of these error counters exceeds a preset error threshold, it indicates an anomaly in the communication link, and the communication system can determine that the communication status assessment result is an operational anomaly. If none of the error counters exceed the preset error threshold, the communication system can determine that the communication status assessment result is a normal operation.
[0050] For example, a communication system can employ a machine learning model to evaluate the communication status of the aforementioned communication link. The system can pre-train the model using historical communication and status data to identify normal and abnormal communication patterns. In practical applications, the system can input the acquired communication and status data into the machine learning model to evaluate the communication status of the link. The machine learning model can then output the communication status evaluation result.
[0051] Step S106: In response to the communication status assessment result characterizing an abnormality in the communication link operation, determine the type of abnormality in the communication link based on the communication data and status data.
[0052] The above-mentioned anomaly types can be specific types of operational anomalies that occur in the aforementioned communication links. For example, the above-mentioned anomaly types can include at least one or more of the following: transmission status anomaly, operational status anomaly, etc., but are not limited to these.
[0053] In one optional embodiment, considering that different anomaly types (such as physical layer failures, link layer failures, network layer failures, etc.) require different solutions when a communication link malfunctions, the communication system may waste time and computing resources troubleshooting without a clearly defined anomaly type. Therefore, accurately identifying the anomaly type of the communication link can help the communication system find the root cause of the anomaly more quickly, thereby taking targeted measures to resolve the anomaly. Based on this, if the communication status assessment results indicate that the communication link is malfunctioning, the communication system can determine the specific anomaly type of the communication link based on the communication data and status data, which will help the communication system take effective measures to restore the communication link to normal operation.
[0054] For example, a communication system can build a historical anomaly database based on historical anomaly information and corresponding solutions. When the communication status assessment results indicate that the communication link is operating abnormally, the communication system can match anomaly information that is the same as or similar to the current anomaly scenario from the historical anomaly database, thereby determining the anomaly type and adopting solutions corresponding to the current anomaly type to adjust the operating status of the communication link.
[0055] For example, a communication system can pre-define multiple anomaly detection strategies to monitor for abnormal situations occurring in the current communication link. If the communication system detects that the current anomaly is the same type as any of the aforementioned anomaly detection strategies, the communication system can determine the anomaly type based on any of those strategies.
[0056] Step S108: Based on the anomaly type, adjust the communication link, and based on the adjusted communication link, re-establish communication between any two electronic control units.
[0057] In one optional embodiment, once the aforementioned anomaly type is determined, the communication system can selectively isolate or shut down the affected communication link or electronic control unit to prevent fault propagation and reduce security risks to the communication link. Therefore, the communication system can determine corresponding adjustment measures based on the aforementioned anomaly type to achieve targeted adjustments to the communication link. After completing the adjustments, the communication system can re-establish communication between any two electronic control units based on the adjusted communication link to restore normal operation of the communication link.
[0058] In this embodiment of the invention, in response to the detection of a communication link between any two electronic control units (ECUs) of the target vehicle, communication data and status data of the communication link are acquired; based on the communication data and status data, the communication status of the communication link is evaluated to obtain a communication status evaluation result; in response to the communication status evaluation result indicating an abnormality in the communication link operation, the abnormality type of the communication link is determined based on the communication data and status data; based on the abnormality type, the communication link is adjusted, and based on the adjusted communication link, the communication mode between any two ECUs is re-established. By detecting whether a communication link exists between any two ECUs within the target vehicle, it is ensured that all potential communication links are monitored. Subsequently, the communication data and status data of the aforementioned communication links are acquired, providing an accurate data foundation for subsequent communication link status evaluation. Based on the collected communication and status data, the communication status of the communication link is evaluated to identify any anomalies in the communication link in a timely manner. The detected anomalies are then refined based on the communication and status data to ensure that the communication system can take targeted adjustment measures. These adjustment measures effectively eliminate the anomalies in the communication link, thereby ensuring that communication between any two electronic control units established based on the adjusted communication link has high security and stability. This achieves the goal of effectively identifying and resolving various security risks in the communication link, thus improving the communication security of the electronic control unit and solving the technical problem of low communication security of electronic control units in related technologies.
[0059] Furthermore, based on communication data and status data, the communication status of the communication link is evaluated to obtain a communication status evaluation result, including: evaluating the transmission status of the communication link based on communication data to obtain a first evaluation result, wherein the transmission status is used to characterize whether there is an error in the transmission of communication data by the communication link, and the first evaluation result is used to characterize whether there is an error in the first data content sent by the sender in any two electronic control units and the second data content received by the receiver in any two electronic control units; evaluating the operating status of the communication link based on status data to obtain a second evaluation result, wherein the operating status is used to characterize the interruption status of the transmission of communication data by the communication link, and the second evaluation result is used to characterize whether the transmission process of communication data is interrupted; and constructing a communication status evaluation result based on the first evaluation result and the second evaluation result.
[0060] The aforementioned transmission status describes the performance of the communication link during data transmission, primarily focusing on the accuracy, integrity, and timeliness of the data during transmission. This transmission status reflects the quality of data transmission from the communication link, demonstrating whether it can deliver the sender's data to the receiver error-free, lossless, and on time.
[0061] The aforementioned first evaluation result can refer to the result obtained after evaluating the transmission status based on communication data, specifically it can be expressed as a comparative analysis between the first data content sent by the sender and the second data content received by the receiver.
[0062] The above operating status refers to the continuity and stability of the communication link during operation. It mainly focuses on whether the communication link is continuously available and whether there are interruptions during transmission, such as disconnection, bus conflict, or other phenomena that cause the communication link to malfunction.
[0063] The second evaluation result mentioned above can refer to the result obtained after evaluating the operating status based on the status data, specifically the interruption of the communication link during the transmission process.
[0064] In an optional embodiment, considering the evaluation of the transmission status of the aforementioned communication link, potential errors in the transmission of communication data can be detected. Therefore, the communication system can verify whether the communication data has maintained its original integrity and correctness during transmission by comparing the first data content sent by the sender with the second data content received by the receiver, thereby constructing the aforementioned first evaluation result. This is an important means to prevent data from being maliciously modified or corrupted due to link problems. Furthermore, considering the evaluation of the operational status of the aforementioned communication link, it is possible to detect whether the process of transmitting communication data is interrupted. This is particularly important for communication systems with extremely high real-time and security requirements, as it helps to identify whether there is physical layer damage, software failure, or network attack in the communication link. Therefore, the communication system can evaluate the operational status of the communication link based on status data to determine whether the communication data transmission is interrupted, thereby constructing the aforementioned second evaluation result. After obtaining the aforementioned first and second evaluation results, the communication system can integrate the first and second evaluation results to construct the aforementioned communication status evaluation result, forming a comprehensive view of the health status of the communication link. The above steps help the communication system more accurately determine the overall status of the communication link, thereby accurately identifying problems that require further diagnosis or repair. The communication status assessment results can distinguish whether anomalies in the communication link are caused by link transmission problems or by unstable link operation, allowing the communication system to take appropriate remedial measures to ensure the security and reliability of the communication link.
[0065] Furthermore, based on the communication data, the transmission status of the communication link is evaluated to obtain a first evaluation result, including: verifying the consistency of the communication data to obtain a consistency verification result, wherein the consistency verification result is used to characterize whether the first data content and the second data content are consistent; verifying the continuity of the communication data to obtain a continuity verification result, wherein the continuity verification result is used to characterize whether the second data content is continuous; verifying the interaction time of the communication data to obtain a timeout verification result, wherein the timeout verification result is used to characterize whether the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time; and constructing the first evaluation result based on the consistency verification result, the continuity verification result, and the timeout verification result.
[0066] The aforementioned consistency verification result can be obtained by using checksums or other similar algorithms to determine whether the communication data has not been tampered with during transmission. For example, the sender can calculate a checksum value for a dataset and append it to the data before sending it. The receiver, upon receiving the data, will also perform the same checksum calculation and compare the calculated checksum with the received checksum. If they match, it indicates that the data has maintained integrity and consistency during transmission, and the verification passes. If they do not match, it indicates that the data may have been altered during transmission, and the verification fails.
[0067] The continuity check result can be obtained by monitoring the continuity of data packets using a packet liveness counter. For example, the sender can append an incrementing counter value to each new data packet it sends. Upon receiving the data packet, the receiver can check if the counter value matches its expected value. If they match, the continuity check passes. If they don't match, it might indicate packet loss or a replay attack, and the check fails.
[0068] The timeout check result described above can be used to determine whether the sending and receiving times of communication data packets are within the expected time. For example, after the sender sends out a data packet, the receiver should receive the data packet within a preset time. If the time to receive the data packet exceeds the preset transmission duration, it is considered a timeout, and the timeout check result is a failure. Conversely, if the data packet is successfully received within the preset time, the check result is a success.
[0069] The aforementioned first data content may be the raw communication data that the sender is preparing to send. For example, the aforementioned first data content may contain valid information that needs to be processed at the receiving end. The aforementioned valid information may include at least one or more of the following: control commands, sensor data, status updates, etc., but is not limited to these.
[0070] The aforementioned second data content may be the communication data ultimately received by the receiver. Under normal communication link conditions, the second data content should be completely consistent with the aforementioned first data content. However, in actual communication, various interferences or abnormal situations may cause data changes. The aforementioned second data content serves as the basis for comparing with the first data content to assess the communication link transmission status.
[0071] In an alternative embodiment, considering that the accuracy of communication data is crucial in vehicle communication because it directly affects vehicle control and safety, for example, if the torque request signal sent by the powertrain control unit is maliciously tampered with, it may cause abnormal engine torque output, leading to serious consequences such as loss of vehicle control. By adding consistency verification information, such as a checksum, to the data content, the receiver can verify whether the received data is consistent with the sender's original data. Therefore, the communication system can verify the consistency of the communication data to determine whether the first data content sent by the sender and the second data content received by the receiver are consistent, thereby constructing the aforementioned consistency verification result.
[0072] Furthermore, considering that the data content is sent in the form of periodic messages, the order and time interval of the messages are crucial for ensuring real-time control and avoiding confusion in the vehicle's electronic systems. Therefore, the communication system can also verify the continuity of the communication data to determine whether the second data content received by the receiver is continuous, thereby constructing the aforementioned continuity verification result. For example, the sender can add an incrementing counter value to the data content. After the receiver receives the data content, it can check whether the data messages are received in order and whether there are duplicate or missing messages by comparing the counter value in each data message.
[0073] Furthermore, considering the critical importance of timeliness in vehicle communication, especially for control signals related to vehicle safety, the communication system can also use timeout checks to monitor whether data arrives at the receiving end within a preset time, ensuring the real-time nature and effectiveness of communication. Specifically, the communication system can verify the interaction time of communication data to determine whether the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time, thereby constructing the aforementioned timeout verification result.
[0074] Finally, based on the three verification results mentioned above, the communication system can construct the first evaluation result to comprehensively assess the security and reliability of data communication. This first evaluation result includes not only the integrity and tamper-proof nature of the data itself (consistency verification), the correct timing and lack of duplication in data transmission (continuity verification), but also the timeliness of data transmission (timeout verification). By comprehensively considering the verification results from these three aspects, the communication system can more accurately determine the health status of the communication link and promptly detect and respond to potential communication anomalies and security threats.
[0075] Further, the consistency of the communication data is verified to obtain a consistency verification result, including: processing the data bytes in the first data content through preset processing logic to obtain a first checksum; processing the data bytes in the second data content through preset processing logic to obtain a second checksum; in response to the first checksum and the second checksum being consistent, determining that the consistency verification result is that the first data content and the second data content are consistent; in response to the first checksum and the second checksum being inconsistent, determining that the consistency verification result is that the first data content and the second data content are inconsistent.
[0076] The aforementioned preset processing logic can be a predefined algorithm or rule used to process communication data and generate a verification value. For example, the preset processing logic can be XOR operation logic, hash value comparison, etc., but is not limited to these.
[0077] The first checksum mentioned above can be a value calculated according to the aforementioned preset processing logic, used to represent the result of the data byte set of the first data content after processing by the aforementioned preset processing logic. The first checksum mentioned above can be used to check data integrity, ensuring that the data has not been tampered with during transmission.
[0078] The second checksum can be a value calculated according to the preset processing logic. The second checksum corresponds to the second data content. By comparing the first checksum and the second checksum, it can be determined whether the communication data has maintained consistency during transmission.
[0079] In an optional embodiment, considering that any unexpected changes to the data during transmission can be detected by calculating the checksum of the data content, the aforementioned preset processing logic can be an XOR (Exclusive OR) operation or a CRC (Cyclic Redundancy Check) operation. The sender can calculate a first checksum for the data bytes in the first data content according to the aforementioned preset processing logic and attach this first checksum to the data packet containing the first data content, sending it to the receiver. After receiving the data packet, the receiver can recalculate a second checksum for the data bytes in the second data content of the data packet according to the aforementioned preset processing logic, and then compare the second checksum with the first checksum attached to the data packet. If the first checksum matches the second checksum calculated by the receiver, it indicates that the data has not been altered during transmission, and the consistency check result is that the first and second data contents are consistent. If the first checksum does not match the second checksum, it indicates that the data content may have been erroneous or tampered with during transmission, and the consistency check result is that the first and second data contents are inconsistent.
[0080] Further, the continuity of the communication data is verified to obtain a continuity verification result, including: obtaining the data number in the second data content, wherein the data number is constructed by the sender based on the sending order of the first data content; performing a continuity detection on the data number based on the receiving order of the second data content to obtain a number detection result, wherein the number detection result is used to characterize whether the continuity of the data number meets a preset condition; in response to the number detection result indicating that the continuity of the data number meets the preset condition, determining that the continuity verification result is that the second data content is continuous; in response to the number detection result indicating that the continuity of the data number does not meet the preset condition, determining that the continuity verification result is that the second data content is discontinuous.
[0081] The aforementioned data number can be a unique identifier assigned by the sender to each data or message during data transmission, reflecting the order in which the data was sent. In vehicle communication or other network communication environments, the data number can actually be designed similarly to a liveness counter, which can be a counter value that increments with the number of times communication data is sent, used to ensure that the receiver can identify the correct version of the data.
[0082] The aforementioned numbering detection result can be obtained by the receiver after performing a continuity check on the data numbers in the received second data content. If the data numbers increase as expected, the continuity detection result meets the preset condition, indicating that the data transmission is continuous and uninterrupted. Conversely, if any data number jumps, repeats, or does not conform to the increasing pattern, the continuity detection result does not meet the preset condition, indicating that abnormalities such as packet loss, replay, or tampering may have occurred during data transmission.
[0083] The aforementioned preset conditions can be pre-defined rules used to determine whether the continuity of data numbers conforms to the standards of the communication system.
[0084] In an optional embodiment, considering that the data number is generated on the sender's side, the sender can assign a unique data number to each new first data content based on the current transmission sequence. The data number can be an incrementing counter value to ensure the uniqueness of each first data content in the transmission stream. Therefore, when the second data content is received, the receiver can extract the data number from the second data content and detect the continuity of the data number based on the order of received data. This checks whether the continuity of the data number meets a preset condition, i.e., verifies whether the second data content arrived in the expected order, thereby constructing the aforementioned number detection result and determining whether there was data loss, duplication, or out-of-order transmission. If the number detection result indicates that the continuity of the data number meets the preset condition, it means that the second data content was received in the expected order without data loss, duplication, or out-of-order transmission. At this point, the receiver can determine that the second data content is complete and coherent. Conversely, if the above numbering detection result indicates that the continuity of the above data numbers does not meet the preset conditions, it indicates that there is a problem in data transmission, such as data packet loss in the network, duplication caused by data retransmission, or data being out of order during transmission. In this case, the receiver should regard the above numbering detection result as a sign of data discontinuity and take targeted measures to address the discontinuity of the second data content.
[0085] Further, based on the receiving order of the second data content, a continuity detection of the data numbers is performed to obtain a number detection result, including: based on the receiving order, detecting the data numbers of any three adjacent second data contents to obtain a first detection result, wherein the first detection result is used to characterize whether the data numbers of any three adjacent second data contents are the same; based on the receiving order, detecting the data numbers of any two adjacent second data contents to obtain a second detection result, wherein the second detection result is used to characterize whether the difference between the data numbers of any two adjacent second data contents is greater than a preset threshold; in response to the first detection result indicating that the data numbers of any three adjacent second data contents are the same, or the second detection result indicating that the difference between the data numbers of any two adjacent second data contents is greater than the preset threshold, it is determined that the continuity of the data numbers does not meet the preset condition; in response to the first detection result indicating that the data numbers of any three adjacent second data contents are not the same, and the second detection result indicating that the difference between the data numbers of any two adjacent second data contents is less than or equal to the preset threshold, it is determined that the continuity of the data numbers meets the preset condition.
[0086] The aforementioned first detection result can refer to the result of comparing the data numbers of any three consecutive second data contents to determine whether the three data numbers are completely identical. If the three data numbers are the same, it means that duplication has occurred in the data stream or that some data content has not been updated correctly. The communication system can regard the above situation as a first type of anomaly, that is, the data numbers are not unique.
[0087] The second detection result mentioned above can be the result of checking the difference between the data numbers of any two adjacent second data contents. The purpose of this check is to detect whether there are any jumps in the data stream, that is, whether the second data contents are received in sequence. If the difference between the data numbers of two adjacent second data contents exceeds a preset threshold, it means that there is a data gap or sequence interruption in the data stream, which will be regarded as a second type of anomaly, namely, the discontinuity of data numbers.
[0088] The aforementioned preset threshold can be a pre-defined value used to determine whether the difference between data numbers exceeds the normal range. This threshold typically reflects the normal sequence variation range of data packets. For example, in a data numbering system that increments by 1, the preset threshold might be 1 or 2. Any difference greater than this value will be considered abnormal, meaning the data continuity condition is not met. It should be noted that the specific values of the aforementioned preset threshold are only illustrative examples; staff can set them according to actual needs, and no limitation is imposed here.
[0089] In one optional embodiment, to ensure the integrity and continuity of message sequences in data communication, and to avoid replay attacks, message loss, or out-of-order delivery during data transmission, thereby ensuring the security and reliability of communication, the continuity of the second data content can be further verified. Specifically, the receiver can detect the data numbers of any three adjacent second data contents based on the receiving order to determine whether the data numbers of these three adjacent second data contents are the same, thus constructing the first detection result. Simultaneously, the receiver can also detect the data numbers of any two adjacent second data contents based on the receiving order to determine whether the difference between the data numbers of these two adjacent second data contents is greater than a preset threshold, thus constructing the second detection result. If the data numbers of any three adjacent second data contents are the same, it means that the second data content may have been intercepted and repeatedly sent by an attacker. Furthermore, if the difference between the data numbers of any two adjacent second data contents is greater than the preset threshold, it means that at least one or more second data contents may have failed to arrive during transmission due to network interruption or other technical problems. Both of these abnormal situations will lead to discontinuity in the second data content. Therefore, if the first detection result indicates that any three adjacent second data contents have the same data number, or the difference between the data numbers of any two adjacent second data contents is greater than the preset threshold, the receiver can determine that the number detection result indicates that the continuity of the data numbers does not meet the preset condition. Conversely, if the first detection result indicates that among all the second data contents received by the receiver, there are no three adjacent second data contents with the same data number, and the difference between the data numbers of any two adjacent second data contents is less than or equal to the preset threshold, the receiver can determine that the number detection result indicates that the continuity of the data numbers meets the preset condition.
[0090] Furthermore, the interaction time of the communication data is verified to obtain a timeout verification result, including: obtaining the timeout time for the receiver to receive the second data content; in response to the receiver receiving the second data content within the timeout period, determining that the timeout verification result is that the transmission time from the sender sending the first data content to the receiver receiving the second data content does not exceed a preset time; in response to the receiver not receiving the second data content within the timeout period, determining that the timeout verification result is that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time.
[0091] The aforementioned timeout period can be a pre-set time threshold used to determine whether the data content arrives at the receiver within the expected time. If the receiver receives the data content within the specified timeout period after it has been sent by the sender, the communication system considers the communication successful, and the transmission duration within the preset reasonable range. Conversely, if the receiver does not receive the data content by the end of the timeout period, the communication system determines that the transmission has failed, meaning the transmission duration exceeded the preset timeout period.
[0092] In one optional embodiment, to ensure the timeliness and reliability of data transmission, the communication system can verify whether the receiver's reception of the second data content has timed out. Specifically, the communication system can determine a timeout period, which can be set based on the expected transmission delay under normal communication conditions, ensuring that the second data content can be successfully received by the receiver within the timeout period under normal communication conditions. Subsequently, the communication system can determine whether the receiver has received the second data content within the timeout period. If the receiver receives the second data content within the timeout period, it indicates that the receiver's reception of the second data content has not timed out. In this case, the communication system can determine that the timeout verification result is that the transmission time from the sender sending the first data content to the receiver receiving the second data content has not exceeded the preset time. Conversely, if the receiver does not receive the second data content within the timeout period, it indicates that the receiver's reception of the second data content has timed out. In this case, the communication system can determine that the timeout verification result is that the transmission time from the sender sending the first data content to the receiver receiving the second data content has exceeded the preset time.
[0093] Furthermore, the status data includes network operation data, feedback data sent by the receiver, and the operating voltage of the communication link. The operating status includes: network status, feedback status, and voltage status. Based on the status data, the operating status of the communication link is evaluated to obtain a second evaluation result, including: monitoring the network status of the communication link using the network operation data to obtain a network status monitoring result, wherein the network status monitoring result is used to characterize whether the network status is in a normal state; verifying the integrity of the feedback data sent by the receiver to obtain a feedback status verification result, wherein the feedback status verification result is used to characterize whether the feedback data received by the sender is missing; monitoring the voltage status of the communication link using the operating voltage of the communication link to obtain a voltage status monitoring result, wherein the voltage status monitoring result is used to characterize whether the operating voltage is within a preset voltage range; and constructing the second evaluation result based on the network status monitoring result, the feedback status monitoring result, and the voltage status monitoring result.
[0094] The aforementioned network operation data can reflect the operational status of the local area network of the aforementioned communication link at the current point in time. For example, the aforementioned operation data may include at least one or more of the following: data packet transmission and reception rates, data packet loss rate, latency, error rate, network bandwidth usage, etc., but is not limited to these.
[0095] The feedback data sent by the receiver can refer to data sent by the receiver to the sender in data communication to confirm the reception status of the data. For example, the feedback data can be a simple ACK (Acknowledgement) signal, or more complex information such as CRC checksum, integrity status of received data, retransmission requests, etc., but is not limited to these.
[0096] The aforementioned operating voltage refers to the power supply voltage level of the communication link. This operating voltage directly affects the stability and data integrity of the link. For example, an excessively low operating voltage may weaken or distort the communication signal, while an excessively high operating voltage may cause equipment damage or signal interference.
[0097] The aforementioned network status can describe whether the local area network (LAN) of the aforementioned communication link is functioning normally. For example, the network status may include at least one or more of the following indicators: network connectivity, data transmission smoothness, error rate, etc., but is not limited to these. A normal network status means that the aforementioned LAN is operating stably.
[0098] The aforementioned feedback status refers to the completeness and accuracy of the feedback data received by the sender. A normal feedback status means that the receiver can receive and send back the sender's data without errors.
[0099] The voltage status mentioned above can be used to reflect whether the power supply voltage of the communication link is within a preset safety range. A normal voltage status means that the voltage level is moderate and will not affect the performance and stability of the communication link.
[0100] The network status monitoring results mentioned above can be the results of evaluating the network status of the communication link through network operation data. If the network data transmission is error-free, the latency is low, and the bandwidth usage is reasonable, then the network status monitoring results mentioned above are in a normal state.
[0101] The above feedback status verification result can be a verification result of the integrity and correctness of the data returned by the receiver. If the receiver can correctly receive the data and return valid confirmation information, then the above feedback status verification result is a normal status.
[0102] The voltage status monitoring results mentioned above can be obtained based on the monitoring of the operating voltage of the communication link. If the operating voltage is within the preset normal range, then the voltage status monitoring results are considered to be in a normal state.
[0103] In one optional embodiment, considering that network anomalies (such as link disconnection, network congestion, etc.) may lead to data transmission delays or failures, affecting real-time vehicle control and data exchange, monitoring the network status and obtaining monitoring results allows for timely detection and handling of network anomalies, ensuring the continuity and reliability of data transmission. Therefore, the communication system can utilize the aforementioned network operation data to monitor the network status of the communication link to determine whether the network status is normal, thereby constructing the aforementioned network status monitoring results to promptly detect network anomalies such as packet loss, duplicate messages, or disordered message order, thus ensuring the integrity and accuracy of data transmission.
[0104] Furthermore, considering that data tampering or corruption in vehicle communication can stem from various causes, including hardware failure, electromagnetic interference, or malicious attacks, verifying the integrity of feedback data ensures correct delivery and prevents behavioral deviations in the target vehicle's electronic systems, such as engine control errors or inaccurate braking responses, caused by data errors. Therefore, the communication system can verify the integrity of the feedback data sent by the receiver to determine if any missing data has been received by the sender, thus constructing the aforementioned feedback status verification result to prevent data tampering or corruption during transmission.
[0105] Furthermore, considering that voltage fluctuations can not only affect the normal operation of communication links but also potentially damage sensitive electronic components, monitoring the power supply voltage of the communication link ensures that it remains within a safe operating range, preventing communication anomalies or hardware damage caused by excessively high or low voltage. Therefore, the communication system can also utilize the operating voltage of the communication link to monitor its voltage status, determining whether the operating voltage is within a preset voltage range, thereby constructing the aforementioned voltage status monitoring results.
[0106] Individual network status monitoring, data integrity verification, or voltage status monitoring can only provide partial information. Combining these three aspects for evaluation allows for a more accurate assessment of the overall health of the communication link. Therefore, the communication system can integrate the results of network status monitoring, feedback status verification, and voltage status monitoring to construct the aforementioned second evaluation result, forming a comprehensive link health assessment and providing a basis for subsequent decision-making.
[0107] Furthermore, the anomaly types include transmission status anomalies and operational status anomalies. Based on the anomaly type, adjustments are made to the communication link, including: in response to an anomaly type of transmission status anomaly, replacing the communication data based on a data replacement strategy, and adjusting the communication link based on the replaced communication data; in response to an anomaly type of operational status anomaly, adjusting the operational status of the communication link based on a status adjustment strategy.
[0108] The aforementioned transmission status anomalies can occur during data communication. For example, these anomalies may include at least one or more of the following: packet loss, data delay exceeding normal range, excessive data retransmissions, data sequence disorder, and illegal data tampering, but are not limited to these. These transmission status anomalies directly affect the integrity and timeliness of data, thereby impairing the stable operation of the communication system.
[0109] The aforementioned operational anomalies can be any abnormalities that occur during the operation of the communication link or system. For example, these anomalies may include at least one or more of the following: communication system crash, restart, hardware failure, software error, resource exhaustion (such as insufficient memory), decreased link bandwidth, unstable connection, etc., but are not limited to these. These operational anomalies may be caused by various internal or external factors, affecting the availability and reliability of the communication system.
[0110] The aforementioned data replacement strategy can be implemented by selectively replacing abnormal data with preset or calculated default values, safety values, or historical values when an abnormal transmission status is detected, in order to maintain the basic functional operation of the target vehicle's current subsystem. This data replacement strategy can ensure that the basic functions of the target vehicle's current subsystem are not severely affected, while also avoiding the potential harm caused by abnormal data.
[0111] The aforementioned state adjustment strategies can be tactics employed by the communication system in response to abnormal operating conditions, used to restore the communication link to normal operation or degrade it to a limited functionality mode. For example, these state adjustment strategies may include at least one or more of the following: restarting services or modules in the communication link, switching to an alternative communication path, limiting communication frequency, reducing unnecessary data exchange, and activating redundant systems, but are not limited to these. The purpose of these state adjustment strategies is to protect the communication link from further damage while maintaining its basic operational capabilities as much as possible.
[0112] In an optional embodiment, considering that the aforementioned data content includes control commands or parameters for the electronic control unit, when the anomaly type is a transmission status anomaly, the communication system needs to take targeted measures to prevent the electronic control parameters, as the receiving end, from operating with incorrect commands or parameters, thereby causing the target vehicle's operating status to deviate from the user's expectations. Therefore, when the aforementioned anomaly type is a transmission status anomaly, to ensure data integrity and security, the communication system can adopt a data replacement strategy, replacing the damaged data with default or alternative values, and adjusting the communication link based on the replaced communication data. This ensures that even in the event of data anomalies, the electronic control unit, as the receiving end, can continue to operate with limited functionality, avoiding the paralysis of the entire target vehicle due to a single data problem.
[0113] Furthermore, considering that the aforementioned operational anomalies may involve issues with the electronic control unit's own status or abnormal states of the communication link, such as excessively high temperature of the electronic control unit, abnormal power supply voltage, or physical layer failure of the link, the communication system can adjust the operating status of the communication link to restore it to normal operation. Specifically, based on the aforementioned status adjustment strategy, the communication system can adjust the communication link according to the severity and type of the transmission status anomaly, such as increasing the number of data packet retransmissions, changing the transmission rate, or using redundant links. This adjustment helps restore normal communication of the link, reduces data transmission latency and bit error rate, ensures smooth communication between various electronic control units within the vehicle, and improves the overall system stability and response speed.
[0114] Furthermore, based on the data replacement strategy, the communication data is replaced, including: detecting the first data content and determining the operation type corresponding to the first data content, wherein the operation type is used to control the operation mode of the receiver; determining the preset data content from the preset database based on the operation type, wherein the preset database is used to store the association between the operation type and the preset data content; and replacing the first data content based on the preset data content.
[0115] The aforementioned operation types can be instructions or tags used in data communication to tell the receiver how to process the received data. For example, each operation type corresponds to a different operating mode or response strategy, so that the receiver can respond appropriately according to the data type received in different communication environments.
[0116] The aforementioned preset database can be a pre-defined data structure or data storage system that stores the association between operation types and preset data content. In this preset database, each operation type is associated with one or more preset data contents, which serve as backup data to replace the original data under different operation types. The purpose of this preset database is to quickly provide alternative data in the event of data transmission anomalies or security threats, thereby maintaining the stability and security of the target vehicle's current subsystem.
[0117] The aforementioned preset data content can refer to data prepared in advance to cope with the current operation type. For example, the aforementioned preset data content may include at least one or more of the following: default values, safety values, or alternative data that can ensure the basic operation of the system under abnormal conditions, but is not limited to these.
[0118] In an optional embodiment, when the aforementioned anomaly type is a transmission status anomaly, the communication system needs to analyze the sender's transmission intention to determine which replacement value the receiver should use to replace the aforementioned abnormal data. Therefore, the communication system can detect the first data content to analyze the sender's desired control method for the receiver's operation, thereby determining the operation type corresponding to the aforementioned first data content to reduce the possibility of misoperation. After determining the operation type, the communication system can select the preset data content corresponding to the aforementioned operation type from the preset database based on the correlation between the operation types and preset data content stored in the preset database, and replace the aforementioned first data content based on the preset data content.
[0119] Furthermore, in the event of an abnormal operating state, including network state abnormality, feedback state abnormality, and voltage state abnormality, the operating state of the communication link is adjusted based on a state adjustment strategy. This includes: adjusting the network state in response to an abnormal operating state as a network state abnormality; adjusting the feedback state in response to an abnormal operating state as a feedback state abnormality; and adjusting the voltage state in response to an abnormal operating state as a voltage state abnormality.
[0120] The aforementioned network status anomalies can be any anomalies occurring in the local area network of the aforementioned communication link. For example, the aforementioned status anomalies can include at least one or more of the following: communication link failure, packet loss, packet duplication, packet out of order, unauthorized access attempts, or network congestion, but are not limited to these.
[0121] The aforementioned feedback status anomaly refers to an abnormality in the receiver's response or acknowledgment to the sender during communication. In a normal communication process, the sender expects acknowledgment from the receiver after sending data. If the receiver fails to provide acknowledgment in a timely manner, or if the acknowledgment information is incorrect, this constitutes the aforementioned feedback status anomaly. For example, the aforementioned feedback status anomaly can be caused by at least one or more of the following conditions: network latency, hardware failure, software error, or malicious attack, but is not limited to these.
[0122] The aforementioned voltage anomaly can occur when the power supply voltage of the communication link exceeds a predetermined safe range. For example, the voltage anomaly could be too high or too low. Such an anomaly can affect the normal operation of the electronic control unit, leading to data transmission errors, unstable data transmission, or hardware damage.
[0123] The aforementioned network status adjustment strategy can be a set of processing solutions designed to address the detected network status anomalies. For example, the strategy may include at least one or more of the following: reinitializing the network interface, switching to a backup communication link, adjusting the data transmission rate, enhancing data encryption, adding a packet retransmission mechanism, or executing a fault recovery procedure, but is not limited to these. The purpose of the aforementioned network status adjustment strategy is to restore the normal operation of the network in the communication link, ensuring the accuracy and timeliness of data transmission.
[0124] The aforementioned feedback state adjustment strategy refers to the measures taken by the communication system when an abnormal feedback state is detected, in order to correct the abnormality and restore communication reliability. For example, the aforementioned feedback state adjustment strategy may include at least one or more of the following: retransmitting data packets, adding error checking mechanisms, adjusting data transmission protocols, or implementing self-checking and repair mechanisms for the communication link, but is not limited to these. The implementation of the aforementioned feedback state adjustment strategy helps ensure data integrity and communication continuity.
[0125] The aforementioned voltage status adjustment strategy can be a series of measures taken by the communication system when an abnormal voltage status is detected, to protect the communication link from damage while maintaining its basic functions as much as possible. For example, the voltage status adjustment strategy may include at least one or more of the following: suspending or limiting the operation of sensitive components, activating the voltage monitoring and alarm system, activating the voltage adjustment module, or executing an emergency shutdown procedure, but is not limited to these. By implementing the aforementioned voltage status adjustment strategy, communication link failures caused by abnormal voltage can be avoided, ensuring the safe and stable operation of the communication link.
[0126] In an optional embodiment, considering that the abnormal operation of the communication link may be caused by various factors, in order to ensure the recovery rate of the abnormal communication link state, the communication system can adopt corresponding adjustment strategies for different abnormal operation types to quickly reduce the impact of abnormal communication link operation on the overall function of the communication system. Therefore, the communication system can first determine the abnormal type of the current operation state. If the abnormal operation state is a network state abnormality, the communication system can adjust the network state of the communication link based on the network state adjustment strategy corresponding to the network state abnormality. For example, the communication system can try to quickly reinitialize the network controller, stop sending messages for a short period of time, and then resume sending to restore normal communication as soon as possible. Alternatively, when the network state remains unstable, a longer recovery time can be used to avoid communication jitter caused by frequent reinitialization.
[0127] If the aforementioned operational anomaly is a feedback anomaly, the communication system can adjust the feedback state of the communication link based on the corresponding feedback state adjustment strategy. For example, the communication system tracks the feedback state of each message, records the number of feedback failures, to assess the health of the communication link. Furthermore, when the feedback state anomaly reaches a certain threshold, the communication controller can be reinitialized to attempt to restore the normal feedback mechanism.
[0128] If the aforementioned operational anomaly is a voltage anomaly, the communication system can adjust the voltage state based on the corresponding voltage state adjustment strategy. For example, the communication system can continuously monitor the power supply voltage, define high and low voltage thresholds, and when the voltage exceeds the normal range, start the corresponding recovery timer or directly disable the communication function.
[0129] Furthermore, based on the network status adjustment strategy, the network status is adjusted, including: detecting the electronic control unit to determine whether the electronic control unit has a network management module; in response to the fact that both electronic control units are equipped with a network management module and both electronic control units are in a first operating mode, repeatedly executing the initialization of the communication link, and restoring the communication link after a first preset time, until the network status returns to normal, wherein the communication link does not transmit data within the first preset time; in response to the fact that either of the two electronic control units is not equipped with a network management module and either electronic control unit is in a second operating mode, repeatedly executing the initialization of the communication link within a preset number of times, and restoring the communication link after a second preset time, wherein the communication link does not transmit data within the second preset time, and the second preset time is shorter than the first preset time.
[0130] The aforementioned network management module may be a software or hardware module embedded in the aforementioned electronic control unit, used to manage network communication between electronic control units. For example, the functions of the aforementioned network management module may include at least one or more of the following: detecting network faults, executing recovery strategies, and maintaining the health status of the network, but are not limited to these.
[0131] The first operating mode described above can be the operating state of the electronic control unit under normal working conditions. In this mode, the electronic control unit is equipped with a network management module and is able to execute all predetermined network management and security functions. In this mode, the electronic control unit can receive and send data, and simultaneously monitor and manage the network status.
[0132] The aforementioned first preset time can be the time during which the electronic control unit, upon detecting a network anomaly or fault, stops data transmission and reinitializes the communication link according to the instructions of the network management module. This time is typically relatively long to ensure that the network can fully recover and to avoid further problems caused by restarting before the communication link is fully stable.
[0133] The second operating mode described above can be the operating state of the electronic control unit when the network management module is not configured or the network management module has limited functionality. In this mode, the electronic control unit may only perform basic communication functions.
[0134] The preset number of attempts refers to the number of times the electronic control unit attempts to reinitialize the communication link after detecting a network anomaly. This preset number is designed to quickly attempt to restore the network within a short period, avoiding prolonged communication interruptions, while also preventing infinitely looping restart attempts.
[0135] The second preset time can be similar to the first preset time, but is used for electronic control units that do not have a network management module or have limited network management functions, to stop data transmission and reinitialize the communication link. The second preset time is shorter than the first preset time, with the aim of quickly attempting to restore communication within a limited time to reduce the impact on normal vehicle operation.
[0136] In one alternative embodiment, the communication system determines the recovery measures to be taken for the electronic control unit (ECU) based on whether it has network management capabilities. The presence of a network management module means that the ECU can more proactively monitor and manage network status and execute more complex fault recovery strategies. Therefore, the communication system can detect whether each ECU is equipped with a network management module. ECUs equipped with a network management module can perform more detailed and time-consuming fault detection and recovery steps, while ECUs without such a module require a faster and simpler fault recovery process.
[0137] If both of the aforementioned electronic control units are equipped with network management modules, and both electronic control units are in the first operating mode, the communication system can execute a slow recovery strategy. Specifically, the communication system can repeatedly initialize the communication link and, after a first preset time, restore the communication link until the network status returns to normal. The aforementioned first preset time allows the aforementioned electronic control units sufficient time to ensure that all network statuses return to normal.
[0138] If either of the aforementioned electronic control units (ECUs) is not equipped with a network management module, and either ECU is in the second operating mode, the communication system can adopt a fast recovery strategy. Specifically, the communication system can repeatedly initialize the communication link within a preset number of times, and restore the communication link after a second preset time. Compared to the first preset time, the second preset time is set shorter, which means reduced resource consumption and allows for more effective network recovery for resource-constrained ECUs or in emergency situations.
[0139] Furthermore, the process of repeatedly initializing the communication link within a preset number of times and restoring the communication link after a second preset time includes: determining that the network status has been successfully restored if the network status returns to normal within the preset number of times; and repeating the initialization of the communication link and restoring the communication link after a third preset time if the network status has not returned to normal within the preset number of times, until the network status returns to normal. During the third preset time, no data transmission occurs on the communication link. The third preset time is greater than the second preset time and less than the first preset time.
[0140] The aforementioned third preset time can be the time during which the communication system attempts to stop data transmission and reinitialize the communication link again after stopping data transmission and reinitializing the communication link within a preset number of times based on the aforementioned second preset time, if the network status still cannot be restored to normal.
[0141] In an optional embodiment, considering that the fast recovery strategy may still fail to restore the network state within a preset number of attempts, the communication system needs to adopt a second-stage recovery strategy to further restore the network state. First, the communication system needs to evaluate the recovery effect of the fast recovery strategy; that is, the communication system can determine whether the network state has returned to normal within the preset number of attempts. If the network state returns to normal within the preset number of attempts, the communication system can determine that the network state has been successfully restored and no further recovery operations are needed. If the network state does not return to normal within the preset number of attempts, it indicates that the fast recovery strategy is ineffective. In this case, the communication system can adopt a medium recovery strategy to restore the network state. Specifically, the communication system can repeatedly initialize the communication link and restore the communication link after a third preset time until the network state returns to normal. The third preset time is shorter than the first preset time but longer than the second preset time, allowing the communication system to execute a longer non-communication state when the fast recovery strategy fails to solve the problem, providing more time to wait for voltage or link failure recovery, and also avoiding hardware wear and tear that may result from frequent restarts.
[0142] Furthermore, based on the feedback state adjustment strategy, the feedback state is adjusted, including: in response to the communication link being transmitting data and the time when the sender has not received the feedback data sent by the receiver reaching a fourth preset time, the communication link initialization is repeated, and after a fifth preset time, the communication link is restored until the sender receives the feedback data.
[0143] The aforementioned fourth preset time can be the time limit for the sender to wait for feedback from the receiver. If the sender does not receive confirmation or feedback data from the receiver within the aforementioned fourth preset time, the communication system can consider that there is a problem with the communication link. At this time, the communication system can perform a link initialization operation to attempt to re-establish a stable communication connection.
[0144] The aforementioned fifth preset time can be the time the sender waits to transmit data after the communication link is initialized. This fifth preset time is set to avoid immediately transmitting data when the link is unstable, which could lead to data loss or errors. After the fifth preset time has elapsed, if the link is considered to have stabilized, the sender will resume data transmission and continue monitoring the feedback status until it successfully receives feedback data from the receiver.
[0145] In an optional embodiment, after the sender transmits the first data content, it can wait for confirmation or feedback from the receiver. If the sender does not receive feedback from the receiver within the aforementioned fourth preset time, it means that the first data content may have been lost, tampered with, or the receiver may have failed to receive the data correctly during transmission. In this case, the communication system can repeatedly initialize the communication link and, after the aforementioned fifth preset time, restore the communication link until the sender receives feedback data, thereby improving the security of data transmission.
[0146] Furthermore, based on the voltage state adjustment strategy, the voltage state is adjusted, including: in response to the operating voltage being outside the preset voltage range, the operating voltage is adjusted so that the operating voltage is within the preset voltage range, wherein the preset voltage range is used to characterize the voltage range when the communication link is operating normally.
[0147] The aforementioned preset voltage range can be the battery voltage range required for the normal operation of the communication link. For example, the preset voltage range can be defined by two thresholds. When the battery voltage is lower than a first voltage threshold or higher than a second voltage threshold, the communication system will adjust the operating state of the communication link to protect its stability and security.
[0148] In one optional embodiment, the electronic devices and communication modules in the target vehicle are designed to operate within a safe voltage range. Exceeding this range may lead to hardware instability or even damage. For example, insufficient voltage may be unable to drive circuits or components, resulting in communication failure or data transmission errors. Excessive voltage, on the other hand, may burn out sensitive components. Therefore, the communication system can monitor the operating voltage. If the operating voltage is outside the preset range, it means that the current operating voltage has exceeded the safe range, and the communication system needs to adjust the operating voltage to bring it within the preset range. This ensures the normal operation of the communication link and maintains the stability and reliability of the vehicle network.
[0149] Furthermore, based on communication data and status data, the anomaly type of the communication link is determined, including: in response to the consistency check result indicating that the first data content and the second data content are inconsistent, or the continuity check result indicating that the second data content is discontinuous, or the timeout check result indicating that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time, the anomaly type is determined to be a transmission status anomaly; in response to the network status monitoring result indicating that the network status of the communication link is in an abnormal state, the anomaly type is determined to be a network status anomaly; in response to the feedback status check result indicating that the feedback data received by the sender is missing, the anomaly type is determined to be a feedback status anomaly; in response to the voltage status monitoring result indicating that the operating voltage of the communication link is outside the preset voltage range, the anomaly type is determined to be a voltage status anomaly.
[0150] In an optional embodiment, in order to accurately identify and classify the specific types of communication anomalies in the communication system, and then take appropriate measures to deal with these anomalies, ensuring the reliability, security, and stability of communication and the system, the communication system needs to specifically distinguish the current anomaly types. Specifically, if the consistency check result in the aforementioned steps indicates that the first data content and the second data content are inconsistent, this indicates that the data may have been interfered with or maliciously attacked during transmission. If the continuity check result in the aforementioned steps indicates that the second data content is discontinuous, this indicates that the communication data has been subjected to a replay attack or lost during transmission. If the timeout check result in the aforementioned steps indicates that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time, this indicates that the communication link has failed, such as being blocked, experiencing high latency, or being completely interrupted. In this case, the communication system can determine that the above anomaly types are transmission status anomalies.
[0151] If the network status monitoring results in the aforementioned steps indicate that the network status of the above communication link is abnormal, it indicates that the above communication link may have experienced a serious network failure, such as bus conflict, hardware failure, or software error. In this case, the communication system can identify the above abnormality type as a network status anomaly.
[0152] If the feedback status verification result in the aforementioned steps indicates that the feedback data received by the sender is missing, it indicates that there may be a one-way failure in the above communication link or that the receiver has failed to process the message correctly, resulting in the inability to establish an information loop. In this case, the communication system can identify the above-mentioned abnormal type as a feedback status abnormality.
[0153] If the voltage status monitoring results in the aforementioned steps indicate that the operating voltage of the communication link is outside the preset voltage range, it means that the communication system needs to identify and take measures to adjust the power supply or suspend communication in a timely manner. At this time, the communication system can determine the above-mentioned abnormality type as a voltage status abnormality.
[0154] Furthermore, the method also includes: obtaining a configuration file for the communication link, wherein the configuration file is used to construct a communication link between any two electronic control units; inputting the configuration file into a configuration parsing model, parsing the configuration file using the configuration parsing model to obtain link configuration parameters; and constructing the communication link based on the link configuration parameters.
[0155] The configuration file described above can be a text file or a binary file, and it can contain the various parameters and settings required to establish a communication link. For example, the configuration file can be a DBC file (Database Connection File, CAN database file), but it is not limited to this.
[0156] The configuration parsing model described above can refer to a logical framework, algorithm, or program used to interpret and process configuration files. This model can identify various parameter labels and values in the configuration file and convert this information into a format that the program can understand and execute, such as data structures or objects.
[0157] The aforementioned link configuration parameters can be key attributes and settings that constitute the communication link. These parameters are specific values or identifiers parsed from the configuration file. For example, the aforementioned link configuration parameters may include at least one or more of the following: message name, message ID (Identifier), message length, period, transmission type, checksum information, liveness counter information, etc., but are not limited to these.
[0158] In an optional embodiment, considering that the configuration file contains all the necessary information for communication between the electronic control units, including but not limited to the electronic control unit's identifier, communication protocol type, communication frequency, data format, and communication path, obtaining the configuration file helps the communication system understand and define the basic framework and rules of the communication link. Therefore, the communication system can obtain the configuration file corresponding to the communication link. After obtaining the configuration file, in order to read and understand its structure and semantics and convert unstructured text information into structured link configuration parameters, the communication system can input the configuration file into the configuration parsing model and use the configuration parsing model to parse the configuration file, thereby obtaining the link configuration parameters. The configuration parsing model can automate the processing of the configuration file, reducing manual intervention and avoiding inconsistencies caused by subjective differences in interpreting the configuration file. After obtaining the link configuration parameters, the communication system can establish the actual communication link based on the link configuration parameters.
[0159] For ease of understanding, Figure 2 This is a flowchart of an optional communication link state detection method according to an embodiment of the present invention, such as... Figure 2 As shown, when the target vehicle starts, the communication system first wakes up the network management bus, a prerequisite for its operation. During this phase, the communication system prepares to receive signals from the bus and prepares for subsequent communication security checks. Subsequently, the communication system performs initialization, activating various security checks to ensure comprehensive monitoring of the communication link and content security. After initialization, the communication system can enter the COM (Communication Module) diagnostic idle state, where it can begin monitoring voltage status to ensure operation within the normal voltage range. If an abnormal voltage is detected, the system can enter an overvoltage or undervoltage state to implement appropriate protective measures and restore the voltage status. If the voltage monitoring is normal, the system can enter the COM diagnostic startup state. If this is the first time the system is started, it can enter a delayed startup state to ensure all necessary electronic control units are correctly initialized, preventing communication from starting before the system is fully ready and reducing potential communication anomalies. After the delayed startup, the system can enter the COM diagnostic working state to continuously perform communication security checks. In this COM diagnostic working state, the communication system closely monitors the health of the communication link. Specifically, the communication system continuously monitors the BusOff state, an abnormal state in which the bus is shut down. When the BusOff state is detected as abnormal, the communication system immediately acquires the current BusOff state and adopts a fast or medium recovery strategy to attempt to reinitialize the CAN controller and restore communication capabilities. If the BusOff state is detected three times consecutively, and communication fails to recover successfully during this period, the component sets the corresponding global variable flag to notify the application software of the BusOff state anomaly. If the above BusOff state monitoring is normal, the communication system can acquire the Rx (Receiver) message Timeout detection status and monitor the NoACK (No Acknowledgment) status of received messages to ensure that each sent message is acknowledged by the receiver. When the above NoACK status detection is normal, the communication system can acquire the Rx message reception detection status to check the integrity and accuracy of the Rx message content. If the above NoACK status detection is abnormal, the communication system can acquire the current NoACK status and take targeted measures.
[0160] Figure 3 This is an interactive schematic diagram of an optional electronic control unit according to an embodiment of the present invention, such as... Figure 3As shown, ECU1 and ECU2 represent any two electronic control units within the target vehicle. APP (Application) represents the application layer, located at the top level of each electronic control unit, responsible for handling high-level applications related to vehicle functions. COM represents the communication management component, responsible for coordinating and managing communication between electronic control units. SafetyOC (SafetyOver CAN) represents a lightweight safety communication component, used to enhance communication security, located below the COM component. PDUR (Process Data Unit Router) is responsible for routing process data between different communication layers. CANIF (Controller Area Network Interface) is used to handle interaction with the physical CAN bus. CAN represents the basic protocol of the vehicle communication network. IoHwAb / ADC (Input Output Hardware Abstraction / Analog-to-Digital Converter) represents the input / output hardware abstraction layer and analog-to-digital converter, used to manage the hardware input / output and voltage management of the electronic control units.
[0161] exist Figure 3 In the process, the application layer sends communication requests, such as sending or receiving data commands, to the communication management component through an interface. The communication management component then forwards the communication requests to the lightweight safety communication component for security processing. At this stage, SafetyOC may add safety-related fields to the message or perform necessary security checks. The processed data is routed via PDUR, delivering the data packets to the appropriate CAN interface component. The data packets are prepared and sent to the CAN bus via the CAN interface component. The CAN interface component interacts with the physical layer's CAN bus, sending or receiving data packets from the bus. The CAN bus layer communicates with the internal hardware of the electronic control unit (ECU) through the microcontroller's hardware abstraction layer. Finally, the data packets are sent or received by the ECU hardware and the CAN bus to other ECUs throughout the vehicle network.
[0162] According to an embodiment of this application, a communication device for an electronic control unit is provided. It should be noted that this device can be used to execute the communication method of the aforementioned electronic control unit. The specific implementation and application scenarios are the same as in the above embodiment, and will not be repeated here. Figure 4 This is a schematic diagram of a communication device for an electronic control unit according to an embodiment of the present invention, such as... Figure 4 As shown, the device includes:
[0163] The first acquisition device 402 is used to acquire communication data and status data of the communication link in response to detecting that a communication link exists between any two electronic control units of the target vehicle.
[0164] The first evaluation module 404 is used to evaluate the communication status of the communication link based on communication data and status data, and obtain the communication status evaluation result, wherein the communication status evaluation result is used to characterize whether the communication link is operating normally.
[0165] The first determining module 406 is used to determine the type of communication link anomaly based on communication data and status data in response to the communication status assessment result characterizing the communication link operation anomaly.
[0166] The first adjustment module 408 is used to adjust the communication link based on the anomaly type, and to re-establish communication between any two electronic control units based on the adjusted communication link.
[0167] Furthermore, the first evaluation module is also used to: evaluate the transmission status of the communication link based on communication data to obtain a first evaluation result, wherein the transmission status is used to characterize whether there is an error in the transmission of communication data by the communication link, and the first evaluation result is used to characterize whether there is an error in the first data content sent by the sender in any two electronic control units and the second data content received by the receiver in any two electronic control units; evaluate the operating status of the communication link based on status data to obtain a second evaluation result, wherein the operating status is used to characterize the interruption status of the transmission of communication data by the communication link, and the second evaluation result is used to characterize whether the transmission process of communication data is interrupted; and construct a communication status evaluation result based on the first evaluation result and the second evaluation result.
[0168] Furthermore, the first evaluation module is also used to: verify the consistency of the communication data to obtain a consistency verification result, wherein the consistency verification result is used to characterize whether the first data content and the second data content are consistent; verify the continuity of the communication data to obtain a continuity verification result, wherein the continuity verification result is used to characterize whether the second data content is continuous; verify the interaction time of the communication data to obtain a timeout verification result, wherein the timeout verification result is used to characterize whether the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time; and construct a first evaluation result based on the consistency verification result, the continuity verification result, and the timeout verification result.
[0169] Furthermore, the first evaluation module is also used to: process the data bytes in the first data content through preset processing logic to obtain a first checksum; process the data bytes in the second data content through preset processing logic to obtain a second checksum; in response to the first checksum being consistent with the second checksum, determine that the consistency check result is consistent between the first data content and the second data content; in response to the first checksum being inconsistent with the second checksum, determine that the consistency check result is inconsistent between the first data content and the second data content.
[0170] Furthermore, the first evaluation module is also used to: obtain the data number in the second data content, wherein the data number is constructed by the sender based on the sending order of the first data content; perform continuity detection on the data number based on the receiving order of the second data content to obtain a number detection result, wherein the number detection result is used to characterize whether the continuity of the data number meets a preset condition; in response to the number detection result indicating that the continuity of the data number meets the preset condition, determine that the continuity verification result is that the second data content is continuous; in response to the number detection result indicating that the continuity of the data number does not meet the preset condition, determine that the continuity verification result is that the second data content is discontinuous.
[0171] Furthermore, the first evaluation module is also used to: detect the data numbers of any three adjacent second data contents based on the receiving order to obtain a first detection result, wherein the first detection result is used to characterize whether the data numbers of any three adjacent second data contents are the same; detect the data numbers of any two adjacent second data contents based on the receiving order to obtain a second detection result, wherein the second detection result is used to characterize whether the difference between the data numbers of any two adjacent second data contents is greater than a preset threshold; in response to the first detection result indicating that the data numbers of any three adjacent second data contents are the same, or the second detection result indicating that the difference between the data numbers of any two adjacent second data contents is greater than the preset threshold, determine that the number detection result indicates that the continuity of the data numbers does not meet the preset condition; in response to the first detection result indicating that the data numbers of any three adjacent second data contents are not the same, and the second detection result indicating that the difference between the data numbers of any two adjacent second data contents is less than or equal to the preset threshold, determine that the number detection result indicates that the continuity of the data numbers meets the preset condition.
[0172] Furthermore, the first evaluation module is also used to: obtain the timeout period for the receiver to receive the second data content; in response to the receiver receiving the second data content within the timeout period, determine that the timeout verification result is that the transmission time from the sender sending the first data content to the receiver receiving the second data content does not exceed the preset time; in response to the receiver not receiving the second data content within the timeout period, determine that the timeout verification result is that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds the preset time.
[0173] Furthermore, the status data includes network operation data, feedback data sent by the receiver, and the operating voltage of the communication link. The operating status includes: network status, feedback status, and voltage status. The first evaluation module is also used to: monitor the network status of the communication link using the network operation data to obtain a network status monitoring result, wherein the network status monitoring result is used to characterize whether the network status is in a normal state; verify the integrity of the feedback data sent by the receiver to obtain a feedback status verification result, wherein the feedback status verification result is used to characterize whether the feedback data received by the sender is missing; monitor the voltage status of the communication link using the operating voltage of the communication link to obtain a voltage status monitoring result, wherein the voltage status monitoring result is used to characterize whether the operating voltage is within a preset voltage range; and construct a second evaluation result based on the network status monitoring result, the feedback status monitoring result, and the voltage status monitoring result.
[0174] Furthermore, the anomaly types include transmission status anomalies and operational status anomalies. The first adjustment module is also used to: in response to an anomaly type of transmission status anomaly, replace the communication data based on a data replacement strategy, and adjust the communication link based on the replaced communication data; in response to an anomaly type of operational status anomaly, adjust the operational status of the communication link based on a status adjustment strategy.
[0175] Furthermore, the first adjustment module is also used to: detect the first data content, determine the operation type corresponding to the first data content, wherein the operation type is used to control the operation mode of the receiver; determine the preset data content from the preset database based on the operation type, wherein the preset database is used to store the association between the operation type and the preset data content; and replace the first data content based on the preset data content.
[0176] Furthermore, in the event of an abnormal operating state, including network state abnormality, feedback state abnormality, and voltage state abnormality, the first adjustment module is also used to: adjust the network state based on a network state adjustment strategy in response to an abnormal operating state as a network state abnormality; adjust the feedback state based on a feedback state adjustment strategy in response to an abnormal operating state as a feedback state abnormality; and adjust the voltage state based on a voltage state adjustment strategy in response to an abnormal operating state as a voltage state abnormality.
[0177] Furthermore, the first adjustment module is also used to: detect the electronic control unit to determine whether the electronic control unit has a network management module; in response to the fact that both electronic control units are equipped with a network management module and both electronic control units are in a first operating mode, repeatedly execute the initialization of the communication link and restore the communication link after a first preset time until the network status returns to normal, wherein the communication link does not transmit data during the first preset time; in response to the fact that neither of the two electronic control units is equipped with a network management module and either electronic control unit is in a second operating mode, repeatedly execute the initialization of the communication link within a preset number of times and restore the communication link after a second preset time, wherein the communication link does not transmit data during the second preset time, and the second preset time is shorter than the first preset time.
[0178] Furthermore, the first adjustment module is also used to: determine that the network status has been successfully restored if the network status returns to normal within a preset number of times; and repeatedly execute the initialization of the communication link if the network status has not returned to normal within a preset number of times, and restore the communication link after a third preset time until the network status returns to normal, wherein the communication link does not transmit data during the third preset time, wherein the third preset time is greater than the second preset time and less than the first preset time.
[0179] Furthermore, the first adjustment module is also used to: in response to the communication link being transmitting data and the time during which the sender has not received feedback data sent by the receiver reaching a fourth preset time, repeatedly execute the initialization of the communication link, and after a fifth preset time, restore the communication link until the sender receives feedback data.
[0180] Furthermore, the first adjustment module is also used to: adjust the operating voltage in response to the operating voltage being outside the preset voltage range, so that the operating voltage is within the preset voltage range, wherein the preset voltage range is used to characterize the voltage range when the communication link is operating normally.
[0181] Furthermore, the first determining module is also configured to: determine the anomaly type as a transmission status anomaly in response to a consistency check result indicating that the first data content and the second data content are inconsistent, or a continuity check result indicating that the second data content is discontinuous, or a timeout check result indicating that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time; determine the anomaly type as a network status anomaly in response to a network status monitoring result indicating that the network status of the communication link is in an abnormal state; determine the anomaly type as a feedback status anomaly in response to a feedback status check result indicating that the feedback data received by the sender is missing; and determine the anomaly type as a voltage status anomaly in response to a voltage status monitoring result indicating that the operating voltage of the communication link is outside a preset voltage range.
[0182] Furthermore, the device also includes: a second acquisition module for acquiring a configuration file of the communication link, wherein the configuration file is used to construct a communication link between any two electronic control units; a first parsing module for inputting the configuration file into a configuration parsing model and using the configuration parsing model to parse the configuration file to obtain link configuration parameters; and a first construction module for constructing the communication link based on the link configuration parameters.
[0183] Embodiments of this application also provide an electronic device, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0184] Embodiments of this application also provide a computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0185] Embodiments of this application also provide a computer program product, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0186] Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium for storing a computer program that, when executed by a processor, implements the methods in various embodiments of this application.
[0187] Embodiments of this application also provide a computer program that, when executed by a processor, implements the methods described in the various embodiments of this application.
[0188] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0189] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0190] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.
[0191] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0192] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0193] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0194] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A communication method for an electronic control unit, characterized in that, include: In response to the detection of a communication link between any two electronic control units of the target vehicle, the communication data and status data of the communication link are acquired; Based on the communication data and the status data, the communication status of the communication link is evaluated to obtain a communication status evaluation result. The communication status evaluation result is used to characterize whether the communication link is operating normally. The status data includes network operation data, feedback data sent by the receiver, and the operating voltage of the communication link. In response to the communication status assessment result indicating an abnormality in the communication link operation, the abnormality type of the communication link is determined based on the communication data and the status data; Based on the type of anomaly, the communication link is adjusted, and based on the adjusted communication link, communication between any two electronic control units is re-established. Specifically, based on the communication data and the status data, the communication status of the communication link is evaluated to obtain a communication status evaluation result, including: Based on the communication data, the transmission status of the communication link is evaluated to obtain a first evaluation result; The network status of the communication link is monitored using the network operation data to obtain network status monitoring results, wherein the network status monitoring results are used to characterize whether the network status is in a normal state. The integrity of the feedback data sent by the receiver is verified to obtain a feedback status verification result, wherein the feedback status verification result is used to characterize whether the feedback data received by the sender is missing. The voltage status of the communication link is monitored using the operating voltage of the communication link to obtain a voltage status monitoring result, wherein the voltage status monitoring result is used to characterize whether the operating voltage is within a preset voltage range; Based on the network status monitoring results, the feedback status monitoring results, and the voltage status monitoring results, a second evaluation result is constructed; Based on the first evaluation result and the second evaluation result, the communication status evaluation result is constructed; The adjustment of the communication link based on the anomaly type includes: In response to the exception type being a transmission status exception, the communication data is replaced based on a data replacement strategy, and the communication link is adjusted based on the replaced communication data; In response to the exception type being an operational status exception, the operational status of the communication link is adjusted based on the status adjustment strategy; The adjustment of the operating state of the communication link based on the state adjustment strategy includes: In response to the abnormal operating status being a network status abnormality, the electronic control unit is detected to determine whether the electronic control unit has a network management module; In response to the fact that both of the electronic control units are equipped with a network management module and both of the electronic control units are in the first operating mode, the communication link is repeatedly initialized and restored after a first preset time until the network status returns to normal. During the first preset time, the communication link does not transmit data. In response to the fact that either of the two electronic control units is not equipped with a network management module and that either electronic control unit is in the second operating mode, the communication link is initialized repeatedly within a preset number of times, and the communication link is restored after a second preset time. The communication link does not transmit data during the second preset time, and the second preset time is less than the first preset time.
2. The communication method of the electronic control unit according to claim 1, characterized in that, The transmission status is used to characterize whether there is an error in the transmission of the communication data by the communication link, and the first evaluation result is used to characterize whether there is an error between the first data content sent by the sender in any two electronic control units and the second data content received by the receiver in any two electronic control units. The operating status is used to characterize the interruption status of the communication link in transmitting the communication data, and the second evaluation result is used to characterize whether the transmission process of the communication data is interrupted.
3. The communication method of the electronic control unit according to claim 2, characterized in that, Based on the communication data, the transmission status of the communication link is evaluated to obtain a first evaluation result, including: The consistency of the communication data is verified to obtain a consistency verification result, wherein the consistency verification result is used to characterize whether the first data content and the second data content are consistent; The continuity of the communication data is verified to obtain a continuity verification result, wherein the continuity verification result is used to characterize whether the second data content is continuous; The interaction time of the communication data is verified to obtain a timeout verification result, wherein the timeout verification result is used to characterize whether the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time. The first evaluation result is constructed based on the consistency check result, the continuity check result, and the timeout check result.
4. The communication method of the electronic control unit according to claim 3, characterized in that, The consistency of the communication data is verified to obtain a consistency verification result, including: By processing the data bytes in the first data content through preset processing logic, a first checksum is obtained; The data bytes in the second data content are processed through the preset processing logic to obtain the second checksum; In response to the first checksum being consistent with the second checksum, the consistency check result is determined to be that the first data content and the second data content are consistent. In response to the inconsistency between the first checksum and the second checksum, the consistency check result is determined to be that the first data content and the second data content are inconsistent.
5. The communication method of the electronic control unit according to claim 3, characterized in that, The continuity of the communication data is verified to obtain a continuity verification result, including: Obtain the data number in the second data content, wherein the data number is constructed by the sender based on the sending order of the first data content; Based on the receiving order of the second data content, the continuity of the data number is detected to obtain the number detection result, wherein the number detection result is used to characterize whether the continuity of the data number meets the preset conditions. In response to the number detection result indicating that the continuity of the data number meets a preset condition, the continuity verification result is determined to be that the second data content is continuous; In response to the number detection result indicating that the continuity of the data number does not meet the preset condition, the continuity verification result is determined to be that the second data content is not continuous.
6. The communication method of the electronic control unit according to claim 5, characterized in that, Based on the receiving order of the second data content, a continuity detection is performed on the data number to obtain the number detection result, including: Based on the receiving order, the data numbers of any three adjacent second data contents are detected to obtain a first detection result, wherein the first detection result is used to characterize whether the data numbers of the three adjacent second data contents are the same. Based on the receiving order, the data numbers of any two adjacent second data contents are detected to obtain a second detection result, wherein the second detection result is used to characterize whether the difference between the data numbers of any two adjacent second data contents is greater than a preset threshold. In response to the first detection result indicating that the data numbers of any three adjacent second data contents are the same, or the second detection result indicating that the difference between the data numbers of any two adjacent second data contents is greater than the preset threshold, the number detection result is determined to be that the continuity of the data numbers does not meet the preset condition. In response to the first detection result indicating that the data numbers of any three adjacent second data contents are different, and the second detection result indicating that the difference between the data numbers of any two adjacent second data contents is less than or equal to the preset threshold, the number detection result is determined to be that the continuity of the data numbers satisfies the preset condition.
7. The communication method of the electronic control unit according to claim 3, characterized in that, The interaction time of the communication data is verified to obtain a timeout verification result, including: Obtain the timeout period for the receiver to receive the second data content; In response to the receiver receiving the second data content within the timeout period, the timeout verification result is determined to be that the transmission time from the sender sending the first data content to the receiver receiving the second data content does not exceed the preset time. If the receiver does not receive the second data content within the timeout period, the timeout verification result is determined to be that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time.
8. The communication method of the electronic control unit according to claim 1, characterized in that, The communication data is replaced based on a data replacement strategy, including: The first data content is detected to determine the operation type corresponding to the first data content, wherein the operation type is used to control the operation mode of the receiver; Based on the operation type, preset data content is determined from a preset database, wherein the preset database is used to store the association between the operation type and the preset data content; Replace the first data content with the preset data content.
9. The communication method of the electronic control unit according to claim 1, characterized in that, Based on the state adjustment strategy, adjusting the operating state of the communication link further includes: In response to the abnormal operating state being a feedback state abnormality, the feedback state is adjusted based on the feedback state adjustment strategy; In response to the abnormal operating state being a voltage state abnormality, the voltage state is adjusted based on a voltage state adjustment strategy.
10. The communication method of the electronic control unit according to claim 1, characterized in that, The process of repeatedly initializing the communication link within a preset number of times, and restoring the communication link after a second preset time, includes: If the network status returns to normal within the preset number of times, it is determined that the network status recovery was successful. If the network status does not return to normal within the preset number of times, the initialization of the communication link is repeated, and the communication link is restored after a third preset time until the network status returns to normal. During the third preset time, the communication link does not transmit data. The third preset time is greater than the second preset time and less than the first preset time.
11. The communication method of the electronic control unit according to claim 9, characterized in that, Based on the feedback state adjustment strategy, the feedback state is adjusted, including: In response to the communication link being transmitting data and the sender not receiving feedback data from the receiver for a fourth preset time, the communication link is initialized repeatedly, and after a fifth preset time, the communication link is restored until the sender receives the feedback data.
12. The communication method of the electronic control unit according to claim 9, characterized in that, The voltage state is adjusted based on a voltage state adjustment strategy, including: In response to the operating voltage being outside the preset voltage range, the operating voltage is adjusted to bring it within the preset voltage range, wherein the preset voltage range characterizes the voltage range during normal operation of the communication link.
13. The communication method of the electronic control unit according to claim 9, characterized in that, Based on the communication data and the status data, the anomaly type of the communication link is determined, including: In response to the consistency check result indicating that the first data content and the second data content are inconsistent, or the continuity check result indicating that the second data content is not continuous, or the timeout check result indicating that the transmission time from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time, the abnormality type is determined to be a transmission status abnormality. In response to the network status monitoring results indicating that the network status of the communication link is in an abnormal state, the abnormality type is determined to be a network status abnormality. In response to the feedback status verification result indicating that the feedback data received by the sender is missing, the anomaly type is determined to be a feedback status anomaly. In response to the voltage status monitoring results indicating that the operating voltage of the communication link is outside the preset voltage range, the abnormality type is determined to be a voltage status abnormality.
14. The communication method of the electronic control unit according to claim 1, characterized in that, The method further includes: Obtain the configuration file of the communication link, wherein the configuration file is used to construct the communication link between any two electronic control units; The configuration file is input into the configuration parsing model, and the configuration parsing model is used to parse the configuration file to obtain the link configuration parameters; The communication link is constructed based on the link configuration parameters.
15. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the execution of the method according to any one of claims 1 to 14 in the processor of the device.
16. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors perform the method according to any one of claims 1 to 14.
Citation Information
Patent Citations
Vehicle-mounted Ethernet link state identification method, device, equipment, medium, product and vehicle
CN119728478A
