Fault code broadcasting method and device, storage medium, controller and vehicle
By using a circular buffer to store fault codes in the electronic controller and broadcasting them sequentially when communication is restored, the problem of fault code loss during external communication anomalies is solved, and timely transmission of fault information is achieved.
Patent Information
- Application Number
- CN202410969088.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-18
- Publication Date
- 2026-01-20
AI Technical Summary
In the existing technology, fault codes of electronic controllers are easily lost when external communication is abnormal, resulting in the inability to obtain ECU fault information in a timely manner, which affects the vehicle's safety monitoring.
By setting up a circular buffer in the electronic controller to store fault code data and broadcasting it in the order of its generation time when external communication returns to normal, the timely transmission of fault code data is ensured.
Even when external communication fails, fault code data can still be stored and broadcast sequentially when communication is restored, avoiding loss and ensuring that other controllers or cloud servers can obtain fault information in a timely manner.
Smart Images

Figure CN121364702A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of vehicle control, and in particular to a fault code broadcasting method and device, a storage medium, a controller and a vehicle. BACKGROUND
[0002] With the popularization of new energy vehicles, the continuous development and improvement of automotive electronic technology, the technical requirements for electronic control units (ECU) are also getting higher and higher, which also increases the difficulty and cost of new energy vehicle maintenance. Therefore, the ECU is developed based on the unified diagnostic service (UDS) to diagnose fault codes (DTC). Nowadays, many vehicle faults are recorded by fault codes to facilitate fault monitoring in development and after-sales maintenance.
[0003] In related technologies, external devices based on the UDS protocol need to obtain corresponding fault information of the ECU through specific instructions. Other controllers or cloud servers cannot obtain the fault information of the ECU in real time, which is not conducive to monitoring the safe operation state of the vehicle. Although some existing technologies can actively broadcast fault information of the ECU, they generally use periodic broadcasting, which seriously occupies communication resources. At the same time, since the fault code is sent immediately after diagnosis, if the external communication of the ECU is abnormal or the bus fails during the diagnosis of the fault code, the ECU cannot send the diagnosed fault code to other ECUs or servers, which may cause loss of fault code data. SUMMARY
[0004] Therefore, the present application provides a fault code broadcasting method, device, storage medium, controller and vehicle to solve the problem of fault code loss caused by abnormal external communication of the electronic controller.
[0005] In one aspect, the present application provides a fault code broadcasting method applied to an electronic controller, comprising:
[0006] monitoring faults of the electronic controller to obtain fault code data obtained by monitoring;
[0007] storing the fault code data in a ring buffer according to the generation time;
[0008] broadcasting the fault code data in the ring buffer according to the storage order when the external communication of the electronic controller is normal.
[0009] Further, in some embodiments, the broadcasting of the fault code data in the ring buffer according to the storage order comprises:
[0010] broadcast the fault code data in the ring buffer according to the storage sequence based on the preset broadcast period, wherein each of the fault code data is repeatedly broadcasted N times based on the preset broadcast period.
[0011] Further, in some embodiments, the broadcasting the fault code data in the ring buffer according to the storage sequence, wherein each of the fault code data is repeatedly broadcasted N times based on the preset broadcast period, comprises:
[0012] repeatedly broadcasting each of the fault code data in the ring buffer according to the storage sequence N times based on the preset broadcast period; or
[0013] cyclically broadcasting the fault code data in the ring buffer according to the storage sequence based on the preset broadcast period, and repeatedly broadcasting N cycles.
[0014] Further, in some embodiments, the method further comprises:
[0015] setting a broadcast interval duration corresponding to the broadcasted fault code data;
[0016] if the same fault code data as the broadcasted fault code data is monitored again within the broadcast interval duration after the broadcasting, prohibiting the repeated broadcasting of the fault code data;
[0017] if the same fault code data as the broadcasted fault code data is monitored again after the broadcast interval duration, repeatedly broadcasting the fault code data.
[0018] Further, in some embodiments, the storing the fault code data in the ring buffer according to the generation time sequence comprises:
[0019] if the same stored fault code data as the fault code data already exists in the ring buffer, judging whether a storage duration corresponding to the stored fault code data exceeds a preset interval duration;
[0020] if the storage duration is less than or equal to the preset interval duration, discarding the fault code data;
[0021] if the storage duration is greater than the preset interval duration, storing the fault code data in the ring buffer according to the generation time sequence.
[0022] Further, in some embodiments, the broadcasting the fault code data in the ring buffer according to the storage sequence comprises:
[0023] Broadcast the fault code data in the ring buffer to a communication bus in a storage order, so that other electronic controllers on the communication bus receive the fault code data.
[0024] Further, in some embodiments, the broadcasting the fault code data in the ring buffer in the storage order comprises:
[0025] Broadcast the fault code data in the ring buffer to a cloud server in the storage order.
[0026] In another aspect, the present application provides a fault code broadcasting device, comprising:
[0027] a fault code acquisition module, configured to monitor faults of the electronic controller and acquire fault code data obtained by the monitoring;
[0028] a fault code storage module, configured to store the fault code data in a ring buffer in a storage order of generation time;
[0029] a fault code broadcasting module, configured to broadcast the fault code data in the ring buffer in the storage order when external communication of the electronic controller is normal.
[0030] In another aspect, the present application provides a storage medium, which stores a computer program, the computer program being adapted to be loaded by a processor and execute steps of the above method.
[0031] In another aspect, the present application further provides a vehicle controller, comprising a processor and a memory; wherein the memory stores a computer program, the computer program being adapted to be loaded by the processor and execute steps of the above method.
[0032] In another aspect, the present application further provides a vehicle comprising the above fault code broadcasting device or vehicle controller.
[0033] According to the fault code broadcasting method provided by the present application, the electronic controller is monitored for faults, and the fault code data obtained by the monitoring is stored in a ring buffer in a storage order of generation time. Even if the external communication of the electronic controller is abnormal, the fault code data monitored in the electronic controller can still be stored in the ring buffer, avoiding the problem of loss of fault codes due to abnormal external communication of the electronic controller. Then, when the external communication of the electronic controller is normal, the fault code data in the ring buffer is broadcast in the storage order, ensuring normal broadcasting of the fault codes, so that other controllers or cloud servers can obtain the fault code data corresponding to the electronic controller in time.
[0034] It is to be understood that the description of the summary section is not intended to identify key or essential features of embodiments of the application, nor is it intended to limit the scope of the application. Other features of the application will be apparent from review of the description below. BRIEF DESCRIPTION OF DRAWINGS
[0035] Figure 1 A flowchart of a fault code broadcasting method provided by an embodiment of the application;
[0036] Figure 2 A flowchart of a fault code broadcasting method provided by an embodiment of the application;
[0037] Figure 3 A structural diagram of a fault code broadcasting device provided by an embodiment of the application;
[0038] Figure 4 A structural diagram of a vehicle controller provided by an embodiment of the application. DETAILED DESCRIPTION
[0039] In order to make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described below in conjunction with specific embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0040] In the description of one or more embodiments of the present application, the term “comprising” and similar terms are to be understood as open-ended, i.e., “including but not limited to”. The term “based on” is to be understood as “based at least in part on”. The term “one embodiment” or “the embodiment” is to be understood as “at least one embodiment”. The terms “first”, “second”, etc. can refer to different or same objects. Other explicit and implicit definitions can also be included below.
[0041] At present, most cars can only obtain ECU fault codes through specific instructions, and ECU fault code data can be lost due to ECU communication abnormalities, for example, when the ECU system is initialized or the communication bus is abnormal, the ECU cannot communicate externally, which is easy to cause the loss of monitored ECU fault codes.
[0042] Based on this, the application provides a fault code broadcasting method, by monitoring the fault of the electronic controller, obtaining the monitored fault code data, storing the fault code data in the ring buffer according to the generation time sequence, even if the external communication of the electronic controller is abnormal, after the fault code data is monitored in the electronic controller, the monitored fault code data can be stored in the ring buffer, the problem of fault code loss caused by the abnormal external communication of the electronic controller can be avoided, then when the external communication of the electronic controller is normal, the fault code data in the ring buffer is broadcasted according to the storage sequence, and the normal broadcasting of the fault code is ensured.
[0043] Please refer to Figure 1 , a flowchart of a fault code broadcasting method provided by the embodiment of the application. The following will be described in detail with respect to the flowchart shown in the figure, and the fault code broadcasting method can specifically include the following steps: Figure 1
[0044] Step S102, monitoring the fault of the electronic controller, and obtaining the monitored fault code data;
[0045] The electronic controller can be an electronic controller (Electronic Control Unit, ECU) in a distributed electronic and electrical architecture. The ECU develops a diagnostic fault code (Diagnose Trouble Code, DTC) based on unified diagnostic services (Unified Diagnostic Services, UDS), and the ECU normally operates to monitor the function states in real time, and when an abnormal condition occurs, the corresponding fault code state is set, and the set fault code is used to indicate the fault state of the electronic controller.
[0046] Specifically, during the operation of the electronic controller, the function states of the electronic controller are monitored in real time, and when an abnormal function state of the electronic controller is monitored, the fault code corresponding to the function is set, and the fault code data corresponding to the electronic controller is obtained. The fault code data refers to the set fault code, which is used to indicate the fault state of the electronic controller.
[0047] Optionally, the monitored fault code data can be obtained, specifically, the fault state indication bit of each fault code is monitored in real time, the rising edge trigger monitoring logic is adopted, when the fault state indication bit of the fault code is set from 0 to 1, it is determined that there is a fault corresponding to the fault code.
[0048] Step S104, storing the fault code data in the ring buffer according to the generation time sequence;
[0049] Specifically, the monitored fault code data is stored in the ring buffer according to the fault code generation time sequence.
[0050] The circular buffer, also known as a circular buffer or ring queue, is used to store and manage data in a fixed-size buffer. It has a circular feature, that is, when the tail of the buffer reaches the maximum capacity, the next data will be stored from the head of the buffer, forming a cycle. The circular buffer can recycle space, store data in a cycle, fully utilize the space of the buffer, and avoid data overflow or waste. The circular buffer is provided in the electronic controller, and when the fault code data corresponding to the electronic controller is monitored, the fault code data is stored in the electronic controller.
[0051] Optionally, the fault code data capacity that the circular buffer can accommodate is greater than or equal to the total number of fault codes corresponding to the electronic controller.
[0052] It can be understood that for an electronic controller, the number of corresponding fault codes is usually fixed. The embodiment of the present application sets the fault code data capacity that the circular buffer can accommodate to be greater than or equal to the total number of fault codes corresponding to the electronic controller, which can avoid the problem of data overflow and loss caused by the circular buffer being unable to accommodate enough fault code data, and ensures that the monitored fault code data will not be lost.
[0053] It should be noted that the fault code data stored in the circular buffer can include broadcasted fault code data and to-be-broadcast fault code data, and the newly monitored fault code data is stored in the circular buffer as to-be-broadcast fault code data. When storing fault code data, the newly stored fault code data can overwrite the broadcasted fault code data, realizing the function of circular storage and saving storage space.
[0054] Step S106, when the external communication of the electronic controller is normal, broadcast the fault code data in the circular buffer according to the storage order.
[0055] Specifically, the electronic controller for broadcasting fault code data monitors whether the external communication of the electronic controller is abnormal in real time, does not broadcast fault code data when the external communication of the electronic controller is abnormal, and broadcasts the fault code data in the circular buffer according to the storage order when the external communication of the electronic controller is normal.
[0056] Further, in one or more embodiments of the present application, when the fault code data in the circular buffer is broadcasted, it is specifically referred to as broadcasting the to-be-broadcast fault code data in the circular buffer. When the fault code data in the circular buffer is broadcasted, the to-be-broadcast fault code data is determined by reading the fault code data stored in the circular buffer, and the to-be-broadcast fault code data is broadcasted.
[0057] It can be understood that, in the embodiment of the application, by monitoring the electronic controller for faults, obtaining the monitored fault code data, and storing the fault code data in the ring buffer according to the generation time sequence, whether the external communication of the electronic controller is normal or abnormal, the monitored fault code data can be stored, avoiding the problem of fault code loss caused by abnormal external communication of the electronic controller, and then when the external communication of the electronic controller is in a normal state, the fault code data in the ring buffer is broadcasted according to the storage sequence, ensuring normal broadcast of the fault code, so that other controllers or cloud servers can obtain the fault code data corresponding to the electronic controller in time.
[0058] Further, the fault code data in the ring buffer is broadcasted according to the storage sequence, which can specifically be that the fault code data in the ring buffer is broadcasted through the fault code broadcast message according to the storage sequence.
[0059] In one embodiment, the step S106 of broadcasting the fault code data in the ring buffer according to the storage sequence can specifically be that: based on a preset broadcast period, the fault code data in the ring buffer is broadcasted according to the storage sequence, wherein each fault code data is repeatedly broadcasted N times based on the preset broadcast period.
[0060] That is, after monitoring the electronic controller for faults, obtaining the monitored fault code data, and storing the fault code data in the ring buffer according to the generation time sequence, when the external communication of the electronic controller is in a normal state, the fault code data in the ring buffer is broadcasted according to the storage sequence based on a preset broadcast period, wherein each fault code data is repeatedly broadcasted N times based on the preset broadcast period.
[0061] The preset broadcast period refers to the period length of the fault code data broadcast, which can be set according to actual needs, and the one or more embodiments of the application do not make specific limitations. In one preferred embodiment, the preset broadcast period can be 50 milliseconds.
[0062] Further, in one embodiment, the fault code data in the ring buffer is broadcasted according to the storage sequence, wherein each fault code data is repeatedly broadcasted N times based on a preset broadcast period, which can specifically be that: based on a preset broadcast period, the fault code data in the ring buffer is repeatedly broadcasted N times according to the storage sequence one by one.
[0063] Specifically, the fault code data in the ring buffer is repeatedly broadcasted N times based on the preset broadcast period according to the storage order. For example, after the first fault code data is repeatedly broadcasted N times based on the preset broadcast period, the second fault code data is repeatedly broadcasted, and so on, until all the fault code data in the ring buffer is repeatedly broadcasted N times.
[0064] For example, when there is one fault code data to be broadcasted in the ring buffer, the fault code broadcast message is activated, and the fault code data is broadcasted according to the preset broadcast period (for example, 50 milliseconds). After N cycles, the fault code broadcast message returns to the inactive state and stops broadcasting.
[0065] Further, in one embodiment, the fault code data in the ring buffer is broadcasted according to the storage order, wherein each fault code data is repeatedly broadcasted N times based on the preset broadcast period. Specifically, the fault code data in the ring buffer is repeatedly broadcasted N times based on the preset broadcast period according to the storage order.
[0066] Specifically, the fault code data in the ring buffer is broadcasted according to the storage order and the preset broadcast period, and one cycle is regarded as one round of broadcast. In the embodiment of the present application, the fault code data in the ring buffer is repeatedly broadcasted N cycles, so that each fault code data in the ring buffer is repeatedly broadcasted N times.
[0067] For example, when there are multiple fault code data to be broadcasted in the ring buffer, the fault code broadcast message is activated, and the fault code data is broadcasted according to the preset broadcast period (for example, 50 milliseconds) and the storage order in the ring buffer. After one round of broadcast, the fault code broadcast message is repeatedly broadcasted N times, and after all the fault code data is broadcasted, the fault code broadcast message returns to the inactive state and stops broadcasting.
[0068] In one or more embodiments of the present application, each fault code data is repeatedly broadcasted N times. By repeatedly broadcasting, the reliability of the fault code data broadcast can be improved. In a preferred embodiment, N can be 3.
[0069] In a feasible embodiment, different broadcast modes are selected according to the number of fault code data to be broadcasted in the ring buffer to broadcast the fault code data to be broadcasted in the ring buffer. When the number of fault code data to be broadcasted in the ring buffer is one, the fault code data is repeatedly broadcasted N times based on the preset broadcast period. When the number of fault code data to be broadcasted in the ring buffer is multiple, the multiple fault code data is broadcasted in turn according to the storage order and based on the preset broadcast period. After one round of broadcast, the fault code data is repeatedly broadcasted N-1 times, so that each fault code data can be repeatedly broadcasted N times.
[0070] Further, in one embodiment, when the fault code data in the ring buffer is broadcast in the order of storage, for the fault code data that has been broadcast in the ring buffer, a broadcast interval duration is set for the fault code data after the broadcast; if the same fault code data as the fault code data that has been broadcast is monitored again within the broadcast interval duration after the broadcast, the fault code data is prohibited from being broadcast repeatedly; if the same fault code data as the fault code data that has been broadcast is monitored again after the broadcast interval duration, the fault code data is broadcast repeatedly.
[0071] That is, by setting the broadcast interval duration, for the uniform fault code data that frequently occurs, after being broadcast once, the fault code data can be broadcast for the second time only after the broadcast interval duration, so that the same fault code data is prevented from being broadcast frequently and system resources are wasted.
[0072] Preferably, the broadcast interval duration can be set to 60 seconds.
[0073] In one specific embodiment, for the fault code A stored in the ring buffer, the fault code A is first called from the ring buffer for broadcast according to the fault code generation order. If the fault code A is monitored again within 60 seconds, the fault code A is not broadcast, and only the fault code A that appears again after 60 seconds is broadcast.
[0074] Please refer to Figure 2 for a flowchart of a fault code broadcast method provided by the embodiment of the application. The following will be described in detail with respect to the flowchart shown in Figure 2 The fault code broadcast method can specifically include the following steps:
[0075] Step S202, the electronic controller is monitored for faults, and fault code data obtained by monitoring is acquired;
[0076] Step S204, if the same stored fault code data as the fault code data already exists in the ring buffer, it is determined whether a storage duration of the stored fault code data and the fault code data exceeds a preset interval duration;
[0077] Step S206, if the storage duration is less than or equal to the preset interval duration, the fault code data is discarded;
[0078] Step S208, if the storage duration is greater than the preset interval duration, the fault code data is stored in the ring buffer in the order of generation time;
[0079] Step S210, when the external communication of the electronic controller is in a normal state, the fault code data to be broadcast is broadcast repeatedly N times based on the order of storage and according to a preset broadcast period.
[0080] In the embodiment of the present application, by comparing the fault code data to be stored in the ring buffer with the existing fault code data in the ring buffer, if the same stored fault code data as the fault code data exists in the ring buffer, it is further judged whether the storage duration of the stored fault code data and the fault code data exceeds the preset interval duration, if the storage duration is less than or equal to the preset interval duration, the fault code data is discarded, avoiding frequent broadcasting of the same fault code data and wasting system resources, if the storage duration is greater than the preset interval duration, the fault code data is stored in the ring buffer according to the generation time sequence, so that when the external communication of the electronic controller is in the normal state, the fault code data in the ring buffer is broadcast according to the preset broadcast period based on the storage sequence.
[0081] In one embodiment, the fault code data in the ring buffer is broadcasted according to the storage sequence, which can be specifically: the fault code data in the ring buffer is broadcasted to the communication bus according to the storage sequence, so that other electronic controllers located on the communication bus can receive the fault code data.
[0082] Among them, the communication bus can be CAN bus, vehicle Ethernet and the like in the vehicle communication system.
[0083] It should be noted that the fault code broadcast method provided by one or more embodiments of the present application can be applied to a vehicle communication system based on a distributed electronic and electrical structure, the vehicle communication system includes a plurality of electronic controllers, and the electronic controllers are connected through a communication bus, when it is monitored that the electronic controller fails, the fault code data for representing the fault state of the electronic controller is broadcasted to the communication bus in the form of a fault message by using the fault code broadcast method provided by one or more embodiments of the present application, so that the electronic controller which needs to read the fault code data can receive the fault code data. Further, in one or more embodiments of the present application, when the electronic controller fails, as long as the external communication of the electronic controller is normal, the corresponding fault code data is broadcasted to the communication bus, so that other controllers in the vehicle communication system can obtain the corresponding fault code data of the electronic controller in time.
[0084] In one embodiment, the fault code data in the ring buffer is broadcasted according to the storage sequence, which can be specifically: the fault code data in the ring buffer is broadcasted to the communication bus according to the storage sequence, so that other electronic controllers located on the communication bus can receive the fault code data.
[0085] Further, the fault code broadcasting method provided by one or more embodiments of the present application can also be applied to a vehicle remote monitoring scenario. When a fault of an electronic controller is detected, the fault code data used to represent the fault state of the electronic controller is broadcast to a cloud server in the form of a fault message by using the fault code broadcasting method provided by one or more embodiments of the present application, so that the cloud server can obtain the corresponding fault code data in time and store the fault code data, thereby facilitating the viewing of vehicle fault code data when the vehicle is remotely monitored in the cloud.
[0086] Please refer to Figure 3 The system architecture diagram of a fault code broadcasting device provided by an embodiment of the present application is shown in FIG. 1. As shown in FIG. 1, the fault code broadcasting device 1 can be realized by software, hardware, or a combination of both to become all or part of a vehicle controller. According to some embodiments, the fault code broadcasting device 1 includes a fault code acquisition module 11, a fault code storage module 12, and a fault code broadcasting module 13, and specifically includes: Figure 3
[0087] The fault code acquisition module 11 is configured to monitor the electronic controller for faults and acquire fault code data obtained by the monitoring.
[0088] The fault code storage module 12 is configured to store the fault code data in a ring buffer according to the order of generation time.
[0089] The fault code broadcasting module 13 is configured to broadcast the fault code data in the ring buffer according to the order of storage when the external communication of the electronic controller is in a normal state.
[0090] Optionally, when the fault code broadcasting module 13 performs the broadcasting of the fault code data in the ring buffer according to the order of storage, the fault code broadcasting module 13 is specifically configured to:
[0091] broadcast the fault code data in the ring buffer according to the order of storage based on a preset broadcasting period, wherein each fault code data is repeatedly broadcast N times based on the preset broadcasting period.
[0092] Optionally, when the fault code broadcasting module 13 performs the broadcasting of the fault code data in the ring buffer according to the order of storage, wherein each fault code data is repeatedly broadcast N times based on the preset broadcasting period, the fault code broadcasting module 13 is specifically configured to:
[0093] broadcast the fault code data in the ring buffer according to the order of storage one by one based on the preset broadcasting period and repeatedly broadcast N times; or
[0094] cyclically broadcast the fault code data in the ring buffer according to the storage sequence based on the preset broadcast period, and repeat the broadcasting for N cycles.
[0095] Optionally, the fault code broadcasting module 13 is further configured to:
[0096] For the broadcasted fault code data, set a broadcast interval duration corresponding to the broadcasted fault code data.
[0097] If the same fault code data as the broadcasted fault code data is monitored again within the broadcast interval duration after the broadcasting, prohibit repeating the broadcasting of the fault code data.
[0098] If the same fault code data as the broadcasted fault code data is monitored again after the broadcast interval duration, repeat the broadcasting of the fault code data.
[0099] Optionally, when the fault code storage module 12 stores the fault code data according to the generation time sequence into the ring buffer, the fault code storage module 12 is specifically configured to:
[0100] If the same stored fault code data as the fault code data already exists in the ring buffer, determine whether a storage duration of the stored fault code data and the fault code data exceeds a preset interval duration.
[0101] If the storage duration is less than or equal to the preset interval duration, discard the fault code data.
[0102] If the storage duration is greater than the preset interval duration, store the fault code data into the ring buffer according to the generation time sequence.
[0103] Optionally, when the fault code broadcasting module 13 broadcasts the fault code data in the ring buffer according to the storage sequence, the fault code broadcasting module 13 is further configured to:
[0104] For the fault code data in the ring buffer, each fault code data is repeatedly broadcasted N times based on a preset broadcast period.
[0105] Optionally, when the fault code broadcasting module 13 broadcasts the fault code data in the ring buffer according to the storage sequence, the fault code broadcasting module 13 is specifically configured to:
[0106] Broadcast the fault code data in the ring buffer to the communication bus according to the storage sequence, so that other electronic controllers located on the communication bus receive the fault code data.
[0107] Optionally, when the fault code broadcasting module 13 broadcasts the fault code data in the ring buffer according to the storage sequence, the fault code broadcasting module 13 is specifically configured to:
[0108] The fault code data in the ring buffer is broadcast to a cloud server in a storage order.
[0109] The device embodiment corresponds to the method embodiment, and specific descriptions can be referred to the description of the method embodiment, which will not be repeated here. The device embodiment is based on the corresponding method embodiment and has the same technical effects as the corresponding method embodiment. Specific descriptions can be referred to the corresponding method embodiment.
[0110] The application further provides a storage medium, which can store a plurality of instructions suitable for being loaded and executed by a processor to perform the fault code broadcasting method of each of the above embodiments. Specific execution processes can be referred to the specific descriptions in each of the above embodiments, which will not be repeated here.
[0111] The application further provides a computer program product, which stores at least one instruction loaded and executed by the processor to perform the fault code broadcasting method of each of the above embodiments. Specific execution processes can be referred to the specific descriptions in each of the above embodiments, which will not be repeated here.
[0112] In one embodiment, the application further provides Figure 4 The structure schematic diagram of the vehicle controller is shown. As shown in the figure, Figure 4 At the hardware level, the vehicle controller includes a processor 21, an internal bus 22, a network interface 23, a memory 24, a non-volatile memory 25, and of course other hardware required by the business. The vehicle controller can be arranged in the vehicle, and the processor 21 reads the corresponding computer program from the non-volatile memory 25 into the memory and then runs to implement the fault code broadcasting method described above.
[0113] In one embodiment, the application further provides a vehicle, which can include the fault code broadcasting device or the vehicle controller described above to perform the fault code broadcasting method through the fault code broadcasting device or the vehicle controller to improve the braking performance of the vehicle.
[0114] Finally, each of the embodiments in the application is described in a progressive manner, and the same or similar parts between each of the embodiments can be referred to each other. Each embodiment mainly describes the difference from other embodiments. Especially for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the related parts can be referred to the part of the description of the method embodiment.
[0115] The above merely illustrates the embodiments of the present application but should not be taken as limitations. Various changes and modifications can be made by those skilled in the art. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application should be included in the scope of claims of the present application.
Claims
1. A fault code broadcasting method, applied to an electronic controller, comprising: The electronic controller is subjected to fault monitoring to obtain fault code data. The fault code data is stored in a circular buffer in chronological order of its generation time. When the external communication of the electronic controller is normal, the fault code data in the ring buffer is broadcast in the order of storage.
2. The method according to claim 1, wherein broadcasting the fault code data in the circular buffer in the order of storage comprises: Based on a preset broadcast period, the fault code data in the circular buffer are broadcast in the order of their storage, wherein each fault code data is broadcast N times based on the preset broadcast period.
3. The method according to claim 2, wherein the fault code data in the circular buffer is broadcast in the order of storage, wherein, Each of the aforementioned fault code data is broadcast N times repeatedly based on the preset broadcast period, including: Based on the preset broadcast period, the fault code data in the circular buffer are broadcast N times sequentially according to their storage order; or Based on the preset broadcast cycle, the fault code data in the circular buffer is broadcast cyclically in the order of storage, and the broadcast is repeated N times.
4. The method according to claim 2, further comprising: For broadcast fault code data, set the corresponding broadcast interval duration; If, within the broadcast interval after the broadcast, the same fault code data as the already broadcast fault code data is detected again, the repeated broadcast of the fault code data is prohibited. If the same fault code data as the previously broadcast fault code data is detected again after the broadcast interval, the fault code data will be broadcast again.
5. The method according to claim 1, wherein storing the fault code data into a circular buffer in chronological order of generation includes: If there is already stored fault code data that is the same as the fault code data in the circular buffer, determine whether the storage duration corresponding to the stored fault code data exceeds the preset interval duration. If the storage duration is less than or equal to the preset interval duration, the fault code data is discarded. If the storage duration is longer than the preset interval duration, the fault code data is stored in the circular buffer in chronological order of its generation time.
6. The method according to claim 1, wherein broadcasting the fault code data in the circular buffer in the order of storage comprises: The fault code data in the circular buffer is broadcast to the communication bus in the order of storage so that other electronic controllers located on the communication bus can receive the fault code data.
7. The method according to claim 1, wherein broadcasting the fault code data in the circular buffer in the order of storage comprises: The fault code data in the circular buffer are broadcast to the cloud server in the order they were stored.
8. A fault code broadcasting device, comprising: The fault code acquisition module is used to monitor faults in the electronic controller and acquire the fault code data obtained from the monitoring. The fault code storage module is used to store the fault code data into a circular buffer in chronological order of their generation time. The fault code broadcasting module is used to broadcast the fault code data in the ring buffer in the order of storage when the external communication of the electronic controller is normal.
9. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.
10. A vehicle controller, comprising: A processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to execute the steps of the method as claimed in any one of claims 1 to 7.
11. A vehicle comprising a fault code broadcasting device as claimed in claim 8 or a vehicle controller as claimed in claim 10.