Vehicle CAN network quality early warning method, system, device and medium

By detecting and recording error frames in the vehicle CAN network in real time, judging the fault type and issuing early warnings to the driver, the problem of signal interference and bus load rate in the vehicle CAN network is solved, and the safety and stability of the vehicle are improved.

CN119854103APending Publication Date: 2025-04-18SINO TRUK JINAN POWER CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510017453.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-04-18

AI Technical Summary

Technical Problem

As the number of control units increases in the vehicle CAN network, signal interference, signal attenuation and error frame frequency are transmitted, resulting in an increase in the bus load rate and a decrease in transmission efficiency. It may even cause the vehicle control unit to enter the bus shutdown state, causing serious vehicle failures and safety hazards.

Method used

By setting the error frame timing flag array and the data record log array, the bus CAN message is detected in real time and whether it causes the error frame to occur. If the error frame occurs, save the message address and detect the interval of adjacent error frames. If it is less than the preset threshold, set 1 in the error frame timing flag array to determine whether there is a CAN fault alarm, and judge the fault type based on the data record log array, and issue early warning information to the driver.

Benefits of technology

It realizes timely diagnosis and early warning of vehicle CAN network failures, improves the active safety of the vehicle, avoids vehicle failures caused by excessive bus loading rate, and improves the operating stability and reliability of the vehicle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119854103A_ABST
    Figure CN119854103A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle CAN network quality early warning method, system and device and a medium, and belongs to the technical field of vehicle CAN networks, and the method comprises the following steps: a vehicle body control unit identifies a message address after detecting a bus CAN message, and judges whether an error frame is caused or not; if not, discarding the message address; if yes, the message address is stored in a data recording log array, meanwhile, whether the occurrence interval of adjacent error frames is smaller than a preset interval threshold value or not is detected, and when the occurrence interval of the adjacent error frames is smaller than the preset interval threshold value, a corresponding item in an error frame timing mark array is set to be 1; and the vehicle body control unit judges a CAN fault alarm according to the error frame timing mark array and the data recording log array. According to the method, the fault type and position of the vehicle CAN network can be accurately judged through accurate detection and recording of the error frames, so that potential problems of the vehicle CAN network can be found in time, and safety accidents caused by network faults of the vehicle are avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of vehicle CAN network, and in particular relates to a vehicle CAN network quality early warning method, system, equipment and medium. Background Art

[0002] The vehicle CAN network is the basis of internal vehicle communication. Through the vehicle CAN network, various control units inside the vehicle can exchange data in real time and work together to ensure the overall performance and safety of the vehicle. However, with the development of commercial vehicles, especially with the increase in the number of vehicle CAN control units, the vehicle CAN network faces challenges.

[0003] First, with the increase in the number of vehicle CAN control units, the amount of data transmitted on the vehicle CAN network has also begun to increase, which makes the signal susceptible to interference during transmission, resulting in signal attenuation, distortion, and even error frames. At present, frequent error frames are a common problem in vehicle CAN networks. These error frames not only occupy limited bus resources, but also may cause confusion in data transmission, further affecting the operation of the vehicle. Secondly, with the increase in bus load rate, the transmission efficiency of the vehicle CAN network is greatly limited. Under high load rates, CAN message transmission delays often occur, which not only reduces the real-time performance of internal vehicle communication, but also has an adverse effect on the control accuracy and response speed of the vehicle. Under extreme conditions, excessive bus load may even cause the vehicle control unit to enter the bus shutdown state, paralyzing the entire vehicle system, thereby causing serious vehicle failures and posing a great threat to driving safety. However, most vehicles on the market lack early warning measures for CAN network quality, and cannot diagnose the status of the CAN bus and the health of the vehicle CAN control unit in real time. Therefore, before the vehicle CAN network fails, it is impossible to issue early warning information to the driver in advance, which poses a great safety hazard. Summary of the invention

[0004] In a first aspect, an embodiment of the present application provides a vehicle CAN network quality early warning method, comprising the following steps: S1. Set the error frame timing flag array and data record log array, and use the vehicle key power-on as the statistical period; S2. After the body control unit detects the bus CAN message, it identifies the address of the bus CAN message and determines whether the sending of the bus CAN message causes an error frame to occur; If no error frame occurs, the address of the bus CAN message is discarded; If an error frame occurs, the address of the bus CAN message is saved in the corresponding item of the data record log array. At the same time, it is detected whether the occurrence interval of adjacent error frames is less than the preset interval threshold. If it is less than the preset interval threshold, the corresponding item in the error frame timing flag array is set to 1; S3. The body control unit determines whether a CAN fault alarm exists according to the error frame timing flag array, and when a CAN fault alarm exists, determines the type of CAN fault alarm according to the data record log array.

