Method, device, processor and computer readable storage medium thereof for coordinating left and right light controllers using CAN messages
By coordinating the operation of the left and right turn signal controllers through CAN messages and utilizing CAN message redundancy check and animation frame number synchronization mechanisms, the problem of animation asynchrony caused by differences in start-up time and received commands between the left and right turn signal controllers is solved. This improves the functional safety level and reliability of the turn signal system, and achieves smooth visual transition and optimized bus load rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGFENG ELECTRONICS TECH
- Filing Date
- 2026-05-22
- Publication Date
- 2026-07-17
Smart Images

Figure CN122421152A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of automotive electronic control technology, and more particularly to the field of headlight controller coordination, specifically to a method, apparatus, processor, and computer-readable storage medium for coordinating the operation of left and right light controllers using CAN messages. Background Technology
[0002] Headlight controllers are typically divided into left and right units. To ensure supply flexibility, headlight fixtures are differentiated by their "shape and structure," but the controllers are supplied uniformly. The controller software is required to be completely consistent, identifying whether the current controller is left or right using a single pin. However, functional safety features are now required, necessitating redundant design to prevent identification from relying on a single pin. This change cannot be implemented on already mass-produced headlight fixtures, so alternative methods are needed.
[0003] Furthermore, modern car lights are not only functional components but also need to convey a sense of technology through cool animations. For this purpose, a continuous light strip with animated sequences is designed. However, this continuous light strip is controlled by two separate controllers, each controlling half of the LED signals, and they work together in practice. Coordinating this becomes difficult because the two controllers have different startup times, and the time they receive commands can differ by a task polling time. Worst of all, differences in the crystal oscillators of the two controllers cause the time difference between the animations of the left and right controllers to increase significantly after one minute of playback. A delay of more than two frames becomes noticeable to the user, ultimately resulting in a poor user experience. Summary of the Invention
[0004] The purpose of this invention is to overcome the shortcomings of the prior art and provide a method, apparatus, processor and computer-readable storage medium for coordinating the operation of left and right light controllers using CAN messages, which is highly reliable, easy to operate and widely applicable.
[0005] To achieve the above objectives, the present invention provides a method, apparatus, processor, and computer-readable storage medium for coordinating the operation of left and right light controllers using CAN messages, as follows: The main feature of this method for coordinating the operation of the left and right light controllers using CAN messages is that the method includes the following steps: (1) Within the first time window after the left controller and the right light controller are powered on, detect the local pin level and listen to the bus message, and determine whether it is the left light controller or the right light controller by the level status. (2) Within the first time window, the left controller or the right light controller listens to the CAN bus to determine whether a status message from a controller other than its own is received. If so, it continues to work normally; otherwise, it identifies an anomaly and triggers the identification error flag.
[0006] Preferably, step (2) further includes the following steps: The left controller or right light controller sends its own status message within a preset second time window, which is shorter than the first time window.
[0007] Preferably, the first time window is set to 1 second.
[0008] Preferably, the second time window is set to 500 milliseconds.
[0009] Preferably, the method further includes an animation synchronization control step, specifically comprising the following processing steps: Upon receiving the animation start command, the left and right light controllers begin periodically sending synchronization CAN messages, which contain the local animation frame number. Each controller receives and compares the animation frame number sent by the other controller with the local animation frame number in real time; When it is detected that the local animation frame number is behind the animation frame number of the other controller, and the frame number difference exceeds a preset threshold, the local controller is triggered to catch up with the playback progress in order to synchronize with the other controller. After the animation finishes playing or a stop playback command is received, the animation frame number is cleared and the animation playback ends.
[0010] Preferably, the transmission period of the synchronous CAN message is set to 10 milliseconds, which is faster than the playback frame rate of the animation (20 milliseconds), and the preset threshold value is set to 2 frames.
[0011] Preferably, the synchronization CAN message is an independent synchronization frame, and the frame format of the synchronization frame includes a one-byte frame header, a two-byte animation frame number, and a one-byte CRC check value.
[0012] The main feature of this device, which uses CAN messages to coordinate the operation of the left and right light controllers, is that the device includes: A processor is configured to execute computer-executable instructions; The memory stores one or more computer-executable instructions, which, when executed by the processor, implement the steps of the method described above for coordinating the operation of the left and right light controllers using CAN messages.
[0013] The processor that uses CAN messages to coordinate the operation of the left and right light controllers is characterized in that the processor is configured to execute computer-executable instructions, which, when executed by the processor, implement the various steps of the method described above for coordinating the operation of the left and right light controllers using CAN messages.
[0014] The computer-readable storage medium is characterized in that it stores a computer program that can be executed by a processor to implement the steps of the method described above for coordinating the operation of the left and right light controllers using CAN messages.
[0015] This invention employs a method, apparatus, processor, and computer-readable storage medium for coordinating the operation of left and right turn signal controllers using CAN messages. Through CAN message redundancy verification and animation frame number synchronization mechanisms, it effectively solves the problems of misidentification of left and right turn signal controller identities and playback asynchrony, avoiding single-point failures caused by open circuits in the wiring harness or unreliable connections, and significantly improving the functional safety level of the turn signal system. During animation playback, synchronization messages with frame numbers and a transmission rate faster than the animation rate are used, allowing only the slower-playing component to catch up with the faster component at a controllable threshold. This overcomes the shortcomings of traditional time-base synchronization, which easily leads to software contention and reduces reliability. It also reduces unnecessary frequent fine-tuning, resulting in a smooth visual transition. Furthermore, it remains silent during normal operation, accommodating low bus load requirements. Attached Figure Description
[0016] Figure 1 This is a schematic diagram of the structure of the left and right light controllers in the method of coordinating the operation of left and right light controllers using CAN messages according to the present invention.
[0017] Figure 2 This is a flowchart of the method for coordinating the operation of the left and right light controllers using CAN messages according to the present invention.
[0018] Figure 3 This is a flowchart illustrating the animated synchronization control method of the present invention, which utilizes CAN messages to coordinate the operation of the left and right light controllers. Detailed Implementation
[0019] To more clearly describe the technical content of the present invention, the following description is provided in conjunction with specific embodiments.
[0020] The method for coordinating the operation of left and right light controllers using CAN messages according to the present invention includes the following steps: (1) Within the first time window after the left controller and the right light controller are powered on, detect the local pin level and listen to the bus message, and determine whether it is the left light controller or the right light controller by the level status. (2) Within the first time window, the left controller or the right light controller listens to the CAN bus to determine whether a status message from a controller other than its own is received. If so, it continues to work normally; otherwise, it identifies an anomaly and triggers the identification error flag.
[0021] In a preferred embodiment of the present invention, step (2) further includes the following steps: The left controller or right light controller sends its own status message within a preset second time window, which is shorter than the first time window.
[0022] In a preferred embodiment of the present invention, the first time window is set to 1 second.
[0023] In a preferred embodiment of the present invention, the second time window is set to 500 milliseconds.
[0024] In a preferred embodiment of the present invention, the method further includes an animation synchronization control step, specifically comprising the following processing steps: Upon receiving the animation start command, the left and right light controllers begin periodically sending synchronization CAN messages, which contain the local animation frame number. Each controller receives and compares the animation frame number sent by the other controller with the local animation frame number in real time; When it is detected that the local animation frame number is behind the animation frame number of the other controller, and the frame number difference exceeds a preset threshold, the local controller is triggered to catch up with the playback progress in order to synchronize with the other controller. After the animation finishes playing or a stop playback command is received, the animation frame number is cleared and the animation playback ends.
[0025] In a preferred embodiment of the present invention, the transmission period of the synchronous CAN message is set to 10 milliseconds, which is faster than the playback frame rate of the animation of 20 milliseconds, and the preset threshold value is set to 2 frames.
[0026] In a preferred embodiment of the present invention, the synchronous CAN message is an independent synchronous frame, and the frame format of the synchronous frame includes a one-byte frame header, a two-byte animation frame number, and a one-byte CRC check value.
[0027] The present invention relates to a device for coordinating the operation of left and right light controllers using CAN messages, wherein the device includes: A processor is configured to execute computer-executable instructions; The memory stores one or more computer-executable instructions, which, when executed by the processor, implement the steps of the method described above for coordinating the operation of the left and right light controllers using CAN messages.
[0028] The processor of the present invention, which coordinates the operation of the left and right light controllers using CAN messages, is configured to execute computer-executable instructions. When the computer-executable instructions are executed by the processor, the various steps of the method for coordinating the operation of the left and right light controllers using CAN messages are implemented.
[0029] The computer-readable storage medium of the present invention stores a computer program thereon, which can be executed by a processor to implement the various steps of the method described above for coordinating the operation of the left and right light controllers using CAN messages.
[0030] The left light controller identifies itself as the left light controller upon detecting a ground fault, while the right light controller identifies itself as the right light controller upon detecting a power connection. From a functional safety perspective, this could occur if the wiring harness is unreliable or open-circuited, causing both the left and right light controllers to simultaneously detect either a low or high voltage level. Therefore, additional redundancy checks are necessary. Figure 2 This is a flowchart of the software testing process.
[0031] This method involves detecting local pins and listening to bus messages within one second of power-on (a fixed short period rather than long-term monitoring) to determine whether the orientation of the local left and right light controllers is correct.
[0032] A method for synchronizing the left and right light controllers is achieved by using a special synchronous CAN frame transmission and reception method with frame numbers.
[0033] The IDs of the status messages sent by the left light controller and the controller with the right light are different. The time accumulator is set to check for messages from controllers other than the one on this side within one second of power-on. If a message is detected, it indicates that the two controllers on the vehicle are recognizing different directions, which is trustworthy. At this point, the identification of the left and right light controllers is complete.
[0034] After startup, the synchronization messages for the two left and right light controllers are not sent until the animation start command is received, at which point a synchronization frame is sent. Synchronization frame format: A CAN message synchronization frame is sent only after the animation starts, and the message contains the frame number of the local animation display. Only controllers playing at a slower pace need to catch up with controllers playing at a faster pace; controllers playing at a faster pace are not allowed to wait for controllers playing at a slower pace.
[0035] In a specific embodiment of the present invention, the following steps are included: 1. Design a reasonable power-on detection time. The headlight controller status message cycle is once every 20ms. Furthermore, the controller typically requires 100ms to run its software after power-on. Since the detection pins require filtering technology, setting a 1-second threshold is reasonable. If the detection is correct within this time, no further verification is needed for the current power-on cycle.
[0036] 2. The local controller cannot wait for the other controller to send a message first to prevent errors. This would cause a deadlock between the two controllers. Therefore, the controller must send a message within 500ms.
[0037] 3. The software can exit the judgment logic after detecting a message sent by another position controller in any frame, to avoid triggering the identification error flag after a bus abnormality.
[0038] 4. Some controller suppliers will check whether it is the left or right light controller on the first power-on. However, if the vehicle wiring harness is abnormally loose or during pre-installation testing at the factory, the position may be locked, making unlocking difficult. Therefore, this solution executes this check logic after each power-on start-up.
[0039] 5. Synchronization CAN messages are only sent when animated LED signals are playing; they are not sent at other times. This reduces the CAN bus load.
[0040] 6. The synchronization CAN message cycle must be 10ms per frame, faster than the 20ms per frame animation rate. This avoids software misjudgments caused by CAN delay.
[0041] 7. A threshold of 2-frame light signal difference must be set; otherwise, it will easily trigger fine-tuning of the animation playback. A difference of one frame is imperceptible to the user's eye, but frequent fine-tuning is more likely to be noticed.
[0042] 8. If the OEM does not allow additional messages, light status messages can be used. CANFD has already defined 12 bytes. Two more bytes can be added as the frame number. The format is as follows: 9. Note that the frame number needs to be reset to zero when the animation finishes playing. This prevents the frame number from remaining on the last frame after the first normal animation playback, and then fast-forwarding directly to the last frame of the previous playback when the animation is played again. The process is as follows: The main technical points of this invention include: Firstly, the software identifies the left and right turn signal controllers based on only one IO pin. If this pin malfunctions, it will cause the turn signals to malfunction, and turn signals have functional safety requirements necessitating redundancy. Redundancy is achieved by adding CAN message reception. Furthermore, the time window for recognizing CAN messages (during power-on) and the software not waiting for the other controller to send a message first constitute the implementation method of this invention's innovation. This innovation is not described in any prior art.
[0043] The 40ms visual persistence phenomenon can solve the synchronization of light on / off and water flow. The pain point in synchronizing these two aspects lies in the synchronization when playing welcome light messages. Therefore, the solution of this invention is to use an animation frame number synchronization method to achieve the function.
[0044] Traditional time base synchronization has a drawback: the constant updating of the local time base increases the likelihood of software contention, ultimately reducing reliability. Animation frame number synchronization solves this problem; correction is only needed when there is a difference of two frames.
[0045] In the prior art, animations are sent down from a host computer, while the animations in the technical solution of this invention are stored in the local FLASH memory before leaving the factory.
[0046] For the specific implementation scheme of this embodiment, please refer to the relevant descriptions in the above embodiments, which will not be repeated here.
[0047] It is understood that the same or similar parts in the above embodiments can be referred to each other, and the contents not described in detail in some embodiments can be referred to the same or similar contents in other embodiments.
[0048] It should be noted that in the description of this invention, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this invention, unless otherwise stated, "a plurality of" means at least two.
[0049] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0050] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution device. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0051] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The corresponding program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.
[0052] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0053] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0054] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0055] This invention employs a method, apparatus, processor, and computer-readable storage medium for coordinating the operation of left and right turn signal controllers using CAN messages. Through CAN message redundancy verification and animation frame number synchronization mechanisms, it effectively solves the problems of misidentification of left and right turn signal controller identities and playback asynchrony, avoiding single-point failures caused by open circuits in the wiring harness or unreliable connections, and significantly improving the functional safety level of the turn signal system. During animation playback, synchronization messages with frame numbers and a transmission rate faster than the animation rate are used, allowing only the slower-playing component to catch up with the faster component at a controllable threshold. This overcomes the shortcomings of traditional time-base synchronization, which easily leads to software contention and reduces reliability. It also reduces unnecessary frequent fine-tuning, resulting in a smooth visual transition. Furthermore, it remains silent during normal operation, accommodating low bus load requirements.
[0056] In this specification, the invention has been described with reference to specific embodiments thereof. However, it will be apparent that various modifications and variations can be made without departing from the spirit and scope of the invention. Therefore, the specification and drawings should be considered illustrative rather than restrictive.
Claims
1. A method for coordinating the operation of left and right light controllers using CAN messages, characterized in that, The method includes the following steps: (1) Within the first time window after the left controller and the right light controller are powered on, detect the local pin level and listen to the bus message, and determine whether it is the left light controller or the right light controller by the level status. (2) Within the first time window, the left controller or the right light controller listens to the CAN bus to determine whether a status message from a controller other than its own is received. If so, it continues to work normally; otherwise, it identifies an anomaly and triggers the identification error flag.
2. The method for coordinating the operation of left and right light controllers using CAN messages according to claim 1, characterized in that, Step (2) further includes the following steps: The left controller or right light controller sends its own status message within a preset second time window, which is shorter than the first time window.
3. The method for coordinating the operation of left and right light controllers using CAN messages according to claim 1, characterized in that, The first time window is set to 1 second.
4. The method for coordinating the operation of left and right light controllers using CAN messages according to claim 2, characterized in that, The second time window is set to 500 milliseconds.
5. The method for coordinating the operation of left and right light controllers using CAN messages according to claim 1, characterized in that, The method further includes an animation synchronization control step, specifically comprising the following processing steps: Upon receiving the animation start command, the left and right light controllers begin periodically sending synchronization CAN messages, which contain the local animation frame number. Each controller receives and compares the animation frame number sent by the other controller with the local animation frame number in real time; When it is detected that the local animation frame number is behind the animation frame number of the other controller, and the frame number difference exceeds a preset threshold, the local controller is triggered to catch up with the playback progress in order to synchronize with the other controller. After the animation finishes playing or a stop playback command is received, the animation frame number is cleared and the animation playback ends.
6. The method for coordinating the operation of left and right light controllers using CAN messages according to claim 5, characterized in that, The transmission period of the synchronous CAN message is set to 10 milliseconds, which is faster than the playback frame rate of the animation (20 milliseconds). The preset threshold value is set to 2 frames.
7. The method for coordinating the operation of left and right light controllers using CAN messages according to claim 5, characterized in that, The aforementioned synchronous CAN message is an independent synchronous frame. The frame format of the synchronous frame includes a one-byte frame header, a two-byte animation frame number, and a one-byte CRC check value.
8. A device for coordinating the operation of left and right light controllers using CAN messages, characterized in that, The device includes: A processor is configured to execute computer-executable instructions; The memory stores one or more computer-executable instructions, which, when executed by the processor, implement the steps of the method for coordinating the operation of the left and right light controllers using CAN messages as described in any one of claims 1 to 7.
9. A processor that coordinates the operation of left and right light controllers using CAN messages, characterized in that, The processor is configured to execute computer-executable instructions, which, when executed by the processor, implement the steps of the method for coordinating the operation of the left and right light controllers using CAN messages as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It stores a computer program that can be executed by a processor to implement the steps of the method for coordinating the operation of the left and right light controllers using CAN messages as described in any one of claims 1 to 7.