Communication method of electronic control unit, storage medium and electronic equipment
By detecting and evaluating the communication links between electronic control units, identifying anomalies and making adjustments, the problem of low communication security of electronic control units was solved, achieving higher security and stability.
Patent Information
- Application Number
- CN202511261152.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-04
- Publication Date
- 2026-01-23
AI Technical Summary
The communication security of existing electronic control units is low, and there is a lack of effective solutions.
By detecting the communication link between electronic control units, communication data and status data are acquired, the communication status is evaluated, the anomaly type is identified, and adjustments are made based on the anomaly type to re-establish the communication link.
It improves the security and stability of communication between electronic control units and effectively identifies and resolves security risks in the communication link.
Smart Images

Figure CN121397012A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicle technology and communication engineering, in particular to a communication method of an electronic control unit, a storage medium and an electronic device. BACKGROUND
[0002] With the rapid development of the modern vehicle industry, the degree of electrification and networking within vehicles is increasing, and the number and complexity of electronic control units (ECU) as the core components of vehicle electronic systems are also increasing. Electronic control units communicate with each other through the vehicle network to achieve intelligent control and management of the vehicle. Currently, the communication protocols mainly used by vehicle networks include Controller Area Network (CAN), Local Interconnect Network (LIN) and Ethernet, among which CAN is widely used in vehicle control system data exchange due to its high reliability and real-time performance. However, the current communication method of electronic control units lacks consideration of communication security, resulting in low communication security of electronic control units.
[0003] In view of the above problems, no effective solutions have been proposed so far. SUMMARY
[0004] The embodiments of the present application provide a communication method of an electronic control unit, a storage medium and an electronic device to at least solve the technical problem of low communication security of electronic control units in the related art.
[0005] According to an aspect of the embodiments of the present application, a communication method of an electronic control unit is provided, comprising: in response to detecting that there is a communication link between any two electronic control units of a target vehicle, obtaining communication data and state data of the communication link; based on the communication data and the state data, evaluating the communication state of the communication link to obtain a communication state evaluation result, wherein the communication state evaluation result is used to represent whether the communication link is running normally; in response to the communication state evaluation result representing that the communication link is running abnormally, determining an abnormal type of the communication link based on the communication data and the state data; based on the abnormal type, adjusting the communication link, and re-establishing the communication between any two electronic control units based on the adjusted communication link.
[0006] Further, based on the communication data and the state data, a communication state of the communication link is evaluated to obtain a communication state evaluation result, including: based on the communication data, a transmission state of the communication link is evaluated to obtain a first evaluation result, wherein the transmission state is used to represent whether there is an error in the transmission of the communication data by the communication link, and the first evaluation result is used to represent 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; based on the state data, an operating state of the communication link is evaluated to obtain a second evaluation result, wherein the operating state is used to represent an interruption state of the transmission of the communication data by the communication link, and the second evaluation result is used to represent whether the transmission process of the communication data is interrupted; and based on the first evaluation result and the second evaluation result, the communication state evaluation result is constructed.
[0007] Further, based on the communication data, a transmission state of the communication link is evaluated to obtain a first evaluation result, including: consistency of the communication data is checked to obtain a consistency check result, wherein the consistency check result is used to represent whether the first data content and the second data content are consistent; continuity of the communication data is checked to obtain a continuity check result, wherein the continuity check result is used to represent whether the second data content is continuous; and interaction time of the communication data is checked to obtain a timeout check result, wherein the timeout check result is used to represent whether a transmission time length from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time length; and based on the consistency check result, the continuity check result, and the timeout check result, the first evaluation result is constructed.
[0008] Further, consistency of the communication data is checked to obtain a consistency check result, including: data bytes in the first data content are processed by a preset processing logic to obtain a first check sum; data bytes in the second data content are processed by the preset processing logic to obtain a second check sum; in response to the first check sum being consistent with the second check sum, it is determined that the consistency check result is that the first data content and the second data content are consistent; and in response to the first check sum being inconsistent with the second check sum, it is determined that the consistency check result is that the first data content and the second data content are inconsistent.
[0009] Further, the continuity of the communication data is checked to obtain a continuity checking result, including: obtaining data numbers in the second data content, wherein the data numbers are constructed by the sender based on a sending sequence of the first data content; performing continuity detection on the data numbers based on a receiving sequence of the second data content to obtain a number detection result, wherein the number detection result is used to represent whether the continuity of the data numbers meets a preset condition; in response to the number detection result representing that the continuity of the data numbers meets the preset condition, determining that the continuity checking result is that the second data content is continuous; and in response to the number detection result representing that the continuity of the data numbers does not meet the preset condition, determining that the continuity checking result is that the second data content is discontinuous.
[0010] Further, the continuity of the communication data is checked to obtain a continuity checking result, including: obtaining data numbers in the second data content, wherein the data numbers are constructed by the sender based on a sending sequence of the first data content; performing continuity detection on the data numbers based on a receiving sequence of the second data content to obtain a number detection result, wherein the number detection result is used to represent whether the continuity of the data numbers meets a preset condition; in response to the number detection result representing that the continuity of the data numbers meets the preset condition, determining that the continuity checking result is that the second data content is continuous; and in response to the number detection result representing that the continuity of the data numbers does not meet the preset condition, determining that the continuity checking result is that the second data content is discontinuous.
[0011] Further, the interaction time of the communication data is checked to obtain a timeout checking result, including: obtaining a timeout time for the receiver to receive the second data content; in response to the receiver receiving the second data content within the timeout time, determining that the timeout checking result is that a transmission time length from sending the first data content by the sender to receiving the second data content by the receiver does not exceed a preset time length; and in response to the receiver not receiving the second data content within the timeout time, determining that the timeout checking result is that the transmission time length from sending the first data content by the sender to receiving the second data content by the receiver exceeds the preset time length.
[0012] Further, the state data comprises network operation data, feedback data sent by the receiving party, and operation voltage of the communication link, and the operation state comprises a network state, a feedback state, and a voltage state; based on the state data, the operation state of the communication link is evaluated to obtain a second evaluation result, comprising: using the network operation data to monitor the network state of the communication link to obtain a network state monitoring result, wherein the network state monitoring result is used to represent whether the network state is in a normal state; checking the integrity of the feedback data sent by the receiving party to obtain a feedback state checking result, wherein the feedback state checking result is used to represent whether the feedback data received by the sending party is missing; using the operation voltage of the communication link to monitor the voltage state of the communication link to obtain a voltage state monitoring result, wherein the voltage state monitoring result is used to represent whether the operation voltage is in a preset voltage range; based on the network state monitoring result, the feedback state monitoring result, and the voltage state monitoring result, the second evaluation result is constructed.
[0013] Further, the abnormal type comprises a transmission state abnormality and an operation state abnormality, and based on the abnormal type, the communication link is adjusted, comprising: in response to the abnormal type being a transmission state abnormality, 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 abnormal type being an operation state abnormality, the operation state of the communication link is adjusted based on a state adjustment strategy.
[0014] Further, based on the data replacement strategy, the communication data is replaced, comprising: detecting the first data content to determine an operation type corresponding to the first data content, wherein the operation type is used to control the operation mode of the receiving party; based on the operation type, determining preset data content from a preset database, wherein the preset database is used to store the association relationship between the operation type and the preset data content; and replacing the first data content based on the preset data content.
[0015] Further, the operation state abnormality comprises a network state abnormality, a feedback state abnormality, and a voltage state abnormality, and based on the state adjustment strategy, the operation state of the communication link is adjusted, comprising: in response to the operation state abnormality being a network state abnormality, the network state is adjusted based on a network state adjustment strategy; in response to the operation state abnormality being a feedback state abnormality, the feedback state is adjusted based on a feedback state adjustment strategy; and in response to the operation state abnormality being a voltage state abnormality, the voltage state is adjusted based on a voltage state adjustment strategy.
[0016] Further, the network state is adjusted based on the network state adjustment strategy, including: detecting the electronic control unit to determine whether the electronic control unit has a network management module; in response to any two electronic control units being configured with a network management module and any two electronic control units being in a first running mode, repeatedly performing initialization of the communication link, and resuming the communication link after a first preset time until the network state returns to normal, wherein the communication link does not perform data transmission within the first preset time; in response to any one of the any two electronic control units not being configured with a network management module and any one of the any two electronic control units being in a second running mode, repeatedly performing initialization of the communication link within a preset number of times, and resuming the communication link after a second preset time, wherein the communication link does not perform data transmission within the second preset time, and the second preset time is less than the first preset time.
[0017] Further, the network state is adjusted based on the network state adjustment strategy, including: detecting the electronic control unit to determine whether the electronic control unit has a network management module; in response to any two electronic control units being configured with a network management module and any two electronic control units being in a first running mode, repeatedly performing initialization of the communication link, and resuming the communication link after a first preset time until the network state returns to normal, wherein the communication link does not perform data transmission within the first preset time; in response to any one of the any two electronic control units not being configured with a network management module and any one of the any two electronic control units being in a second running mode, repeatedly performing initialization of the communication link within a preset number of times, and resuming the communication link after a second preset time, wherein the communication link does not perform data transmission within the second preset time, and the second preset time is less than the first preset time.
[0018] Further, the network state is adjusted based on the network state adjustment strategy, including: detecting the electronic control unit to determine whether the electronic control unit has a network management module; in response to any two electronic control units being configured with a network management module and any two electronic control units being in a first running mode, repeatedly performing initialization of the communication link, and resuming the communication link after a first preset time until the network state returns to normal, wherein the communication link does not perform data transmission within the first preset time; in response to any one of the any two electronic control units not being configured with a network management module and any one of the any two electronic control units being in a second running mode, repeatedly performing initialization of the communication link within a preset number of times, and resuming the communication link after a second preset time, wherein the communication link does not perform data transmission within the second preset time, and the second preset time is less than the first preset time.
[0019] Further, the network state is adjusted based on the network state adjustment strategy, including: detecting the electronic control unit to determine whether the electronic control unit has a network management module; in response to any two electronic control units being configured with a network management module and any two electronic control units being in a first running mode, repeatedly performing initialization of the communication link, and resuming the communication link after a first preset time until the network state returns to normal, wherein the communication link does not perform data transmission within the first preset time; in response to any one of the any two electronic control units not being configured with a network management module and any one of the any two electronic control units being in a second running mode, repeatedly performing initialization of the communication link within a preset number of times, and resuming the communication link after a second preset time, wherein the communication link does not perform data transmission within the second preset time, and the second preset time is less than the first preset time.
[0020] Further, based on the communication data and the state data, the type of the abnormality 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 length from the sending of the first data content by the sending party to the receiving of the second data content by the receiving party exceeds the preset time length, determining that the type of the abnormality is a transmission state abnormality; in response to the network state monitoring result indicating that the network state of the communication link is in an abnormal state, determining that the type of the abnormality is a network state abnormality; in response to the feedback state check result indicating that the feedback data received by the sending party is missing, determining that the type of the abnormality is a feedback state abnormality; and in response to the voltage state monitoring result indicating that the operating voltage of the communication link is outside the preset voltage range, determining that the type of the abnormality is a voltage state abnormality.
[0021] Further, the method further includes: obtaining a configuration file of the communication link, wherein the configuration file is used to construct the communication link between any two electronic control units; inputting the configuration file into a configuration parsing model, and parsing the configuration file by 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 embodiments of the present application, an electronic control unit communication device is also provided, including: first obtaining means for obtaining communication data and state data of a communication link in response to detecting that there is a communication link between any two electronic control units of a target vehicle; a first evaluation module for evaluating the communication state of the communication link based on the communication data and the state data to obtain a communication state evaluation result, wherein the communication state evaluation result is used to indicate whether the communication link is operating normally; a first determination module for determining the type of the abnormality of the communication link based on the communication data and the state data in response to the communication state evaluation result indicating that the communication link is operating abnormally; and a first adjustment module for adjusting the communication link based on the type of the abnormality and reestablishing the communication between any two electronic control units based on the adjusted communication link.
[0023] According to another aspect of the embodiments of the present application, an electronic device is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program performs the method in various embodiments of the present application when running.
[0024] According to another aspect of the embodiments of the present application, a computer readable storage medium is also provided, including a stored executable program, wherein the computer readable storage medium controls the device where the computer readable storage medium is located to perform the method in various embodiments of the present application when the executable program runs.
[0025] According to a further aspect of the embodiments of the present application, a computer program product is provided, including a computer program, which, when executed by a processor, implements the method in any of the embodiments of the present application.
[0026] According to a further aspect of the embodiments of the present application, a computer program product is provided, including a non-volatile computer readable storage medium storing a computer program, which, when executed by a processor, implements the method in any of the embodiments of the present application.
[0027] According to a further aspect of the embodiments of the present application, a computer program is provided, which, when executed by a processor, implements the method in any of the embodiments of the present application.
[0028] In the embodiments of the present application, in response to detecting that there is a communication link between any two electronic control units of the target vehicle, communication data and state data of the communication link are acquired; based on the communication data and the state data, the communication state of the communication link is evaluated to obtain a communication state evaluation result; in response to the communication state evaluation result representing that the communication link is running abnormally, based on the communication data and the state data, an abnormal type of the communication link is determined; based on the abnormal type, the communication link is adjusted, and based on the adjusted communication link, the communication between any two electronic control units is re-established. By detecting whether there is a communication link between any two electronic control units inside the target vehicle, it is ensured that all potential communication links are monitored, and then the communication data and the state data of the above communication link are acquired, thereby providing an accurate data basis for subsequent communication link state evaluation. Based on the collected communication data and state data, the communication state of the communication link is evaluated to identify abnormalities in the communication link in a timely manner, and based on the communication data and the state data, the monitored abnormalities are refined to ensure that the communication system can take targeted adjustment measures, so that the adjustment measures can effectively eliminate the abnormalities in the communication link, thereby ensuring that the communication between any two electronic control units established based on the adjusted communication link has high safety and stability, achieving the purpose of effectively identifying and solving various safety hazards in the communication link, thereby realizing the technical effect of improving the communication safety of the electronic control unit, and further solving the technical problem of low communication safety of the electronic control unit in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0029] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application. In the drawings:
[0030] Figure 1is a flow chart of a communication method of an electronic control unit according to an embodiment of the present application;
[0031] Figure 2 is a flow chart of an optional status detection of a communication link according to an embodiment of the present application;
[0032] Figure 3 is an interaction diagram of an optional electronic control unit according to an embodiment of the present application;
[0033] Figure 4 is a schematic diagram of a communication device of an electronic control unit according to an embodiment of the present application. DETAILED DESCRIPTION
[0034] In order to make the persons skilled in the art better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all the other embodiments obtained by the persons skilled in the art without creative labor should belong to the protection scope of the present application.
[0035] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not have to be limited to the clearly listed steps or units, but can include other steps or units not clearly listed or inherent to the process, method, product or device.
[0036] According to an embodiment of the present application, an embodiment of a communication method of an electronic control unit is provided. It should be noted that the steps shown in the flow chart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flow chart, in some cases, the steps shown or described herein can be executed in an order different from that shown herein.
[0037] Figure 1 is a flow chart of a communication method of an electronic control unit according to an embodiment of the present application, as shown in Figure 1 the method comprises the following steps:
[0038] Step S102, in response to detecting that there is a communication link between any two electronic control units of the target vehicle, obtaining communication data and state data of the communication link.
[0039] The electronic control unit described above can be a control unit for controlling different subsystems of the target vehicle described above. For example, the subsystems described above can include at least one or more of the following: engine management system, brake control system, airbag system, etc., but not limited to. The electronic control unit described above can receive sensor input information, process these information, and send control commands to other electronic control units to achieve precise coordination control of vehicle components.
[0040] The communication link described above can refer to the physical path for data exchange between two or more electronic control units described above. In the target vehicle described above, the communication link can be implemented through the vehicle network. For example, the communication link described above can be implemented through at least one or more of the following technologies: CAN, LIN, Ethernet, etc. The communication link described above is responsible for transmitting data and instructions between different electronic control units, and is the basis for network communication of the target vehicle.
[0041] The communication data described above can be specific data transmitted in the communication link described above. For example, the communication data described above can include at least one or more of the following: control signal, engine speed, throttle position, brake pressure, temperature information, alarm signal, etc., but not limited to. The communication data described above can be a digital value converted from an analog signal, or state information, control commands or diagnostic data, which is not limited here.
[0042] The state data described above can be data describing the current working state of the communication link described above. For example, the state data described above can include at least one or more of the following: communication quality of the communication link, synchronization state between electronic control units, etc., but not limited to. The state data described above is crucial for monitoring and maintaining the health of the vehicle's electronic system, and can help the communication system of the electronic control unit (hereinafter referred to as the communication system) identify potential communication problems or system failures.
[0043] In an optional embodiment, considering that the target vehicle described above may face various network security threats, such as malicious attacks, data tampering, replay attacks, etc. By obtaining the communication data and state data on the communication link, the communication system can analyze whether there is abnormal data transmission behavior, thereby helping the communication system to discover security vulnerabilities in the communication link in a timely manner and take measures to defend, and thus protect the safety of the entire electronic system of the target vehicle. Therefore, when the communication system detects that there is a communication link between any two electronic control units of the target vehicle described above, the communication system can immediately obtain the communication data and state data in the communication link described above, providing a data basis for subsequent communication state evaluation of the communication link.
[0044] For example, the communication system can pre-construct a lightweight security communication component, utilize the CAN interface monitoring module built-in the lightweight security communication component to continuously monitor the target CAN bus, when detecting the communication between two electronic control units, the communication system can record the transmitted and received CAN frames, and can analyze the identity information in the CAN frames to determine which two electronic control units the CAN frames belong to. Subsequently, the communication system can extract the communication data in the CAN frames, and at the same time, utilize the real-time monitoring function of the lightweight security communication component to obtain the state data of the communication link.
[0045] For another example, the lightweight security communication component can be installed on the electronic control unit of the target vehicle, so that the electronic control unit on the target vehicle has wireless communication capability. The lightweight security communication component can periodically send the communication data and state data of the communication link to the communication system, and through analyzing the received communication data and state data, the communication system can evaluate the security and stability of the communication link.
[0046] Step S104, based on the communication data and state data, evaluate the communication state of the communication link to obtain a communication state evaluation result, wherein the communication state evaluation result is used to represent whether the communication link is running normally.
[0047] The communication state evaluation result can be a conclusion obtained by analyzing and evaluating the communication data and state data of the communication link, and is used to represent whether the communication link is currently in a normal running state. The communication state evaluation result can include a comprehensive evaluation of multiple indicators of the communication link. For example, the communication state evaluation result can include one or more indicators such as data transmission integrity, message timeliness, error checking mechanism effectiveness, link connectivity and stability, but not limited to this. When the communication state evaluation result shows that all indicators of the communication link meet the pre-set standards or thresholds, it means that the communication link is running normally. Conversely, if one or more indicators fail to meet the pre-set standards or thresholds, it indicates that the communication link has faults, interference or other abnormal conditions, and further inspection and maintenance by the communication system is needed.
[0048] In an optional embodiment, the communication system can discover potential communication failure or abnormal behavior, such as packet loss, repetition, sequence disorder, etc., in time by evaluating the image state of the communication link, which helps to take corrective measures at the early stage of failure to avoid subsequent larger-scale system interruption or data loss. Therefore, after obtaining the communication data and state data, the communication system can evaluate the communication state of the communication link based on the communication data and state data, so as to determine whether the communication link is running normally, thereby constructing the communication state evaluation result.
[0049] For example, the communication system can use various error counters collected in the lightweight secure communication component, including but not limited to packet timeout error count, checksum error count, alive counter error count, DLC (Data Length Code) error count, etc. If the count value of any one of the error counters exceeds the preset error threshold, it indicates that the communication link is abnormal, and the communication system can determine that the communication state evaluation result is abnormal. If the count value of any one of the error counters does not exceed the preset error threshold, the communication system can determine that the communication state evaluation result is normal.
[0050] For another example, the communication system can use a machine learning model to evaluate the communication state of the communication link. The communication system can use historical communication data and state data to pre-train the machine learning model to identify normal communication patterns and abnormal communication patterns. In actual application, the communication system can input the obtained communication data and state data into the machine learning model to evaluate the communication state of the communication link. The machine learning model can output the communication state evaluation result.
[0051] Step S106, in response to the communication state evaluation result indicating that the communication link is abnormal, determining the abnormal type of the communication link based on the communication data and state data.
[0052] The abnormal type can be a specific type of the communication link when the communication link is abnormal. For example, the abnormal type can include at least one or more of the following: transmission state abnormality, running state abnormality, etc., but is not limited thereto.
[0053] In an optional embodiment, different abnormal types (e.g., physical layer failure, link layer failure, network layer failure, etc.) require different solutions when the communication link is abnormal. If there is no explicit abnormal type, the communication system may waste time and computing resources in troubleshooting. Therefore, accurately identifying the abnormal type of the communication link can help the communication system find the root cause of the abnormality of the communication link more quickly, so as to take targeted measures to solve the above-mentioned abnormality. Based on this, if the above-mentioned communication state evaluation result indicates that the above-mentioned communication link is abnormal, the communication system can determine the specific abnormal type of the above-mentioned communication link based on the above-mentioned communication data and state data, thereby facilitating the communication system to take effective measures to make the above-mentioned communication link resume normal operation.
[0054] For example, the communication system can construct a historical abnormality database based on historical abnormal information and corresponding solutions. When the above-mentioned communication state evaluation result indicates that the communication link is abnormal, the communication system can match the same or similar abnormal information as the current abnormal scenario from the above-mentioned historical abnormality database, thereby determining the above-mentioned abnormal type, and adopting the solution corresponding to the current abnormal type to adjust the operation state of the above-mentioned communication link.
[0055] For another example, the communication system can pre-prepare multiple abnormal monitoring strategies to monitor the abnormal situation in the current communication link. If the communication system monitors that the current abnormal situation is the same as the abnormal type corresponding to any one of the above-mentioned multiple abnormal monitoring strategies, the communication system can determine the abnormal type of the current abnormality based on the above-mentioned any one of the abnormal monitoring strategies.
[0056] Step S108, based on the abnormal type, adjusting the communication link, and based on the adjusted communication link, re-establishing the communication between any two electronic control units.
[0057] In an optional embodiment, once the above-mentioned abnormal type is determined, the communication system can isolate or close the affected communication link or electronic control unit to avoid fault propagation and reduce the security risk of the communication link. Therefore, the communication system can determine the adjustment measure corresponding to the above-mentioned abnormal type based on the above-mentioned abnormal type to realize the targeted adjustment of the above-mentioned communication link. After completing the above-mentioned adjustment, the communication system can re-establish the communication between any two electronic control units based on the adjusted communication link to resume the normal operation of the communication link.
[0058] In the embodiment of the present application, in response to detecting that there is a communication link between any two electronic control units of the target vehicle, communication data and state data of the communication link are acquired; based on the communication data and the state data, the communication state of the communication link is evaluated to obtain a communication state evaluation result; in response to the communication state evaluation result representing that the communication link is running abnormally, based on the communication data and the state data, an abnormal type of the communication link is determined; based on the abnormal type, the communication link is adjusted, and based on the adjusted communication link, the communication between any two electronic control units is re-established. By detecting whether there is a communication link between any two electronic control units inside the target vehicle, it is ensured that all potential communication links are monitored, and then the communication data and the state data of the above communication link are acquired, providing an accurate data basis for subsequent communication link state evaluation. Based on the collected communication data and state data, the communication state of the communication link is evaluated to identify abnormalities in the communication link in a timely manner, and the monitored abnormalities are refined according to the communication data and the state data, ensuring that the communication system can take targeted adjustment measures, so that the adjustment measures can effectively eliminate the abnormalities in the communication link, so that the communication between any two electronic control units based on the adjusted communication link has high safety and stability, achieving the purpose of effectively identifying and solving various safety hazards in the communication link, thereby realizing the technical effect of improving the communication safety of the electronic control unit, and further solving the technical problem of low communication safety of the electronic control unit in related technologies.
[0059] Further, based on the communication data and the state data, the communication state of the communication link is evaluated to obtain a communication state evaluation result, including: based on the communication data, the transmission state of the communication link is evaluated to obtain a first evaluation result, wherein the transmission state is used to represent whether there is an error in the transmission of the communication data by the communication link, and the first evaluation result is used to represent 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; based on the state data, the running state of the communication link is evaluated to obtain a second evaluation result, wherein the running state is used to represent the interruption state of the transmission of the communication data by the communication link, and the second evaluation result is used to represent whether the transmission process of the communication data is interrupted; based on the first evaluation result and the second evaluation result, the communication state evaluation result is constructed.
[0060] The above transmission state can be the performance of the communication link when transmitting communication data, mainly focusing on the accuracy, integrity and timeliness of the data in the transmission process. The above transmission state can reflect the quality of the communication link for communication data transmission, whether the data of the sender can be delivered to the receiver without error, loss and on time.
[0061] The first evaluation result can be a result obtained after evaluating the transmission state based on the communication data, and can specifically be a comparison analysis between the first data content sent by the sender and the second data content received by the receiver.
[0062] The running state can refer to the continuity and stability of the communication link during operation, and mainly concerns whether the communication link is continuously available and whether there is interruption such as disconnection, bus conflict or other phenomena causing the communication link to fail to work normally during transmission.
[0063] The second evaluation result can be a result obtained after evaluating the running state based on the state data, and can specifically be an interruption condition of the communication link during transmission.
[0064] In an optional embodiment, considering the evaluation of the transmission state of the communication link, potential errors in the communication data during transmission can be detected. Therefore, the communication system can verify whether the communication data maintains the original integrity and correctness during transmission by comparing the first data content sent by the sender and the second data content received by the receiver in the communication data, thereby constructing the first evaluation result, which is an important means to prevent data from being maliciously modified or damaged due to link problems. Further considering the evaluation of the running state of the communication link, it can be detected whether the communication link has interruption during transmission of the communication data, which is particularly important for communication systems with extremely high real-time and security requirements, and is conducive to identifying whether there is physical layer damage, software failure or network attack in the communication link. Therefore, the communication system can evaluate the running state of the communication link based on the state data to determine whether the communication data has interruption during transmission, thereby constructing the second evaluation result. After obtaining the first evaluation result and the second evaluation result, the communication system can integrate the first evaluation result and the second evaluation result, thereby constructing the communication state evaluation result to form a comprehensive communication link health status view. Through the above steps, the communication system can more accurately judge the overall state of the communication link to accurately identify problems that need further diagnosis or repair. Through the communication state evaluation result, it can be distinguished whether the abnormality in the communication link is caused by link transmission problems or by unstable link running state, so that the communication system can take corresponding repair measures to ensure the safety and reliability of the communication link.
[0065] Further, based on the communication data, a transmission state of the communication link is evaluated to obtain a first evaluation result, including: consistency of the communication data is checked to obtain a consistency check result, wherein the consistency check result is used to represent whether the first data content and the second data content are consistent; continuity of the communication data is checked to obtain a continuity check result, wherein the continuity check result is used to represent whether the second data content is continuous; interaction time of the communication data is checked to obtain a timeout check result, wherein the timeout check result is used to represent whether a transmission time length from sending the first data content by the sending party to receiving the second data content by the receiving party exceeds a preset time length; and the first evaluation result is constructed based on the consistency check result, the continuity check result, and the timeout check result.
[0066] The consistency check result can be a result of judging whether the communication data is tampered in the transmission process through a checksum or other similar algorithm. For example, a checksum value of a data set can be calculated at the sending end and sent together with the data. After receiving the data, the receiving end also calculates the checksum of the data, and then compares the calculated checksum with the received checksum. If they are consistent, it means that the data remains complete and consistent in the transmission process, and the check is passed. If they are not consistent, it means that the data may have been changed in the transmission process, and the check fails.
[0067] The continuity check result can be a result of monitoring the continuity of the data packet through a packet survival counter. For example, the sending end can attach an incremental counter value to each new data packet sent. The receiving end can check whether the counter value is consistent with the expected value after receiving the data packet. If they are consistent, the continuity check of the data packet is passed. If they are not consistent, it may be a data packet loss or a replay attack, and the check fails.
[0068] The timeout check result can be a result of judging whether the sending and receiving time of the communication data packet is within the expected time. For example, after the sending party sends the data packet, the receiving party should receive the data packet within a preset time. If the time of receiving the data packet exceeds the preset transmission time, it is considered as timeout, and the timeout check result is failed. Otherwise, if it is successfully received within the preset time, the check result is passed.
[0069] The first data content can be the original communication data prepared to be sent by the sending party. For example, the first data content can contain valid information that needs to be processed at the receiving end. The valid information can include at least one or more of the following: control instructions, sensor data, state updates, etc., but is not limited thereto.
[0070] The second data content can be the final received communication data by the receiver. In the case that the communication link is operating normally, the second data content should be identical to the first data content. However, in the actual communication process, the data can be changed due to various interference or abnormal situations. The second data content is used to compare with the first data content to evaluate the transmission status of the communication link.
[0071] In an optional embodiment, it is considered that in vehicle communication, the accuracy of the communication data is crucial because the communication data directly affects the control and safety of the vehicle. For example, if the torque request signal sent by the power system control unit is maliciously tampered with, it can cause the engine to output abnormal torque, which can lead to serious consequences such as vehicle out of control. By adding consistency check information such as using checksum in the data content, the receiver can verify whether the received data is consistent with the original data of the sender. Therefore, the communication system can check 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 consistency check result.
[0072] Further considering that the data content is sent in the form of periodic messages, the order and time interval of the messages are crucial to ensure real-time control and avoid confusion of the vehicle electronic system. Therefore, the communication system can also check the continuity of the communication data to determine whether the second data content received by the receiver is continuous, thereby constructing the continuity check result. For example, the sender can add an incremental counter value in the data content, and after the receiver receives the data content, it can check whether the data messages are received in order and whether there are repeated or missing messages by comparing the counter value in each data content.
[0073] It is also considered that in vehicle communication, the timeliness of the data content is crucial, especially for control signals related to vehicle safety. Therefore, the communication system can also monitor whether the data arrives at the receiving end within a predetermined time through timeout verification to ensure the real-time and effectiveness of the communication. Specifically, the communication system can check the interaction time of the 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 the predetermined time, thereby constructing the timeout check result.
[0074] Finally, the communication system can construct the above-mentioned first evaluation result based on the above-mentioned three check results to comprehensively evaluate the security and reliability of data communication. The above-mentioned first evaluation result not only includes the integrity and non-tampering of data itself (consistency check), the timing correctness and non-repetition of data transmission (continuity check), but also the timeliness of data transmission (timeout check). By integrating the check results of these three aspects, the communication system can more accurately judge the health status of the communication link and timely discover and respond to potential communication abnormalities and security threats.
[0075] Further, the consistency of the communication data is checked to obtain a consistency check result, including: processing data bytes in the first data content through a preset processing logic to obtain a first checksum; processing data bytes in the second data content through the preset processing logic to obtain a second checksum; in response to the first checksum being consistent with the second checksum, determining that the consistency check result is that the first data content and the second data content are consistent; and in response to the first checksum being inconsistent with the second checksum, determining that the consistency check result is that the first data content and the second data content are inconsistent.
[0076] The above-mentioned preset processing logic can be an algorithm or rule defined in advance for processing communication data and generating a check value. For example, the above-mentioned preset processing logic can be exclusive-OR operation logic, hash value comparison, etc., but is not limited thereto.
[0077] The above-mentioned first checksum can be a numerical value calculated according to the above-mentioned preset processing logic, used to represent the result of the set of data bytes in the first data content after being processed by the above-mentioned preset processing logic. The above-mentioned first checksum can be used as a check of data integrity to ensure that the data has not been tampered with during transmission.
[0078] The above-mentioned second checksum can be a numerical value calculated according to the above-mentioned preset processing logic. The above-mentioned second checksum corresponds to the above-mentioned second data content. By comparing the above-mentioned first checksum and the second checksum, it can be determined whether the communication data has maintained consistency during transmission.
[0079] In an alternative embodiment, any unintended alteration of the data during transmission can be detected by calculating a checksum of the data content. Thus, the preset processing logic described above can be an XOR (Exclusive OR) operation or a CRC (Cyclic Redundancy Check) operation. The sender can calculate a first checksum of the data bytes in the first data content according to the preset processing logic and attach the first checksum to the data packet of the first data content for transmission to the receiver. Upon receipt of the data packet, the receiver can recalculate a second checksum of the data bytes in the second data content according to the preset processing logic and then compare the second checksum with the first checksum attached to the data packet. If the first checksum is consistent with 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 data content and the second data content are consistent. If the first checksum is inconsistent with the second checksum, it indicates that the data content may have been altered or tampered with during transmission, and the consistency check result is that the first data content and the second data content are inconsistent.
[0080] Further, the continuity of the communication data is checked to obtain a continuity check result, including: obtaining data numbers in the second data content, wherein the data numbers are constructed by the sender based on a sending order of the first data content; performing continuity detection on the data numbers based on a receiving order of the second data content to obtain a number detection result, wherein the number detection result is used to represent whether the continuity of the data numbers meets a preset condition; in response to the number detection result representing that the continuity of the data numbers meets the preset condition, determining that the continuity check result is that the second data content is continuous; and in response to the number detection result representing that the continuity of the data numbers does not meet the preset condition, determining that the continuity check result is that the second data content is discontinuous.
[0081] The data numbers described above can be a unique identifier assigned by the sender to each piece of data or message during data transmission, which reflects the sending order of the data. In a vehicle communication or other network communication environment, the data numbers can actually be designed like a survival count, which can be a counter value that increases with the number of times of sending the communication data, used to ensure that the receiver can identify the correct version of the data.
[0082] The number detection result can be obtained by the receiver based on the continuity detection of the data number in the received second data content. If the data number is expected to be incremented, the continuity detection result satisfies the preset condition, indicating that the data transmission is continuous and uninterrupted. On the contrary, if any data number is skipped, repeated or does not comply with the increment rule, the continuity detection result does not satisfy the preset condition, indicating that there may be packet loss, replay or tampering in the data transmission process.
[0083] The preset condition can be a pre-set rule for determining whether the continuity of the data number complies with the standard of the communication system.
[0084] In an optional embodiment, considering that the data number is generated at the sender side, the sender can assign a unique data number to each new first data content according to the current sending sequence when sending the first data content. The data number can be an incremental counter value to ensure the uniqueness of each first data content in the sending stream. Therefore, when receiving the second data content, the receiver can extract the data number in the second data content and detect the continuity of the data number based on the order of the received data. Whether the continuity of the data number satisfies the preset condition, i.e., verifying whether the second data content arrives in the expected order, thereby constructing the number detection result, and further determining whether there is data loss, repetition or out-of-order situation in the transmission process of the data content. If the number detection result indicates that the continuity of the data number satisfies the preset condition, it means that the second data content is received in the expected order without data loss, repetition or out-of-order situation. At this time, the receiver can determine that the second data content is complete and continuous. On the contrary, if the number detection result indicates that the continuity of the data number does not satisfy the preset condition, it indicates that there is a problem in the data transmission, such as packet loss in the network, repetition caused by data retransmission, or data sequence disorder in the transmission process. In this case, the receiver should regard the number detection result as a sign of data discontinuity and take targeted measures to deal with the discontinuity of the second data content.
[0085] Further, based on the receiving order of the second data content, the continuity of the data number is detected to obtain a 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 represent whether the data numbers of any 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 represent 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 representing that the data numbers of any three adjacent second data contents are the same, or the second detection result representing 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 number detection result is that the continuity of the data number does not satisfy the preset condition; in response to the first detection result representing that the data numbers of any three adjacent second data contents are not the same, and the second detection result representing 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 number detection result is that the continuity of the data number satisfies the preset condition.
[0086] The 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 exactly the same. If the three data numbers are the same, it means that there is a repetition in the data stream or a certain data content is not updated correctly, and the communication system can regard the above situation as the first type of anomaly, i.e., the non-uniqueness of the data number.
[0087] The second detection result can be the result of checking the difference between the data numbers of any two adjacent second data contents. The purpose of the above check is to detect whether there is a jump in the data stream, i.e., whether the second data content is received in order. If the difference between the data numbers of two adjacent second data contents exceeds the preset threshold, it means that there is a data loss or sequence interruption in the data stream, which will be regarded as the second type of anomaly, i.e., the non-continuity of the data number.
[0088] The preset threshold can be a value set in advance to determine whether the difference between the data numbers exceeds the normal range. This threshold usually reflects the normal sequence variation range of the data packet, for example, in a data number system that increments by 1, the preset threshold can be 1 or 2, and any difference greater than this value will be regarded as an anomaly, i.e., the data continuity does not satisfy the condition. It should be noted that the specific value of the preset threshold is only exemplary, and the staff can set it according to actual needs, which is not limited here.
[0089] In an optional embodiment, in order to ensure the integrity and continuity of the message sequence in data communication, avoid replay attacks, message loss or out-of-order in the transmission process, and further ensure the security and reliability of the communication, the continuity of the second data content can be further checked. 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 the above-mentioned any three adjacent second data contents are the same, thereby constructing the above-mentioned first detection result. At the same time, 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 the above-mentioned any two adjacent second data contents is greater than a preset threshold, thereby constructing the above-mentioned second detection result. If the data numbers of the above-mentioned any three adjacent second data contents are the same, it means that the second data content may be intercepted and repeatedly sent by the attacker. In addition, if the difference between the data numbers of the above-mentioned any two adjacent second data contents is greater than the preset threshold, it means that at least one or more second data contents may not arrive due to network interruption or other technical problems during transmission. The above two abnormal situations will both cause the discontinuity of the second data content. Therefore, if the above-mentioned first detection result indicates that the data numbers of any three adjacent second data contents are the same, or the difference between the data numbers of any two adjacent second data contents is greater than the above-mentioned preset threshold, the receiver can determine that the above-mentioned number detection result is that the continuity of the data number does not meet the preset condition. On the contrary, if the above-mentioned first detection result indicates that there is no three adjacent second data contents with the same data number among all the second data contents received by the receiver, and the difference between the data numbers of any two adjacent second data contents is less than or equal to the above-mentioned preset threshold, the receiver can determine that the above-mentioned number detection result is that the continuity of the data number meets the preset condition.
[0090] Further, the interaction time of the communication data is checked to obtain a timeout check result, including: obtaining a timeout time for the receiver to receive the second data content; in response to the receiver receiving the second data content within the timeout time, determining that the timeout check result is that the transmission time length from the sender sending the first data content to the receiver receiving the second data content does not exceed a preset time length; in response to the receiver not receiving the second data content within the timeout time, determining that the timeout check result is that the transmission time length from the sender sending the first data content to the receiver receiving the second data content exceeds the preset time length.
[0091] The above timeout time can be a preset time threshold for determining whether the data content reaches the receiving party within an expected time. When the data content is sent from the sending party, if the receiving party receives the data content within the specified timeout time, the communication system can consider that the communication is successful, and the transmission duration does not exceed the preset reasonable range. Conversely, if the receiving party has not received the above data content at the end of the timeout time, the communication system can determine that the transmission fails, that is, the transmission duration exceeds the preset timeout time.
[0092] In an optional embodiment, in order to ensure the timeliness and reliability of data transmission, the communication system can check whether the receiving party receives the second data content in time. Specifically, the communication system can determine a timeout time, which can be set according to the expected transmission delay under normal communication conditions, to ensure that the second data content can be successfully received by the receiving party within the timeout time under normal communication environment. Then, the communication system can determine whether the receiving party receives the second data content within the timeout time. If the receiving party receives the second data content within the timeout time, it indicates that the receiving party does not receive the second data content in time, and at this time, the communication system can determine that the timeout check result is that the transmission duration from the sending party sending the first data content to the receiving party receiving the second data content does not exceed the preset duration. On the contrary, if the receiving party does not receive the second data content within the timeout time, it indicates that the receiving party receives the second data content in time, and at this time, the communication system can determine that the timeout check result is that the transmission duration from the sending party sending the first data content to the receiving party receiving the second data content exceeds the preset duration.
[0093] Further, the state data includes network running data, feedback data sent by the receiving party, and running voltage of the communication link, and the running state includes a network state, a feedback state, and a voltage state; based on the state data, the running state of the communication link is evaluated to obtain a second evaluation result, including: using the network running data to monitor the network state of the communication link to obtain a network state monitoring result, wherein the network state monitoring result is used to represent whether the network state is in a normal state; checking the integrity of the feedback data sent by the receiving party to obtain a feedback state check result, wherein the feedback state check result is used to represent whether the feedback data received by the sending party is missing; using the running voltage of the communication link to monitor the voltage state of the communication link to obtain a voltage state monitoring result, wherein the voltage state monitoring result is used to represent whether the running voltage is in a preset voltage range; based on the network state monitoring result, the feedback state monitoring result, and the voltage state monitoring result, the second evaluation result is constructed.
[0094] The network operation data can be data reflecting the operation state of the local area network of the communication link at the current time point. For example, the network operation data can include at least one or more of the following: data packet sending and receiving rate, data packet loss rate, delay time, error rate, network bandwidth usage, etc., but is not limited thereto.
[0095] The feedback data sent by the receiving end can be data sent by the receiving end to the sending end in data communication to confirm the reception state of the data. For example, the feedback data can be a simple ACK (Acknowledgement) signal, or more complex information such as a CRC check value, integrity state of received data, retransmission request, etc., but is not limited thereto.
[0096] The operating voltage can be the power supply voltage level of the communication link. The operating voltage has a direct impact on the stability of the link and the integrity of the data. For example, an excessively low operating voltage can cause the communication signal to weaken or distort, and an excessively high operating voltage can cause device damage or signal interference.
[0097] The network state can be a state for describing whether the local area network of the communication link is working normally. For example, the network state can include at least one or more of the following indicators: network connectivity, data transmission smoothness, error rate, etc., but is not limited thereto. A normal network state means that the local area network is operating stably.
[0098] The feedback state can be the integrity and accuracy of the feedback data received by the sending end. A normal feedback state means that the receiving end can correctly receive and feedback the data of the sending end.
[0099] The voltage state can be a state for reflecting whether the power supply voltage of the communication link is within a predetermined safe range. A normal voltage state means that the voltage level is moderate and will not affect the performance and stability of the communication link.
[0100] The network state monitoring result can be an evaluation result of the network state of the communication link by the network operation data. If the network data transmission is error-free, the delay is low, and the bandwidth usage is reasonable, the network state monitoring result is normal.
[0101] The feedback state verification result can be a verification result of the integrity and correctness of the feedback data of the receiving end. If the receiving end can correctly receive the data and return valid confirmation information, the feedback state verification result is normal.
[0102] The voltage state monitoring result can be a result obtained by monitoring the operating voltage of the communication link. If the operating voltage is within a predetermined normal range, the voltage state monitoring result is normal.
[0103] In an optional embodiment, considering that network state abnormalities such as link disconnection, network congestion, etc. may cause data transmission delay or failure, affecting the real-time control and data exchange of vehicles. By monitoring the network state and obtaining the monitoring result, network abnormalities can be discovered and handled in time to ensure the continuity and reliability of data transmission. Therefore, the communication system can use the above network operation data to monitor the network state of the communication link to determine whether the above network state is in a normal state, thereby constructing the above network state monitoring result to discover network abnormalities such as packet loss, repeated messages or message sequence disorder in time, and further ensure the integrity and accuracy of data transmission.
[0104] Further considering that in vehicle communication, data content tampering or damage may be caused by various reasons, including hardware failure, electromagnetic interference or malicious attack. By verifying the integrity of the feedback data, it can be ensured that the data content is correctly delivered, and the target vehicle electronic system is prevented from behaving abnormally due to data errors, such as engine control errors or inaccurate brake responses. Therefore, the communication system can verify the integrity of the feedback data sent by the receiving party to determine whether the feedback data received by the sending party is missing, thereby constructing the above feedback state verification result to prevent data content from being tampered with or damaged during transmission.
[0105] It is also considered that voltage fluctuations not only affect the normal operation of the communication link, but also may damage sensitive electronic components. By monitoring the supply voltage of the communication link, it is ensured that the communication link is within a safe operating range, and communication abnormalities or hardware damage caused by excessively high or low voltage are prevented. Therefore, the communication system can also use the operating voltage of the communication link to monitor the voltage state of the communication link to determine whether the operating voltage of the communication link is within a preset voltage range, thereby constructing the above voltage state monitoring result.
[0106] Since individual network state monitoring, data integrity verification or voltage state monitoring can only provide partial information. However, by combining the three for evaluation, the overall health status of the communication link can be more accurately determined. Therefore, the communication system can integrate the above network state monitoring result, feedback state verification result and voltage state monitoring result to construct the above second evaluation result to form a comprehensive link health evaluation to provide a basis for subsequent decision-making.
[0107] Further, the abnormal type includes a transmission state abnormality and a running state abnormality, and the adjustment of the communication link is based on the abnormal type, including: in response to the abnormal type being the transmission state abnormality, replacing the communication data based on a data replacement strategy, and adjusting the communication link based on the replaced communication data; and in response to the abnormal type being the running state abnormality, adjusting the running state of the communication link based on a state adjustment strategy.
[0108] The transmission state abnormality described above can be an abnormality occurring in the process of data communication. For example, the transmission state abnormality described above can include at least one or more of the following: data packet loss, data delay exceeding a normal range, excessive number of data retransmissions, data sequence disorder, data content being illegally tampered with, etc., but is not limited thereto. The transmission state abnormality directly affects the integrity and timeliness of the data, thereby impairing the stable operation of the communication system.
[0109] The running state abnormality described above can be an abnormality occurring in the running process of the communication link or the communication system. For example, the running state abnormality described above can include at least one or more of the following: communication system crash, restart, hardware failure, software error, resource depletion (such as insufficient memory), link bandwidth reduction, unstable connection, etc., but is not limited thereto. The running state abnormality described above can be caused by various internal or external factors, affecting the availability and reliability of the communication system.
[0110] The data replacement strategy described above can be a strategy of selectively replacing abnormal data with a preset or calculated default value, safety value, or historical value in order to maintain the basic function of the current subsystem of the target vehicle when a transmission state abnormality is detected. The data replacement strategy described above can ensure that the basic function of the current subsystem of the target vehicle is not severely affected, and also avoids the harm that may be caused by abnormal data.
[0111] The state adjustment strategy described above can be a strategy adopted by the communication system in the face of the running state abnormality, for restoring the communication link to a normal state or degrading it to a limited function mode. For example, the state adjustment strategy described above can include at least one or more of the following: restarting a service or module in the communication link, switching to a backup communication path, limiting communication frequency, reducing unnecessary data exchange, enabling a redundant system, etc., but is not limited thereto. The purpose of the state adjustment strategy described above is to protect the communication link from further damage, while maintaining the basic operating ability of the communication link as much as possible.
[0112] In an optional embodiment, considering that the control instructions or control parameters for the electronic control unit are included in the data content, when the abnormal type is the transmission state abnormality, the communication system needs to take targeted measures to avoid the electronic control unit as the receiver to run with the wrong instructions or parameters, so as to cause the running state of the target vehicle to not meet the user's expectation. Therefore, when the abnormal type is the transmission state abnormality, in order to ensure the integrity and security of the data, the communication system can adopt a data replacement strategy, replace the damaged data with a default value or an alternative value, and adjust the communication link based on the replaced communication data, so as to ensure that the electronic control unit as the receiver can continue to run with limited functions even in the case of data abnormality, and avoid the paralysis of the entire target vehicle due to a single data problem.
[0113] Further considering that the running state abnormality can involve the state problem of the electronic control unit itself or the abnormal state of the communication link, such as the temperature of the electronic control unit being too high, the abnormal power supply voltage, or the physical layer fault of the link. For the running state abnormality, the communication system can adjust the running state of the communication link to restore the normal running state of the communication link. Specifically, the communication system can adjust the communication link according to the severity and type of the transmission state abnormality based on the state adjustment strategy, such as increasing the number of retransmissions of the data packet, changing the transmission rate, or using a redundant link. Such adjustment helps to restore the normal communication of the link, reduce the delay and error rate of data transmission, ensure the smooth communication between each electronic control unit in the vehicle, and improve the stability and response speed of the overall system.
[0114] Further, based on the data replacement strategy, the communication data is replaced, including: detecting the first data content to determine the operation type corresponding to the first data content, wherein the operation type is used to control the running 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 relationship between the operation type and the preset data content; and replacing the first data content based on the preset data content.
[0115] The operation type can be an instruction or a label in data communication for indicating how the receiver processes the received data. For example, each operation type corresponds to a different running mode or response strategy, so that the receiver can make appropriate responses according to the type of received data in different communication environments.
[0116] The preset database can be a data structure or a data storage system that is preconfigured to store the association between the operation type and the preset data content. In the preset database, each operation type is associated with one or more preset data contents, which are backup data used to replace the original data under different operation types. The preset database is designed to quickly provide replacement data to maintain the stability and safety of the current subsystem of the target vehicle when data transmission is abnormal or a security threat occurs.
[0117] The preset data content can refer to data prepared in advance to cope with the current operation type. For example, the preset data content can include at least one or more of the following: a default value, a security value, or replacement data that can ensure basic system operation in abnormal situations, but is not limited thereto.
[0118] In an optional embodiment, when the abnormal type is a transmission state abnormality, the communication system needs to analyze the sending intention of the sender to determine which replacement value the receiver should use to replace the abnormal data. Therefore, the communication system can detect the first data content to analyze the sender's desired control mode of the receiver, thereby determining the operation type corresponding to the 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 operation type from the preset database according to the association between the operation type and the preset data content stored in the preset database, and replace the first data content based on the preset data content.
[0119] Further, the running state abnormality includes a network state abnormality, a feedback state abnormality, and a voltage state abnormality, and the running state of the communication link is adjusted based on a state adjustment strategy, including: in response to the running state abnormality being a network state abnormality, adjusting the network state based on a network state adjustment strategy; in response to the running state abnormality being a feedback state abnormality, adjusting the feedback state based on a feedback state adjustment strategy; and in response to the running state abnormality being a voltage state abnormality, adjusting the voltage state based on a voltage state adjustment strategy.
[0120] The network state abnormality can be an abnormality of a local area network of the communication link. For example, the network state abnormality can include at least one or more of the following: communication link failure, data packet loss, data packet duplication, data packet sequence disorder, illegal access attempt, or network congestion, but is not limited thereto.
[0121] The feedback state abnormality can refer to an abnormality in the response or acknowledgement of the receiving party to the sending party during communication. In a normal communication process, the sending party sends data and expects an acknowledgement from the receiving party. If the receiving party fails to provide the acknowledgement in a timely manner or the acknowledgement information is incorrect, it constitutes the feedback state abnormality. For example, the feedback state abnormality can be caused by at least one or more of the following conditions: network delay, hardware failure, software error, malicious attack, etc., but is not limited thereto.
[0122] The voltage state abnormality can be a situation where the power voltage of the communication link exceeds a predetermined safe range. For example, the voltage state abnormality can be an excessively high or low voltage. The voltage state abnormality can affect the normal operation of the electronic control unit, leading to data transmission errors, unstable data transmission, or hardware damage.
[0123] The network state adjustment strategy can be a set of processing schemes designed for the detected network state abnormality. For example, the network state adjustment strategy can 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, increasing the data packet retransmission mechanism, or performing a fault recovery process, etc., but is not limited thereto. The purpose of the network state adjustment strategy is to restore the normal operation of the network in the communication link and ensure the accuracy and timeliness of data transmission.
[0124] The feedback state adjustment strategy can refer to measures taken by the communication system to correct the feedback state abnormality and restore the reliability of communication when the feedback state abnormality is detected. For example, the feedback state adjustment strategy can include at least one or more of the following: resending data packets, increasing error checking mechanisms, adjusting data transmission protocols, or implementing self-checking and repair mechanisms for communication links, etc., but is not limited thereto. The implementation of the feedback state adjustment strategy helps to ensure the integrity of the data and the continuity of the communication.
[0125] The voltage state adjustment strategy can be a series of measures taken by the communication system to protect the communication link from damage while maintaining the basic functions of the communication link as much as possible when a voltage state abnormality is detected. For example, the voltage state adjustment strategy can include at least one or more of the following: suspending or limiting the operation of sensitive components, starting a voltage monitoring and alarm system, activating a voltage adjustment module, or executing an emergency shutdown procedure, etc., but is not limited thereto. By implementing the voltage state adjustment strategy, communication link failures caused by voltage abnormalities can be avoided, ensuring the safe and stable operation of the communication link.
[0126] In an optional embodiment, considering that the operating state abnormality of the communication link can be caused by various factors, in order to ensure the recovery rate of the communication link in the abnormal state, the communication system can adopt corresponding adjustment strategies for different types of operating state abnormalities to quickly reduce the impact of the operating state abnormality of the communication link on the overall function of the communication system. Therefore, the communication system can first determine the type of the current operating state abnormality, if the operating state abnormality 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 attempt to quickly reinitialize the network controller, and after stopping sending messages for a short time, it resumes sending to restore normal communication as soon as possible. Or when the network state is not stable for a long time, a longer recovery time is used to avoid communication jitter caused by frequent reinitialization.
[0127] If the operating state abnormality is a feedback state abnormality, the communication system can adjust the feedback state of the communication link based on the feedback state adjustment strategy corresponding to the feedback state abnormality. For example, the communication system tracks the feedback state of each message and records the number of feedback failures to assess the health of the communication link. And when the feedback state abnormality reaches a certain threshold, the communication controller is reinitialized to try to restore the normal feedback mechanism.
[0128] If the operating state abnormality is a voltage state abnormality, the communication system can adjust the voltage state based on the voltage state adjustment strategy corresponding to the voltage state abnormality. For example, the communication system can continuously monitor the power supply voltage and define high and low voltage thresholds. When the voltage exceeds the normal range, start the corresponding recovery timer or directly disable the communication function.
[0129] Further, the network state is adjusted based on the network state adjustment strategy, including: detecting the electronic control unit to determine whether the electronic control unit has a network management module; in response to any two electronic control units being configured with a network management module, and any two electronic control units being in a first operating mode, repeatedly performing initialization of the communication link, and resuming the communication link after a first preset time, wherein the communication link does not perform data transmission within the first preset time; in response to any one of the any two electronic control units not being configured with a network management module, and any one of the any two electronic control units being in a second operating mode, repeatedly performing initialization of the communication link within a preset number of times, and resuming the communication link after a second preset time, wherein the communication link does not perform data transmission within the second preset time, and the second preset time is less than the first preset time.
[0130] The network management module can be a software or hardware module embedded in the electronic control unit for managing network communication between electronic control units. For example, the network management module can perform at least one or more of the following functions: detecting network failure, executing recovery strategies, and maintaining the health status of the network, but not limited thereto.
[0131] The first operating mode can be the operating state of the electronic control unit under normal working conditions, in which the electronic control unit is configured with a network management module and can perform all predetermined network management and security functions. In this mode, the electronic control unit can receive and send data while monitoring and managing the network status.
[0132] The first predetermined time can be the time for the electronic control unit to stop data transmission and reinitialize the communication link according to the instructions of the network management module after detecting network anomalies or failures. This time is usually long to ensure that the network can be fully recovered and to avoid further problems caused by restarting when the communication link is not fully stable.
[0133] The second operating mode can be the operating state of the electronic control unit when the network management module is not configured or the network management module function is limited. In this mode, the electronic control unit can only perform basic communication functions.
[0134] The predetermined number of times can be the number of times the electronic control unit attempts to reinitialize the communication link after detecting network anomalies. The predetermined number of times is to quickly attempt to recover the network in a short period of time to avoid long communication interruptions, but also to prevent infinite loop restart attempts.
[0135] The second predetermined time can be similar to the first predetermined time, but for electronic control units that are not configured with a network management module or have limited network management functions. The second predetermined time is shorter than the first predetermined time, and the purpose is to quickly attempt to recover communication within a limited time to reduce the impact on the normal operation of the vehicle.
[0136] In an optional embodiment, the communication system determines what recovery measures should be taken for the electronic control unit, taking into account whether the electronic control unit has the ability to handle network management. The presence of a network management module means that the electronic control unit can more actively monitor and manage the network status and execute more complex failure recovery strategies. Therefore, the communication system can detect whether each electronic control unit is configured with a network management module. Electronic control units configured with a network management module can perform more detailed and longer failure detection and recovery steps, while electronic control units without a network management module require a faster and simpler failure recovery process.
[0137] If any two of the electronic control units are configured with the network management module and any two of the electronic control units are in the first operation mode, the communication system can perform a slow recovery strategy. Specifically, the communication system can repeatedly perform the initializing the communication link and recovering the communication link after a first preset time until the network state is recovered to normal. The setting of the first preset time allows the electronic control units enough time to ensure that all network states are recovered to normal.
[0138] If any one of the electronic control units is not configured with the network management module and any one of the electronic control units is in the second operation mode, the communication system can take a fast recovery strategy. Specifically, the communication system can repeatedly perform the initializing the communication link and recovering the communication link after a second preset time within a preset number of times. Compared with the first preset time, the second preset time is set to be shorter, which means that the resource consumption is reduced, and the network state can be recovered more effectively for resource-limited electronic control units or in emergency situations.
[0139] Further, repeatedly performing the initializing the communication link and recovering the communication link after the second preset time within the preset number of times includes: in response to the network state being recovered to normal within the preset number of times, determining that the network state is successfully recovered; and in response to the network state not being recovered to normal within the preset number of times, repeatedly performing the initializing the communication link and recovering the communication link after a third preset time until the network state is recovered to normal, wherein the communication link does not perform data transmission within the third preset time, and the third preset time is greater than the second preset time and less than the first preset time.
[0140] The third preset time can be the time when the communication system again attempts to stop data transmission and re-initialize the communication link based on the second preset time within the preset number of times when stopping data transmission and re-initializing the communication link still cannot recover the network state to normal.
[0141] In an alternative embodiment, if the fast recovery strategy fails to recover the network state within the preset number of times, the communication system needs to employ a second stage recovery strategy to further recover the network state. First, the communication system needs to evaluate the recovery effect of the fast recovery strategy, i.e., the communication system can determine whether the network state is recovered within the preset number of times. If the network state is recovered within the preset number of times, the communication system can determine that the network state is recovered successfully, and no further recovery operation is needed. If the network state is not recovered within the preset number of times, it indicates that the fast recovery strategy is not effective, and the communication system can employ a medium recovery strategy to recover the network state. Specifically, the communication system can repeatedly perform the initialization of the communication link, and after a third preset time, the communication link is recovered until the network state is recovered. The third preset time is shorter than the first preset time but longer than the second preset time, so that the communication system can perform a longer non-communication state when the fast recovery strategy fails to solve the problem, to provide more sufficient time to wait for voltage or link fault recovery, while avoiding the hardware damage caused by frequent restarts.
[0142] Further, the feedback state is adjusted based on the feedback state adjustment strategy, including: in response to the communication link being in data transmission, and the time for the sender not receiving the feedback data sent by the receiver reaching a fourth preset time, repeatedly performing the initialization of the communication link, and after a fifth preset time, the communication link is recovered until the sender receives the feedback data.
[0143] The fourth preset time can be the time limit for the sender to wait for the feedback of the receiver. If the sender does not receive the confirmation or feedback data of the receiver within the 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 try to reestablish a stable communication connection.
[0144] The fifth preset time can be the time for the sender to wait for data transmission after the initialization of the communication link. The fifth preset time is set to avoid sending data immediately when the link state is unstable, which can cause data loss or error again. After the fifth preset time, if the link state is considered to have been recovered to be stable, the sender will resume data transmission and continue to monitor the feedback state until the feedback data of the receiver is successfully received.
[0145] In an alternative embodiment, after the sender sends the first data content, the sender can wait for the acknowledgement or feedback signal from the receiver. If the sender does not receive the feedback from the receiver within the fourth preset time, it means that the first data content may have been lost, tampered or not correctly received by the receiver during transmission. At this time, the communication system can repeatedly perform the initialization of the communication link and resume the communication link after the fifth preset time, until the sender receives the feedback data, thereby improving the security of data transmission.
[0146] Further, 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, adjusting the operating voltage to make the operating voltage within the preset voltage range, wherein the preset voltage range is used to represent the voltage range when the communication link is normally operating.
[0147] The above-mentioned preset voltage range can be the required battery voltage range when the above-mentioned communication link is normally operating. For example, the above-mentioned preset voltage range can be defined by two threshold values. When the battery voltage is lower than the first voltage threshold or higher than the second voltage threshold, the communication system will adjust the operating state of the communication link to protect the stability and security of the communication link.
[0148] In an alternative embodiment, considering that the electronic devices and communication modules in the target vehicle are designed to work within a safe voltage range. Exceeding the above-mentioned voltage range may cause hardware instability, or even damage. For example, too low voltage may not be enough to drive the circuit or components, resulting in communication failure or data transmission error. While too high voltage may burn sensitive components. Therefore, the communication system can monitor the above-mentioned operating voltage, if the above-mentioned operating voltage is outside the preset voltage range, it means that the current operating voltage has exceeded the safe voltage range, the communication system needs to adjust the above-mentioned operating voltage to make the operating voltage within the preset voltage range, so as to ensure the normal operation of the communication link, and maintain the stability and reliability of the vehicle network.
[0149] Further, based on the communication data and the state data, a type of the communication link abnormality 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 a transmission time length from sending the first data content by the sending party to receiving the second data content by the receiving party exceeds a preset time length, determining that the type of the abnormality is a transmission state abnormality; in response to the network state monitoring result indicating that the network state of the communication link is in an abnormal state, determining that the type of the abnormality is a network state abnormality; in response to the feedback state check result indicating that the feedback data received by the sending party is missing, determining that the type of the abnormality is a feedback state abnormality; and in response to the voltage state monitoring result indicating that the operating voltage of the communication link is outside a preset voltage range, determining that the type of the abnormality is a voltage state abnormality.
[0150] In an optional embodiment, in order to accurately identify and classify the specific type of communication abnormality in the communication system, and then take appropriate measures to deal with these abnormalities, ensure the reliability, security and stability of the communication, the communication system needs to specifically distinguish the current type of abnormality. Specifically, if the consistency check result in the foregoing step indicates that the first data content and the second data content are inconsistent, it indicates that the data may be interfered or maliciously attacked in transmission. If the continuity check result in the foregoing step indicates that the second data content is discontinuous, it indicates that the communication data is attacked by replay or lost in transmission. If the timeout check result in the foregoing step indicates that the transmission time length from sending the first data content by the sending party to receiving the second data content by the receiving party exceeds a preset time length, it indicates that the communication link has a fault, such as blockage, high delay or complete interruption. At this time, the communication system can determine that the type of the above-mentioned abnormality is a transmission state abnormality.
[0151] If the network state monitoring result in the foregoing step indicates that the network state of the communication link is in an abnormal state, it indicates that the communication link may have a serious network fault, such as bus conflict, hardware failure or software error, at this time, the communication system can determine that the type of the above-mentioned abnormality is a network state abnormality.
[0152] If the feedback state check result in the foregoing step indicates that the feedback data received by the sending party is missing, it indicates that the communication link may have a one-way fault or the receiving party fails to correctly process the message, resulting in that the information closed loop cannot be established, at this time, the communication system can determine that the type of the above-mentioned abnormality is a feedback state abnormality.
[0153] If the voltage state monitoring result in the foregoing step indicates that the operating voltage of the communication link is outside a preset voltage range, it indicates that the communication system needs to timely identify and take measures to adjust the power supply or suspend the communication, at this time, the communication system can determine that the type of the above-mentioned abnormality is a voltage state abnormality.
[0154] Further, the method further comprises: obtaining a configuration file of the communication link, wherein the configuration file is used to construct the communication link between any two electronic control units; inputting the configuration file into a configuration parsing model, parsing the configuration file by 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 can be a text file or a binary file, and the configuration file can include various parameters and settings required for constructing the communication link. For example, the configuration file can be a DBC file (Database Connection File, CAN database file), but is not limited thereto.
[0156] The configuration parsing model can be a logical framework, algorithm or program used to interpret and process the configuration file. The configuration parsing model can identify various parameter tags and values in the configuration file and convert the information into a format that can be understood and executed by a program, such as a data structure or an object.
[0157] The link configuration parameters can be key attributes and settings of the communication link, and the link configuration parameters are specific numerical values or identifiers parsed from the configuration file. For example, the link configuration parameters can include at least one or more of the following: message name, message ID (Identifier), message length, cycle time, transmission type, checksum information, and alive counter information, but are not limited thereto.
[0158] In an optional embodiment, considering that the configuration file contains all necessary information for communication between the electronic control units, including but not limited to the identification of the electronic control units, the type of communication protocol, the communication frequency, the data format, the communication path, etc. Obtaining the configuration file can help the communication system to 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 the structure and semantics of the configuration file, and to convert unstructured text information into structured link configuration parameters, the communication system can input the configuration file into the configuration parsing model, and parse the configuration file by using the configuration parsing model, thereby obtaining the link configuration parameters. The configuration parsing model can automatically process the configuration file, reducing the involvement of manual work 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 is a flowchart of an optional state detection of a communication link according to an embodiment of the present application, asFigure 2 As shown, when the target vehicle starts, the communication system first performs network management bus wake-up, which is a prerequisite for the communication system to start working. At this stage, the communication system is ready to receive signals from the bus and prepare for subsequent communication safety detection. Subsequently, the communication system performs initialization, turns on various safety detection functions to ensure that the communication system can comprehensively monitor the safety of the communication link and content. After initialization, the communication system can enter a COM (Communication Module) diagnostic idle state, at which time the communication system can start monitoring the voltage state to ensure that the communication system can work within the normal voltage range. If the communication system detects voltage abnormalities, the communication system can enter a high or low voltage state to take appropriate protective measures to restore the voltage state. If the voltage state monitoring is normal, the communication system can enter a COM diagnostic start state. If the communication system starts for the first time, it can enter a delayed start state to ensure that all necessary electronic control units have been properly initialized, avoiding starting communication before the communication system is fully prepared, thereby reducing the risk of potential communication abnormalities. After the delay start is completed, the communication system can enter a COM diagnostic working state to continuously perform communication safety detection. In the above COM diagnostic working state, the communication system can closely monitor the health of the communication link. Specifically, the communication system can continuously monitor the BusOff state, which is an abnormal state of bus shutdown. When the BusOff state monitoring is abnormal, the communication system immediately acquires the current BusOff state and takes a fast recovery or medium recovery strategy to try to reinitialize the CAN controller and restore the communication capability. If the BusOff state is monitored for three consecutive times and the communication is not successfully restored during this period, the component will set the corresponding global variable flag bit to notify the application software that there is an abnormality of the BusOff state. If the above BusOff state monitoring is normal, the communication system can acquire the Rx (Receiver) message Timeout detection state and monitor the NoACK (NoAcknowledgment) state of the received message to ensure that each sent message can be confirmed by the receiving party. When the above NoACK state detection is normal, the communication system can acquire the Rx message reception detection state to check the integrity and accuracy of the Rx message content. If the above NoACK state detection is abnormal, the communication system can acquire the current NoACK state and take targeted measures.
[0160] Figure 3 is an optional interaction diagram of an electronic control unit according to an embodiment of the present application, as Figure 3As shown, ECU1 and ECU2 represent any two electronic control units within the target vehicle. APP (Application) represents the application layer, which is the top layer of each electronic control unit, responsible for handling high-level applications related to vehicle functions. COM represents the communication management component, responsible for the coordination and management of communication between electronic control units. SafetyOC (Safety Over CAN) represents the lightweight safety communication component, used to enhance communication security, which is 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 the interaction with the physical CAN bus. CAN represents the underlying 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 unit.
[0161] In Figure 3 the application layer sends a communication request, such as a send data or receive data command, to the communication management component through an interface. The communication management component forwards the communication request to the lightweight safety communication component for security processing. At this stage, the SafetyOC may add security-related fields to the message or perform necessary security checks. The processed data is routed by the PDUR to deliver the data packet to the appropriate CAN interface component. The data packet is prepared and sent to the CAN bus through the CAN interface component. The CAN interface component interacts with the physical layer CAN bus to send out data packets or receive data packets from the bus. The CAN bus layer communicates with the internal hardware of the electronic control unit through the hardware abstraction layer of the microcontroller. Finally, the data packet is sent or received through the hardware of the electronic control unit and the CAN bus to other electronic control units in the entire vehicle network.
[0162] According to an embodiment of the present application, an embodiment of a communication device of an electronic control unit is provided, and it should be noted that the device can be used to execute the above-mentioned communication method of the electronic control unit. The specific implementation and application scenarios are the same as the above-mentioned embodiment, and will not be repeated here. Figure 4 is a schematic diagram of a communication device of an electronic control unit according to an embodiment of the present application, as Figure 4 shown, the device comprises:
[0163] The first obtaining apparatus 402 is configured to, in response to detecting that there is a communication link between any two electronic control units of the target vehicle, obtain communication data and state data of the communication link.
[0164] The first evaluation module 404 is configured to evaluate a communication state of the communication link based on the communication data and the state data, to obtain a communication state evaluation result, wherein the communication state evaluation result is used to represent whether the communication link is running normally.
[0165] The first determination module 406 is configured to, in response to the communication state evaluation result representing that the communication link is running abnormally, determine an abnormal type of the communication link based on the communication data and the state data.
[0166] The first adjustment module 408 is configured to adjust the communication link based on the abnormal type, and re-establish the communication between any two electronic control units based on the adjusted communication link.
[0167] Further, the first evaluation module is further configured to: evaluate a transmission state of the communication link based on the communication data, to obtain a first evaluation result, wherein the transmission state is used to represent whether there is an error in the transmission of the communication data by the communication link, and the first evaluation result is used to represent whether there is an error between first data content sent by a sender in any two electronic control units and second data content received by a receiver in any two electronic control units; evaluate a running state of the communication link based on the state data, to obtain a second evaluation result, wherein the running state is used to represent an interruption state of the transmission of the communication data by the communication link, and the second evaluation result is used to represent whether there is an interruption in the transmission process of the communication data; and construct the communication state evaluation result based on the first evaluation result and the second evaluation result.
[0168] Further, the first evaluation module is further configured to: check consistency of the communication data, to obtain a consistency check result, wherein the consistency check result is used to represent whether the first data content and the second data content are consistent; check continuity of the communication data, to obtain a continuity check result, wherein the continuity check result is used to represent whether the second data content is continuous; check interaction time of the communication data, to obtain a timeout check result, wherein the timeout check result is used to represent whether a transmission time length from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time length; and construct the first evaluation result based on the consistency check result, the continuity check result, and the timeout check result.
[0169] Further, the first evaluation module is further configured to: process data bytes in the first data content by using preset processing logic to obtain a first checksum; process data bytes in the second data content by using 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 that the first data content and the second data content are consistent; and in response to the first checksum being inconsistent with the second checksum, determine that the consistency check result is that the first data content and the second data content are inconsistent.
[0170] Further, the first evaluation module is further configured to: obtain data numbers in the second data content, wherein the data numbers are constructed by the sender based on a sending order of the first data content; perform continuity detection on the data numbers based on a receiving order of the second data content to obtain a number detection result, wherein the number detection result is used to represent whether continuity of the data numbers meets a preset condition; in response to the number detection result representing that the continuity of the data numbers meets the preset condition, determine that the continuity check result is that the second data content is continuous; and in response to the number detection result representing that the continuity of the data numbers does not meet the preset condition, determine that the continuity check result is that the second data content is discontinuous.
[0171] Further, the first evaluation module is further configured to: perform detection on 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 represent whether the data numbers of the any three adjacent second data contents are the same; perform detection on 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 represent whether a difference between the data numbers of the any two adjacent second data contents is greater than a preset threshold; in response to the first detection result representing that the data numbers of the any three adjacent second data contents are the same, or the second detection result representing that the difference between the data numbers of the any two adjacent second data contents is greater than the preset threshold, determine that the number detection result is that the continuity of the data numbers does not meet the preset condition; and in response to the first detection result representing that the data numbers of the any three adjacent second data contents are not the same, and the second detection result representing that the difference between the data numbers of the any two adjacent second data contents is less than or equal to the preset threshold, determine that the number detection result is that the continuity of the data numbers meets the preset condition.
[0172] Further, the first evaluation module is further configured to: acquire a timeout time for the receiver to receive the second data content; in response to the receiver receiving the second data content within the timeout time, determine that the timeout check result is that a transmission time length from sending the first data content by the sender to receiving the second data content by the receiver does not exceed a preset time length; and in response to the receiver not receiving the second data content within the timeout time, determine that the timeout check result is that the transmission time length exceeds the preset time length.
[0173] Further, the state data comprises network operation data, feedback data sent by the receiver, and an operating voltage of the communication link, and the operating state comprises a network state, a feedback state, and a voltage state; the first evaluation module is further configured to: monitor the network state of the communication link by using the network operation data to obtain a network state monitoring result, wherein the network state monitoring result is used to indicate whether the network state is in a normal state; check the integrity of the feedback data sent by the receiver to obtain a feedback state check result, wherein the feedback state check result is used to indicate whether the feedback data received by the sender is missing; monitor the voltage state of the communication link by using the operating voltage of the communication link to obtain a voltage state monitoring result, wherein the voltage state monitoring result is used to indicate whether the operating voltage is in a preset voltage range; and construct a second evaluation result based on the network state monitoring result, the feedback state check result, and the voltage state monitoring result.
[0174] Further, the abnormal type comprises a transmission state abnormality and an operating state abnormality, and the first adjustment module is further configured to: in response to the abnormal type being the transmission state abnormality, replace the communication data based on a data replacement strategy, and adjust the communication link based on the replaced communication data; and in response to the abnormal type being the operating state abnormality, adjust the operating state of the communication link based on a state adjustment strategy.
[0175] Further, the first adjustment module is further configured to: detect the first data content to determine an operation type corresponding to the first data content, wherein the operation type is used to control an operating mode of the receiver; determine preset data content from a preset database based on the operation type, wherein the preset database is used to store an association relationship between the operation type and the preset data content; and replace the first data content based on the preset data content.
[0176] Further, the first adjustment module is further configured to: in response to the running state exception being a network state exception, adjust the network state based on a network state adjustment strategy; in response to the running state exception being a feedback state exception, adjust the feedback state based on a feedback state adjustment strategy; and in response to the running state exception being a voltage state exception, adjust the voltage state based on a voltage state adjustment strategy.
[0177] Further, the first adjustment module is further configured to: detect the electronic control units to determine whether the electronic control units have the network management modules; in response to any two electronic control units having the network management modules and any two electronic control units being in the first running mode, repeatedly perform the initialization of the communication link and resume the communication link after a first preset time until the network state returns to normal, wherein the communication link does not perform data transmission within the first preset time; and in response to any one of the electronic control units not having the network management module and the any one of the electronic control units being in the second running mode, repeatedly perform the initialization of the communication link within a preset number of times and resume the communication link after a second preset time, wherein the communication link does not perform data transmission within the second preset time, and the second preset time is less than the first preset time.
[0178] Further, the first adjustment module is further configured to: in response to the network state returning to normal within the preset number of times, determine that the network state is successfully recovered; and in response to the network state not returning to normal within the preset number of times, repeatedly perform the initialization of the communication link and resume the communication link after a third preset time until the network state returns to normal, wherein the communication link does not perform data transmission within the third preset time, wherein the third preset time is greater than the second preset time, and the third preset time is less than the first preset time.
[0179] Further, the first adjustment module is further configured to: in response to the communication link being in data transmission and a time for the sender not receiving the feedback data sent by the receiver reaching a fourth preset time, repeatedly perform the initialization of the communication link and resume the communication link after a fifth preset time until the sender receives the feedback data.
[0180] Further, the first adjustment module is further configured to: in response to the running voltage being outside a preset voltage range, adjust the running voltage to be within the preset voltage range, wherein the preset voltage range is used to represent a voltage range when the communication link is normally running.
[0181] Further, the first determining module is further configured to: in response to the consistency check result representing that the first data content and the second data content are inconsistent, or the continuity check result representing that the second data content is discontinuous, or the timeout check result representing that a transmission time length between sending the first data content by the sending party and receiving the second data content by the receiving party exceeds a preset time length, determine that the abnormal type is a transmission state abnormality; in response to the network state monitoring result representing that the network state of the communication link is in an abnormal state, determine that the abnormal type is a network state abnormality; in response to the feedback state check result representing that the feedback data received by the sending party is missing, determine that the abnormal type is a feedback state abnormality; and in response to the voltage state monitoring result representing that the operating voltage of the communication link is outside a preset voltage range, determine that the abnormal type is a voltage state abnormality.
[0182] Further, the apparatus further includes: a second obtaining module configured to obtain a configuration file of the communication link, wherein the configuration file is used to construct the communication link between any two electronic control units; a first analyzing module configured to input the configuration file into a configuration analysis model, and analyze the configuration file by using the configuration analysis model to obtain link configuration parameters; and a first constructing module configured to construct the communication link based on the link configuration parameters.
[0183] Embodiments of the present application further provide an electronic device, including: a memory storing an executable program; and a processor configured to run the program, wherein the program is configured to execute the method in the embodiments of the present application when running.
[0184] Embodiments of the present application further provide a computer readable storage medium, including a stored executable program, wherein the computer readable storage medium is configured to control a device where the computer readable storage medium is located to execute the method in the embodiments of the present application when the executable program runs.
[0185] Embodiments of the present application further provide a computer program product, including a computer program, wherein the computer program is configured to implement the method in the embodiments of the present application when executed by a processor.
[0186] Embodiments of the present application further provide a computer program product, including a non-volatile computer readable storage medium, wherein the non-volatile computer readable storage medium is configured to store a computer program, and the computer program is configured to implement the method in the embodiments of the present application when executed by a processor.
[0187] Embodiments of the present application further provide a computer program, wherein the computer program is configured to implement the method in the embodiments of the present application when executed by a processor.
[0188] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0189] In the above-mentioned embodiments of the present application, the description of each embodiment is focused on, and the part not described in detail in a certain embodiment can be referred to the relevant description of other embodiments.
[0190] In several embodiments provided in the present application, it should be understood that the disclosed technical contents can be implemented by other ways. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units can be a logical function division, and in actual implementation, there can be another division way, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or modules shown or discussed can be indirect coupling or communication connection through some interfaces, and can be electrical or other forms.
[0191] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0192] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of software functional unit.
[0193] The integrated unit, if realized in the form of software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part of the prior art or the whole or part of the technical solutions can be embodied in the form of software product, and the computer software product stored in a storage medium includes a plurality of instructions for making a computer device (which can be a personal computer, a server or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. The foregoing storage medium includes U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and various program code storage media.
[0194] The above-mentioned is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be regarded as the protection scope of the present application.
Claims
1. A communication method of an electronic control unit, characterized by, The method comprises: in response to detecting that there is a communication link between any two electronic control units of a target vehicle, obtaining communication data and state data of the communication link; based on the communication data and the state data, evaluating the communication state of the communication link to obtain a communication state evaluation result, wherein the communication state evaluation result is used to represent whether the communication link is running normally; in response to the communication state evaluation result representing that the communication link is running abnormally, determining an abnormal type of the communication link based on the communication data and the state data; based on the abnormal type, adjusting the communication link, and re-establishing the communication between the any two electronic control units based on the adjusted communication link.
2. The communication method of an electronic control unit according to claim 1, characterized by, based on the communication data and the state data, evaluating the communication state of the communication link to obtain a communication state evaluation result, comprising: based on the communication data, evaluating the transmission state of the communication link to obtain a first evaluation result, wherein the transmission state is used to represent whether there is an error in the transmission of the communication data by the communication link, and the first evaluation result is used to represent whether there is an error between the first data content sent by the sender in the any two electronic control units and the second data content received by the receiver in the any two electronic control units; based on the state data, evaluating the running state of the communication link to obtain a second evaluation result, wherein the running state is used to represent the interruption state of the transmission of the communication data by the communication link, and the second evaluation result is used to represent whether the transmission process of the communication data is interrupted; based on the first evaluation result and the second evaluation result, constructing the communication state evaluation result.
3. The communication method of an electronic control unit according to claim 2, characterized by, based on the communication data, evaluating the transmission state of the communication link to obtain a first evaluation result, comprising: verifying the consistency of the communication data to obtain a consistency verification result, wherein the consistency verification result is used to represent 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 represent 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 represent whether the transmission time length from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time length; based on the consistency verification result, the continuity verification result, and the timeout verification result, constructing the first evaluation result.
4. The communication method of an electronic control unit according to claim 3, characterized by verifying the consistency of the communication data to obtain a consistency verification result, comprising: processing the data bytes in the first data content through a preset processing logic to obtain a first checksum; processing the data bytes in the second data content through the preset processing logic to obtain a second checksum; in response to the first checksum being consistent with the second checksum, determining the consistency check result as the first data content and the second data content being consistent; in response to the first checksum being inconsistent with the second checksum, determining the consistency check result as the first data content and the second data content being inconsistent.
5. The communication method of an electronic control unit according to claim 3, wherein checking continuity of the communication data to obtain a continuity check result, comprising: obtaining a data number in the second data content, wherein the data number is constructed by the sender based on a sending order of the first data content; detecting continuity of the data number based on a receiving order of the second data content to obtain a number detection result, wherein the number detection result is used to represent whether the continuity of the data number meets a preset condition; in response to the number detection result representing that the continuity of the data number meets the preset condition, determining the continuity check result as the second data content being continuous; in response to the number detection result representing that the continuity of the data number does not meet the preset condition, determining the continuity check result as the second data content being discontinuous.
6. The communication method of an electronic control unit according to claim 5, wherein detecting continuity of the data number based on a receiving order of the second data content to obtain a number detection result, comprising: detecting 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 represent whether the data numbers of the any three adjacent second data contents are same; detecting 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 represent whether a difference between the data numbers of the any two adjacent second data contents is greater than a preset threshold value; in response to the first detection result representing that the data numbers of the any three adjacent second data contents are same, or the second detection result representing that the difference between the data numbers of the any two adjacent second data contents is greater than the preset threshold value, determining the number detection result as the continuity of the data number not meeting the preset condition; in response to the first detection result representing that the data numbers of the any three adjacent second data contents are not same, and the second detection result representing that the difference between the data numbers of the any two adjacent second data contents is less than or equal to the preset threshold value, determining the number detection result as the continuity of the data number meeting the preset condition.
7. The communication method of an electronic control unit according to claim 3, wherein checking interaction time of the communication data to obtain a timeout check result, comprising: obtaining a timeout time for the receiver to receive the second data content; in response to the receiver receiving the second data content within the timeout time, determining the timeout check result as a transmission time length between sending the first data content from the sender and receiving the second data content by the receiver not exceeding a preset time length; In response to the receiver not receiving the second data content within the timeout time, determining that the timeout check result is that a transmission time length between sending the first data content from the sender and receiving the second data content by the receiver exceeds a preset time length.
8. The communication method of an electronic control unit according to claim 2, characterized by, The state data includes network operation data, feedback data sent by the receiver, and operation voltage of the communication link, and the operation state includes a network state, a feedback state, and a voltage state; based on the state data, the operation state of the communication link is evaluated to obtain a second evaluation result, including: The network operation data is used to monitor the network state of the communication link to obtain a network state monitoring result, wherein the network state monitoring result is used to represent whether the network state is in a normal state; The integrity of the feedback data sent by the receiver is checked to obtain a feedback state check result, wherein the feedback state check result is used to represent whether the feedback data received by the sender is missing; The operation voltage of the communication link is used to monitor the voltage state of the communication link to obtain a voltage state monitoring result, wherein the voltage state monitoring result is used to represent whether the operation voltage is in a preset voltage range; The second evaluation result is constructed based on the network state monitoring result, the feedback state monitoring result, and the voltage state monitoring result.
9. The communication method of an electronic control unit according to claim 1, wherein The abnormal type includes a transmission state abnormality and an operation state abnormality, and the communication link is adjusted based on the abnormal type, including: In response to the abnormal type being the transmission state abnormality, 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 abnormal type being the operation state abnormality, the operation state of the communication link is adjusted based on a state adjustment strategy.
10. The communication method of an electronic control unit according to claim 9, wherein The communication data is replaced based on a data replacement strategy, including: The first data content is detected to determine an operation type corresponding to the first data content, wherein the operation type is used to control the operation mode of the receiver; The preset data content is determined from a preset database based on the operation type, wherein the preset database is used to store an association relationship between the operation type and the preset data content; The first data content is replaced based on the preset data content.
11. The communication method of an electronic control unit according to claim 9, wherein The operation state abnormality includes a network state abnormality, a feedback state abnormality, and a voltage state abnormality, and the operation state of the communication link is adjusted based on a state adjustment strategy, including: In response to the operation state abnormality being the network state abnormality, the network state is adjusted based on a network state adjustment strategy; In response to the operation state abnormality being the feedback state abnormality, the feedback state is adjusted based on a feedback state adjustment strategy; In response to the operation state abnormality being the voltage state abnormality, the voltage state is adjusted based on a voltage state adjustment strategy.
12. The communication method of an electronic control unit according to claim 11, wherein The network state is adjusted based on a network state adjustment strategy, including: detecting the electronic control unit to determine whether the electronic control unit has a network management module; in response to the network management module being configured in any two electronic control units and the any two electronic control units being in a first operation mode, repeatedly performing initialization of the communication link and resuming the communication link after a first preset time, wherein the communication link does not perform data transmission within the first preset time; in response to the network management module not being configured in any one of the any two electronic control units and the any one electronic control unit being in a second operation mode, repeatedly performing initialization of the communication link within a preset number of times and resuming the communication link after a second preset time, wherein the communication link does not perform data transmission within the second preset time, and the second preset time is less than the first preset time.
13. The communication method of an electronic control unit according to claim 12, wherein repeatedly performing initialization of the communication link within a preset number of times and resuming the communication link after a second preset time, comprising: in response to the network state being restored to normal within the preset number of times, determining that the network state is successfully restored; in response to the network state not being restored to normal within the preset number of times, repeatedly performing initialization of the communication link and resuming the communication link after a third preset time until the network state is restored to normal, wherein the communication link does not perform data transmission within the third preset time, wherein the third preset time is greater than the second preset time and the third preset time is less than the first preset time.
14. The communication method of an electronic control unit according to claim 11, wherein adjusting the feedback state based on a feedback state adjustment strategy, comprising: in response to the communication link being in data transmission and the time for the sender not receiving feedback data sent by the receiver reaching a fourth preset time, repeatedly performing initialization of the communication link and resuming the communication link after a fifth preset time until the sender receives the feedback data.
15. The communication method of an electronic control unit according to claim 11, wherein adjusting the voltage state based on a voltage state adjustment strategy, comprising: in response to the operating voltage being outside a preset voltage range, adjusting the operating voltage to be within the preset voltage range, wherein the preset voltage range is used to represent a voltage range when the communication link is normally operating.
16. The communication method of an electronic control unit according to claim 11, wherein determining an abnormal type of the communication link based on the communication data and the state data, comprising: in response to a consistency check result representing that the first data content and the second data content are inconsistent, or a continuity check result representing that the second data content is not continuous, or a timeout check result representing that the transmission time length from the sender sending the first data content to the receiver receiving the second data content exceeds a preset time length, determining that the abnormal type is a transmission state abnormality; in response to a network state monitoring result representing that the network state of the communication link is in an abnormal state, determining that the abnormal type is a network state abnormality; in response to a feedback state check result representing that the feedback data received by the sender is missing, determining that the abnormal type is a feedback state abnormality; In response to the voltage state monitoring result indicating that an operating voltage of the communication link is out of a preset voltage range, the abnormal type is determined as a voltage state abnormality.
17. The communication method of an electronic control unit according to claim 1, wherein The method further comprises: obtaining a configuration file of the communication link, wherein the configuration file is used to construct the communication link between the two electronic control units; inputting the configuration file into a configuration parsing model, and parsing the configuration file by using the configuration parsing model to obtain link configuration parameters; constructing the communication link based on the link configuration parameters.
18. A computer-readable storage medium, characterized in that, The computer readable storage medium comprises a stored program, wherein the program, when executed, controls a processor of the device to execute the method of any one of claims 1-17.
19. An electronic device, comprising: comprises: one or more processors; a 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 execute the method of any one of claims 1-17.
Citation Information
Patent Citations
Communication method and device, ECU, vehicle and storage medium
CN113162928A
Vehicle-mounted Ethernet link state identification method, device, equipment, medium, product and vehicle
CN119728478A
CAN bus anomaly detection method and device, vehicle controller and medium
CN119945930A
Vehicle-mounted diagnosis system based on CAN communication and adjustable power supply and method thereof
CN120161820A