[0005] Furthermore, the specific steps of step S1 are as follows: S11. Set the error frame timing flag array Tn and data record log array Sn of the same length; S12. The time period between when the vehicle key is powered on and when the vehicle key is powered off is taken as a statistical period.

[0006] Furthermore, the specific steps of step S2 are as follows: S21. The body control unit detects the bus CAN message after the vehicle key is powered on; If no bus CAN message is detected, go to step S22; If bus CAN message n is detected, go to step S23; S22. Wait for the set time period and return to step S21; S23. The body control unit identifies the address of the bus CAN message and records the address of the bus CAN message into the corresponding item of the data recording log array Sn; S24. The body control unit determines whether an error frame occurs during or within a set time period after the bus CAN message is sent; If yes, go to step S26; If not, proceed to step S25; S25. The body control unit discards the address of the CAN message in the corresponding item of the data record log array Sn and proceeds to step S3; S26. The body control unit retains the address of the CAN message in the corresponding item of the data log record array Sn; S27. The vehicle body control unit detects whether the interval between adjacent error frames is less than a preset time threshold, and if it is less than the preset time threshold, sets the corresponding item in the error frame timing flag array to 1.

[0007] Further, in step S23, if the data record log array Sn has been completely filled in the current statistical period, the address of the latest bus CAN message overwrites the data in the data record log array Sn according to the recording time; In step S27, if the error frame timing flag array Tn has been completely filled in the current statistical period, the data in the error frame timing flag array Tn are overwritten in the order of the setting time of the data.

[0008] Furthermore, step S2 also includes the following steps: When the vehicle key is powered off, the statistical cycle ends, and the error frame timing flag array Tn and the data record log array Sn are cleared.

[0009] Furthermore, the specific steps of step S27 are as follows: S271. The body control unit detects whether an error frame occurs for the first time; If yes, set the error frame timer to start timing from 0 and go to step S3; If not, proceed to step S272; S272. The body control unit determines whether the duration of the error frame timer is less than a preset time threshold; If yes, go to step S273; If not, proceed to step S274; S273. The body control unit sets the corresponding item in the error frame timing flag array Tn to 1, and sets the error frame timer to start timing from 0, and proceeds to step S3; S274. The vehicle body control unit sets the corresponding item in the error frame timing representation array Tn to 0, and sets the error frame timer to start timing from 0, and enters step S3.

[0010] Furthermore, the specific steps of step S3 are as follows: S31. The body control unit determines whether all the data in the error frame timing representation array Tn are 1; If not, proceed to step S32; If yes, go to step S33; S32. The body control unit determines that there is no CAN fault alarm, and returns to step S21; S33. The body control unit determines whether the addresses of the CAN messages of each bus in the data recording log array Sn are consistent; If they are consistent, identify the vehicle CAN control unit corresponding to the address of the consistent bus CAN message, and proceed to step S34; If they are not consistent, go to step S35; S34. The body control unit sends a vehicle CAN control unit failure alarm to the driver through the vehicle instrument control unit, and ends; S35. The body control unit sends a CAN bus fault alarm to the driver through the vehicle instrument control unit.

[0011] In a second aspect, the embodiment of the present application further provides a vehicle CAN network quality early warning system, comprising: An array setting and statistical period setting module is used to set the error frame timing flag array and the data recording log array, and use the vehicle key power-on as the statistical period; The error frame CAN message address recording and high-frequency error recording module is used to identify the address of the bus CAN message after the bus CAN message is detected by the vehicle body control unit, and determine whether the sending of the bus CAN message causes the occurrence of an error frame; if the error frame does not occur, the address of the bus CAN message is discarded; if the error frame occurs, the address of the bus CAN message is saved in the corresponding item of the data recording log array, and at the same time, it is detected whether the occurrence interval of adjacent error frames is less than the preset interval threshold, and when it is less than the preset interval threshold, the corresponding item in the error frame timing flag array is set to 1; The CAN network warning module is used to determine whether there is a CAN fault alarm based on the error frame timing flag array through the body control unit, and when there is a CAN fault alarm, determine the type of CAN fault alarm based on the data record log array.

[0012] In a third aspect, an embodiment of the present application further provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein when the processor executes the program, the steps of the vehicle CAN network quality warning method as described in the first aspect are implemented.

[0013] In a fourth aspect, an embodiment of the present application further provides a storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the vehicle CAN network quality warning method as described in the first aspect are implemented.

[0014] It can be seen from the above technical solutions that the present invention has the following advantages: In the vehicle CAN network quality warning method, system, device and medium provided by the present application, the CAN bus fault status is diagnosed through the frequency of CAN error frames, and in the event of a CAN bus fault, a warning message is sent to the driver through the vehicle instrument to remind the driver to inspect the vehicle CAN bus, thereby improving the active safety of the vehicle; the vehicle CAN control unit with CAN fault is judged through CAN messages during the occurrence of CAN error frames, and in the event of a vehicle CAN control unit fault, a warning message is sent to the driver through the vehicle instrument to remind the driver to inspect the vehicle CAN control unit, thereby improving the active safety of the vehicle.

[0015] In addition, the application principle is simple, easy to implement, requires little modification to software and hardware, is low-cost, and can be applied to a variety of CAN network topologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solution of the present invention, the accompanying drawings required for use in the description will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

[0017] Figure 1 The figure is a flow chart of an embodiment of a vehicle CAN network quality early warning method of the present invention.

[0018] Figure 2 The figure is a flow chart of another embodiment of the vehicle CAN network quality early warning method of the present invention.

[0019] Figure 3 The present invention is a flow chart of setting the error frame timing flag array according to the occurrence interval of adjacent error frames.

[0020] Figure 4 It is a schematic diagram of the vehicle CAN network of the present invention.

[0021] Figure 5 It is a schematic diagram of the vehicle CAN network quality early warning system of the present invention. DETAILED DESCRIPTION

[0022] In the specific steps of the vehicle CAN network quality early warning method, which will be described in detail below, various embodiments of the present disclosure will be described more comprehensively. The present disclosure may have various embodiments, and adjustments and changes may be made therein. However, it should be understood that there is no intention to limit the various embodiments of the present disclosure to the specific embodiments disclosed herein, but rather the present disclosure should be understood to cover all adjustments, equivalents and / or alternatives that fall within the spirit and scope of the various embodiments of the present disclosure.

[0023] For example, at present, with the increasing use of CAN control units in commercial vehicles, the quality of vehicle CAN signals is uneven, there are many CAN error frames, and the load rate of the CAN bus is gradually increasing. However, the uneven quality of CAN signals will lead to error frames, and too many error frames will lead to excessive load rate of the CAN bus, resulting in delays in CAN message transmission. Poor quality of the vehicle CAN network will cause the vehicle control unit to enter the bus-off state, or even vehicle failure. Therefore, it is very necessary to perform real-time diagnosis of the status of the vehicle CAN bus and the vehicle CAN control unit, and send warning information to the driver in advance, in order to improve the quality of the CAN network and the reliability of the whole vehicle function. At present, most vehicles have no CAN network quality warning measures, which poses a major safety hazard to the vehicle CAN network and certain safety hazards to the vehicle's functions.

[0024] In response to the above problems, this embodiment provides a vehicle CAN network quality warning method, which can effectively solve the interference of faulty CAN nodes on the CAN network, reduce the problem of excessive CAN bus load rate caused by CAN error frames, and promptly report to the driver for reminder before the vehicle CAN control unit enters the bus shutdown. It is suitable for most vehicle CAN networks, improves the reliability of the vehicle CAN network, and improves the active safety of the vehicle.

[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0026] See also Figure 1 The figure is a flow chart of a vehicle CAN network quality early warning method in a specific embodiment, the method comprises the following steps: S1. Set the error frame timing flag array and data record log array, and use the vehicle key power-on as the statistical period; It should be noted that by presetting the array and setting the statistical period, diagnostic data is provided for subsequent CAN network quality analysis; S2. After the body control unit detects the bus CAN message, it identifies the address of the bus CAN message and determines whether the sending of the bus CAN message causes an error frame to occur; If no error frame occurs, the address of the bus CAN message is discarded; If an error frame occurs, the address of the bus CAN message is saved in the corresponding item of the data record log array. At the same time, it is detected whether the occurrence interval of adjacent error frames is less than the preset interval threshold. If it is less than the preset interval threshold, the corresponding item in the error frame timing flag array is set to 1; It should be noted that by detecting CAN messages in real time and determining whether they cause error frames, abnormal conditions in the network can be discovered in a timely manner. Sensitive detection of error frames helps to respond quickly and avoid potential network failures; S3. The body control unit determines whether there is a CAN fault alarm according to the error frame timing flag array, and when there is a CAN fault alarm, determines the type of CAN fault alarm according to the data record log array; It should be noted that by comprehensively analyzing the information of the error frame timing flag array and the data record log array, it is possible to accurately determine whether a CAN fault exists and determine the type of fault, so as to quickly locate the problem and take corresponding measures to avoid further deterioration of the fault.

[0027] This embodiment can timely discover potential problems of the vehicle CAN network by real-time monitoring of the occurrence of error frames and recording related data, thereby improving the safety and stability of vehicle operation.

[0028] Further, as a refinement and expansion of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another vehicle CAN network quality early warning method is provided, such as Figure 2 As shown, the method comprises the following steps: S1. Set the error frame timing flag array and data record log array, and use the vehicle key power-on as the statistical period; the specific steps of step S1 are as follows: S11. Set the error frame timing flag array Tn and data record log array Sn of the same length; S12. The time period between when the vehicle key is powered on and when the vehicle key is powered off is taken as a statistical period; It should be noted that the setting method of the error frame timing flag array and the data record log array, as well as the method for determining the statistical period, provide a basis for subsequent error detection and early warning; S2. After the body control unit detects the bus CAN message, it identifies the address of the bus CAN message and determines whether the sending of the bus CAN message causes an error frame to occur; If no error frame occurs, the address of the bus CAN message is discarded; If an error frame occurs, the address of the bus CAN message is saved in the corresponding item of the data record log array. At the same time, it is detected whether the occurrence interval of adjacent error frames is less than the preset interval threshold. If it is less than the preset interval threshold, the corresponding item in the error frame timing flag array is set to 1; The specific steps of step S2 are as follows: S21. The body control unit detects the bus CAN message after the vehicle key is powered on; If no bus CAN message is detected, go to step S22; If bus CAN message n is detected, go to step S23; S22. Wait for the set time period and return to step S21; S23. The body control unit identifies the address of the bus CAN message and records the address of the bus CAN message into the corresponding item of the data recording log array Sn; S24. The body control unit determines whether an error frame occurs during or within a set time period after the bus CAN message is sent; If yes, go to step S26; If not, proceed to step S25; S25. The body control unit discards the address of the CAN message in the corresponding item of the data record log array Sn and proceeds to step S3; S26. The body control unit retains the address of the CAN message in the corresponding item of the data log record array Sn; S27. The vehicle body control unit detects whether the interval between adjacent error frames is less than a preset time threshold, and if it is less than the preset time threshold, sets the corresponding item in the error frame timing flag array to 1; It should be noted that error frame detection and recording ensures that error frame information can be accurately captured and recorded, providing reliable data for subsequent fault warnings; S3. The body control unit determines whether there is a CAN fault alarm according to the error frame timing flag array, and when there is a CAN fault alarm, determines the CAN fault alarm type according to the data record log array; the specific steps of step S3 are as follows: S31. The body control unit determines whether all the data in the error frame timing representation array Tn are 1; If not, proceed to step S32; If yes, go to step S33; S32. The body control unit determines that there is no CAN fault alarm, and returns to step S21; S33. The body control unit determines whether the addresses of the CAN messages of each bus in the data recording log array Sn are consistent; If they are consistent, identify the vehicle CAN control unit corresponding to the address of the consistent bus CAN message, and proceed to step S34; If they are not consistent, go to step S35; S34. The body control unit sends a vehicle CAN control unit failure alarm to the driver through the vehicle instrument control unit, and ends; Specifically, the vehicle CAN control unit may include a power control unit and a transmission control unit. Figure 4 As shown, the vehicle body control unit, the instrument control unit, the power control unit, the transmission control unit and the CAN bus together form the vehicle CAN network; and the CAN bus is composed of a high CAN_H and a low CAN_H and two terminal resistors between the high CAN_H and the low CAN_H; S35. The body control unit sends a CAN bus fault alarm to the driver through the vehicle instrument control unit; It should be noted that, according to the information of the error frame timing flag array and the data record log array, the fault type can be accurately determined and corresponding warning information can be issued to the driver, thereby improving the safety and reliability of the vehicle.

[0029] In this embodiment, in order to improve the real-time performance and effectiveness of the system, the error frame timing flag array Tn and the data record log array Sn are used cyclically, specifically: In step S23, if the data record log array Sn has been completely filled in the current statistical period, the address of the latest bus CAN message overwrites the data in the data record log array Sn according to the recording time; In step S27, if the error frame timing flag array Tn has been completely filled in the current statistical period, the data in the error frame timing flag array Tn are overwritten in the order of the data setting time; It should be noted that the data coverage strategy ensures that the array can continuously record the latest error frame information within a limited space, providing the timeliness and effectiveness of the vehicle CAN network quality warning.

[0030] In addition, in this embodiment, step S2 also includes the following steps: When the vehicle key is powered off, the statistical cycle ends, and the error frame timing flag array Tn and the data record log array Sn are cleared; It should be noted that the array is cleared at the end of the statistical period to ensure that the data of each statistical period is independent, which is convenient for subsequent data analysis and fault warning.

[0031] In an embodiment of the present invention, based on step S27, a possible embodiment is given below to illustrate its specific implementation scheme in a non-limiting manner.

[0032] like Figure 3 As shown, the specific steps of step S27 are as follows: S271. The body control unit detects whether an error frame occurs for the first time; If yes, set the error frame timer to start timing from 0 and go to step S3; If not, proceed to step S272; S272. The body control unit determines whether the duration of the error frame timer is less than a preset time threshold; If yes, go to step S273; If not, proceed to step S274; S273. The body control unit sets the corresponding item in the error frame timing flag array Tn to 1, and sets the error frame timer to start timing from 0, and proceeds to step S3; S274. The body control unit sets the corresponding item in the error frame timing representation array Tn to 0, and sets the error frame timer to start timing from 0, and proceeds to step S3; It should be noted that, by setting the error frame timer, the frequency of error frame occurrence can be determined more accurately, further improving the accuracy of fault warning.

[0033] For example, taking the error frame timing flag array Tn and the data recording log array Sn as an example, the maximum length of the two arrays is 10, the records of the data recording log array Sn and the error frame timing flag array Tn correspond one to one, and the data recording log array Sn and the error frame timing flag array Tn are continuously updated with the occurrence of error frames. The latest error frame covers the earliest error frame, and the data recording log array Sn and the error frame timing flag array Tn are cleared at the end of each cycle. The body control unit judges the data record log array Sn and the error frame timing mark array Tn in real time. When the T1 to T10 arrays are all 1, that is, the time interval between the occurrence of 10 bus error frames on the bus is within 1 minute, and the M1 to M10 message addresses are inconsistent, the body control unit sends a CAN bus fault alarm to the driver through the vehicle instrument control unit; when the T1 to T10 arrays are all 1, and the M1 to M10 array message addresses are consistent, the body control unit sends a vehicle CAN control unit alarm to the driver through the vehicle instrument control unit; when the T1 to T10 arrays are not all 1, that is, the time interval between the occurrence of 10 bus error frames on the bus is greater than 1 minute, the body control unit has no CAN fault alarm.

[0034] like Figure 5 As shown, the following is an embodiment of the vehicle CAN network quality warning system provided by the embodiment of the present disclosure. The system and the vehicle CAN network quality warning method of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the vehicle CAN network quality warning system, please refer to the embodiment of the above-mentioned vehicle CAN network quality warning method.

[0035] The system includes: An array setting and statistical period setting module is used to set the error frame timing flag array and the data recording log array, and use the vehicle key power-on as the statistical period; The error frame CAN message address recording and high-frequency error recording module is used to identify the address of the bus CAN message after the bus CAN message is detected by the vehicle body control unit, and determine whether the sending of the bus CAN message causes the occurrence of an error frame; if the error frame does not occur, the address of the bus CAN message is discarded; if the error frame occurs, the address of the bus CAN message is saved in the corresponding item of the data recording log array, and at the same time, it is detected whether the occurrence interval of adjacent error frames is less than the preset interval threshold, and when it is less than the preset interval threshold, the corresponding item in the error frame timing flag array is set to 1; The CAN network warning module is used to determine whether there is a CAN fault alarm based on the error frame timing flag array through the body control unit, and when there is a CAN fault alarm, determine the type of CAN fault alarm based on the data record log array.

[0036] This embodiment realizes the automation and intelligence of vehicle CAN network quality warning through modular system design, and improves the maintainability and scalability of the system.

[0037] The vehicle CAN network quality early warning method provided in the embodiment of the present application can be applied to electronic devices. Those skilled in the art will appreciate that the electronic device structure involved in the embodiment of the present invention does not constitute a limitation on the electronic device, and the electronic device may include more or fewer components than shown, or combine certain components, or arrange different components. In an embodiment of the present invention, the electronic device includes but is not limited to a laptop computer, a desktop computer, a workbench, a personal digital assistant, a server, a blade server, a mainframe computer, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or required herein.

[0038] The electronic device may include a processor, an external memory interface, an internal memory, a universal serial bus (USB) interface, a charging management module, a power management module, a battery, a wireless communication module, an audio module, a speaker, a microphone, a sensor module, buttons, a camera, a display, and a SIM card interface, etc.

[0039] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0040] The processor may include one or more processing units, for example, the processor may include a central processing unit (CPU), an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors.

[0041] The processor can be the nerve center and command center of the electronic device. The controller can generate an operation control signal according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0042] A memory may also be provided in the processor for storing instructions and data. In some embodiments, the memory in the processor is a cache memory. The memory may store instructions or data that the processor has just used or is cyclically used. If the processor needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor, and thus improves system efficiency.

[0043] The above-mentioned electronic device implements the vehicle CAN network quality warning method of the present application, which determines the vehicle CAN control unit with CAN failure through the CAN message during the occurrence of the CAN error frame, and sends a warning message to the driver through the vehicle instrument when the vehicle CAN control unit fails, reminding the driver to inspect the vehicle CAN control unit, thereby achieving the beneficial effect of improving the safety of the vehicle.

[0044] The storage medium provided in the present application stores a program product that can implement a vehicle CAN network quality early warning method.

[0045] The vehicle CAN network quality early warning method includes: setting an error frame timing flag array and a data recording log array, and using the vehicle key power-on as a statistical period; after the body control unit detects the bus CAN message, it identifies the address of the bus CAN message and determines whether the sending of the bus CAN message causes an error frame to occur; if the error frame does not occur, the address of the bus CAN message is discarded; if the error frame occurs, the address of the bus CAN message is saved in the corresponding item of the data recording log array, and at the same time, it is detected whether the occurrence interval of adjacent error frames is less than a preset interval threshold, and when it is less than the preset interval threshold, the corresponding item in the error frame timing flag array is set to 1; the body control unit determines whether there is a CAN fault alarm based on the error frame timing flag array, and when there is a CAN fault alarm, the type of CAN fault alarm is determined based on the data recording log array.

[0046] In some possible implementations, the vehicle CAN network quality warning method disclosed herein can be implemented in the form of a program product, which includes a program code. When the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps described in the above "Exemplary Method" section of this specification according to various exemplary implementations of the present disclosure.

[0047] The storage medium of the present disclosure can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0048] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A vehicle CAN network quality early warning method, characterized in that: The steps include: S1. Set the error frame timing flag array and data record log array, and use the vehicle key power-on as the statistical period; S2. After the body control unit detects the bus CAN message, it identifies the address of the bus CAN message and determines whether the sending of the bus CAN message causes an error frame to occur; If no error frame occurs, the address of the bus CAN message is discarded; If an error frame occurs, the address of the bus CAN message is saved in the corresponding item of the data record log array. At the same time, it is detected whether the occurrence interval of adjacent error frames is less than the preset interval threshold. If it is less than the preset interval threshold, the corresponding item in the error frame timing flag array is set to 1; S3. The body control unit determines whether a CAN fault alarm exists according to the error frame timing flag array, and when a CAN fault alarm exists, determines the type of CAN fault alarm according to the data record log array.

2. The vehicle CAN network quality early warning method according to claim 1 is characterized in that: The specific steps of step S1 are as follows: S11. Set the error frame timing flag array Tn and data record log array Sn of the same length; S12. The time period between when the vehicle key is powered on and when the vehicle key is powered off is taken as a statistical period.

3. The vehicle CAN network quality early warning method according to claim 2 is characterized in that: The specific steps of step S2 are as follows: S21. The body control unit detects the bus CAN message after the vehicle key is powered on; If no bus CAN message is detected, go to step S22; If bus CAN message n is detected, go to step S23; S22. Wait for the set time period and return to step S21; S23. The body control unit identifies the address of the bus CAN message and records the address of the bus CAN message into the corresponding item of the data recording log array Sn; S24. The body control unit determines whether an error frame occurs during or within a set time period after the bus CAN message is sent; If yes, go to step S26; If not, proceed to step S25; S25. The body control unit discards the address of the CAN message in the corresponding item of the data record log array Sn and proceeds to step S3; S26. The body control unit retains the address of the CAN message in the corresponding item of the data log record array Sn; S27. The vehicle body control unit detects whether the interval between adjacent error frames is less than a preset time threshold, and if it is less than the preset time threshold, sets the corresponding item in the error frame timing flag array to 1.

4. The vehicle CAN network quality early warning method according to claim 3 is characterized in that: In step S23, if the data record log array Sn has been completely filled in the current statistical period, the address of the latest bus CAN message overwrites the data in the data record log array Sn according to the recording time; In step S27, if the error frame timing flag array Tn has been completely filled in the current statistical period, the data in the error frame timing flag array Tn are overwritten in the order of the setting time of the data.

5. The vehicle CAN network quality early warning method according to claim 4 is characterized in that: Step S2 also includes the following steps: When the vehicle key is powered off, the statistical cycle ends, and the error frame timing flag array Tn and the data record log array Sn are cleared.

6. The vehicle CAN network quality early warning method according to claim 5 is characterized in that: The specific steps of step S27 are as follows: S271. The body control unit detects whether an error frame occurs for the first time; If yes, set the error frame timer to start timing from 0 and go to step S3; If not, proceed to step S272; S272. The body control unit determines whether the duration of the error frame timer is less than a preset time threshold; If yes, go to step S273; If not, proceed to step S274; S273. The body control unit sets the corresponding item in the error frame timing flag array Tn to 1, and sets the error frame timer to start timing from 0, and proceeds to step S3; S274. The vehicle body control unit sets the corresponding item in the error frame timing representation array Tn to 0, and sets the error frame timer to start timing from 0, and enters step S3.

7. The vehicle CAN network quality early warning method according to claim 6 is characterized in that: The specific steps of step S3 are as follows: S31. The body control unit determines whether all the data in the error frame timing representation array Tn are 1; If not, proceed to step S32; If yes, go to step S33; S32. The body control unit determines that there is no CAN fault alarm, and returns to step S21; S33. The body control unit determines whether the addresses of the CAN messages of each bus in the data recording log array Sn are consistent; If they are consistent, identify the vehicle CAN control unit corresponding to the address of the consistent bus CAN message, and proceed to step S34; If not, proceed to step S35; S34. The body control unit sends a vehicle CAN control unit failure alarm to the driver through the vehicle instrument control unit, and ends; S35. The body control unit sends a CAN bus fault alarm to the driver through the vehicle instrument control unit.

8. A vehicle CAN network quality early warning system, characterized in that: include: An array setting and statistical period setting module is used to set the error frame timing flag array and the data recording log array, and use the vehicle key power-on as the statistical period; The error frame CAN message address recording and high frequency error recording module is used to identify the address of the bus CAN message after the bus CAN message is detected by the body control unit, and determine whether the sending of the bus CAN message causes an error frame to occur; If no error frame occurs, the address of the bus CAN message is discarded; If an error frame occurs, the address of the bus CAN message is saved in the corresponding item of the data record log array. At the same time, it is detected whether the occurrence interval of adjacent error frames is less than the preset interval threshold. If it is less than the preset interval threshold, the corresponding item in the error frame timing flag array is set to 1; The CAN network warning module is used to determine whether there is a CAN fault alarm based on the error frame timing flag array through the body control unit, and when there is a CAN fault alarm, determine the type of CAN fault alarm based on the data record log array.

9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the vehicle CAN network quality warning method as claimed in any one of claims 1 to 7 when executing the program.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the vehicle CAN network quality early warning method as claimed in any one of claims 1 to 7 are implemented.