High-pixel LED lamp scene upgrading system and method based on UDS protocol
By designing a high-pixel LED lamp scene upgrade system based on the UDS protocol, using image processing modules and off-chip storage devices, the problem of cumbersome scenes of updating high-pixel LED lamps in the prior art is solved, and a rapid and simplified scene data upgrade is achieved.
Patent Information
- Application Number
- CN202411436641.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-02-07
AI Technical Summary
The prior art requires manual frame division and data transmission when updating high-pixel LED lamp scenes, which is very laborious and cumbersome. Especially when the number of high pixels of LEDs increases, the work of updating the scene becomes more complicated.
Design a high-pixel LED lamp scene upgrade system based on UDS protocol, convert the display renderings into hex files through the image processing module, and transfer data to the controller using UDS and TP communication protocols, and add off-chip storage to the controller. Devices and drivers, modify the standard BootLoader upgrade process to support scenario data upgrades.
It realizes rapid update of scene data of high-pixel LED lamps, reduces the workload of manual frame division and data transmission, simplifies workflow, and reduces the workload of scene upgrades.
Smart Images

Figure CN119396432A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a high-pixel LED lamp scene upgrade system and method based on the UDS protocol, belonging to the technical field of high-pixel LED lamp upgrade. Background Art
[0002] At present, the standard UDS BootLoader architecture consists of the BootLoader running on the MCU and the host machine, such as Figure 1 As shown in the figure, BootLoader is responsible for downloading and managing the App data content (App Image) and App upgrade flag (App Flag) on the MCU. BootLoader communicates with the host computer through UDS and TP protocols, is responsible for downloading the App image, and marks the existence of the App by managing and querying the App Flag data stored in the on-chip Flash.
[0003] The UDS module controls the Flash Manager module according to the received UDS message, such as Figure 2 As shown in the figure, in the download process, the Flash Manager module performs operations such as erasing, writing data, and calculating CRC on the Flash or RAM according to the UDS command. When the entire UDS download process is completed, the App Flag is written to the Flash, so that after restarting, the Bootloader module can identify whether the App image has been downloaded and whether it needs to jump to the App to run. The MCU controller of the low-cost solution stores the high-pixel lighting scene data in the storage system of the controller. When updating the scene data, the software code needs to be updated; or a private communication protocol is defined for data transmission through the vehicle body communication network.
[0004] However, the existing standard BootLoader is only used to upgrade the controller App. High-pixel LED lamps use low-cost MCU controllers. When updating scenes, the scene data sequence needs to be manually divided into frames and then sent manually through communication tools. As the number of high-pixel LED lamp beads increases, the workload becomes increasingly heavy, and updating scenes becomes cumbersome.
[0005] For example, when the number of LED high pixels reaches 4000, a dynamic image composed of 10 static images needs to be updated, which requires the transmission of 4000*10=40000Bytes. The maximum data length of a single frame message of CAN communication data commonly used in the vehicle body is 64 Bytes, so updating a scene requires manual editing of 40000 / 64≈62 frames of data; if 10 such scenes need to be updated, 620 frames of data messages need to be manually edited and sent, which is a large and cumbersome workload. Summary of the invention
[0006] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a high-pixel LED lamp scene upgrade system and method based on the UDS protocol. By designing an image processing tool, an off-chip storage device is added to the controller end, and the standard BootLoader upgrade process is modified to make it compatible with the scene data upgrade function and quickly update the effect diagram data.
[0007] In order to solve the above technical problems, the technical solution of the present invention is: On one hand, the present invention provides a high-pixel LED lamp scene upgrade system based on the UDS protocol, which includes an image processing module, a UDS upgrade module and a controller; The image processing module is used to convert the display effect image into scene data for use by the controller, and generate the scene data into a hex file; The UDS upgrade module is used to transmit the hex file generated by the image processing module to the controller end through the UDS and TP communication protocols; The controller is used to store scene summary information and scene data content, perform App upgrades and scene data upgrades, and perform display control on high-pixel LED lamps.
[0008] Further, the controller includes an MCU module and an off-chip storage device, and the MCU module is provided with an App program and a Bootloader program; The App program and the Bootloader program are both integrated with an off-chip storage device driver, the App program interacts with the off-chip storage device through the off-chip storage device driver, and the Bootloader program interacts with the off-chip storage device through the off-chip storage device driver; The off-chip storage device is used to store scene data.
[0009] Furthermore, the scene data includes scene overview information and scene data content. The scene overview information includes the number of scenes, the number of each scene, the starting address, the number of frames, and the ending address. The scene data content is the RGB value of a static image converted from the dynamic image in the display effect diagram.
[0010] Another aspect of the present invention provides an upgrade method for a high-pixel LED lamp scene upgrade system based on the UDS protocol, which comprises the following steps: Step S1, the image processing module converts the display effect image into scene data for use by the controller, and generates the scene data into a hex file; Step S2, transmitting the hex file generated by the image processing module to the controller through UDS and TP communication protocols; Step S3: After receiving the upgrade request, the controller App program determines whether the current upgrade request is an App program upgrade request or a scene data upgrade request, then powers off and then restarts, and enters the Bootloader program to perform App program upgrade or scene data upgrade according to the type of upgrade request.
[0011] Furthermore, in step S1, the display effect diagram is converted into scene data that can be directly used by the controller, and a hex file is generated, which specifically includes the following steps: Step S11, using the ImageSequence module in the Python language Pillow library, traverse each frame of the animated image in the display effect diagram, and save each frame of the image as a static image; Step S12: reading a static image frame, and dividing the static image into a plurality of display areas according to an input resolution; Step S13, calling the PIL library function, looping to obtain the RGB value of each display area, taking the average of R, G, and B in the area as the RGB value of the area; Step S14, writing the RGB value of each display area into the file in sequence according to the physical space sorting; Step S15, repeat steps S12 to S14, process all static images frame by frame, and output RGB values in a hex file after processing all frames of static images.
[0012] Further, in step S3, after receiving the upgrade request, the controller App program determines whether the current upgrade request is an App program upgrade request or a scene data upgrade request, and then powers on and restarts after powering off, and enters the Bootloader program to perform App program upgrade or scene data upgrade according to the type of upgrade request, specifically including the following steps: Step S31, the controller App program receives an upgrade request; Step S32: judging whether the current upgrade request is an App program upgrade request or a scene data upgrade request according to the request flag bit; if it is an App program upgrade request, proceeding to step S33; if it is a scene data upgrade request, proceeding to step S34; Step S33, the host computer sends a request to enter the Bootloader program to the controller through the BootLoader. After the App program receives the instruction to enter the Bootloader program, it sets the flag bit of the Bootloader program request at the specified address in the RAM to request to update the App program, and triggers the controller to restart and enter the Boot mode through the Watchdog, and enters the BootLoader upgrade process; Step S34, the host computer sends a scene data upgrade request to the controller, and then the host computer sends a request to enter the Bootloader program. After the App program receives the instruction to enter the Bootloader program, it sets the flag bit of the Bootloader program request to request to upgrade the scene data at the specified address in the RAM, and triggers the controller to restart and enter the Boot mode through Watchdog, entering the BootLoader upgrade process; Step S35, after the upgrade is completed, jump back to the normal App program, read the scene data information in the off-chip memory, find the corresponding storage start and end positions according to the scene number that needs to be displayed, read out the scene data and control the display of the high-pixel LED lamp.
[0013] The above technical solution is adopted. The present invention adopts a scene upgrade system and upgrade method based on the UDS protocol, directly converts the display effect animation output by the modeling scene engineer into a hex file, and updates it to the storage space of the controller in the form of a file through the UDS protocol, without the need for manual frame setting and sending, reducing the workload of updating the scene of LED high-pixel lamps and simplifying the workflow. The present invention upgrades the scene data with simple operations, adds an off-chip storage device on the controller side, develops driver software, and modifies the standard BootLoader upgrade process to make it compatible with the scene data upgrade function, which simplifies the working method of scene upgrade and reduces the workload of scene upgrade. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] Figure 1 It is a standard UDS BootLoader architecture diagram of the prior art of the present invention; Figure 2 It is the standard APP upgrade process of the prior art of the present invention; Figure 3 This is a principle block diagram of the high-pixel LED lamp scene upgrade system based on the UDS protocol of the present invention; Figure 4 is a principle block diagram of the controller of the present invention; Figure 5 A schematic diagram of the space division of the off-chip storage device of the present invention; Figure 6 It is a schematic diagram of the data information storage format of the present invention; Figure 7 It is a flow chart of an upgrade method of a high-pixel LED lamp scene upgrade system based on the UDS protocol of the present invention; Figure 8 It is a processing flow chart of the image processing module of the present invention. DETAILED DESCRIPTION
[0015] In order to make the contents of the present invention more clearly understood, the present invention is further described in detail below based on specific embodiments in conjunction with the accompanying drawings.
[0016] Embodiment 1 like Figure 3 As shown, this embodiment provides a high-pixel LED lamp scene upgrade system based on the UDS protocol, which includes an image processing module, a UDS upgrade module and a controller.
[0017] The image processing module is used to convert the display effect image into scene data for use by the controller and generate the scene data into a hex file.
[0018] The UDS upgrade module is used to transmit the hex file generated by the image processing module to the controller through the UDS and TP communication protocols.
[0019] The controller is used to store scene summary information and scene data content, perform App upgrades and scene data upgrades, and perform display control on high-pixel LED lamps.
[0020] like Figure 4 As shown, the controller of this embodiment includes an MCU module and an off-chip storage device, wherein the MCU module is provided with an App program and a Bootloader program.
[0021] Both the App program and the Bootloader program are integrated with an off-chip storage device driver. The App program interacts with the off-chip storage device through the off-chip storage device driver, and the Bootloader program interacts with the off-chip storage device through the off-chip storage device driver.
[0022] The off-chip storage device is used to store scene data. The scene data includes scene summary information and scene data content. The scene summary information includes the number of scenes, the number of each scene, the start address, the number of frames, and the end address. The scene data content is the RGB value of the static image converted from the dynamic image in the display effect diagram. Figure 5 As shown, the off-chip storage device (using a 256M storage device as an example, but not limited to storage devices of this capacity) is divided into two areas, one for storing scene summary information and the other for storing scene data specific content. Figure 6 As shown, when the scene data is updated, the scene summary information and the scene data specific content files are transmitted to the controller in sequence according to the set address and in accordance with the update process.
[0023] This system adopts the UDS BootLoader architecture compatible with data upgrades. The controller adds an off-chip storage device based on the standard BootLoader architecture, and adds an off-chip storage device driver in the BootLoader program and the App program respectively. The driver is called in the BootLoader program to store the scene data in the off-chip storage device; the driver is called in the App program to read the scene data in the off-chip storage device to control the LED high-pixel lighting effect.
[0024] Embodiment 2 like Figure 7 As shown, this embodiment provides an upgrade method of a high-pixel LED lamp scene upgrade system based on the UDS protocol as in Embodiment 1, which comprises the following steps: Step S1: The image processing module converts the display effect image into scene data for the controller, and generates the scene data into a hex file. A tool is designed in Python language to read the dynamic effect image. After a series of algorithm processing, the output is a data file representing the brightness of the lamp beads that can be used by the controller, such as Figure 8 As shown, the specific steps include: Step S11, using the ImageSequence module in the Python language Pillow library, traverse each frame of the animated image in the display effect diagram, and save each frame of the image as a static image; Step S12: reading a static image frame, and dividing the static image into a plurality of display areas according to an input resolution; Step S13, calling the PIL library function, looping to obtain the RGB value of each display area, taking the average of R, G, and B in the area as the RGB value of the area; Step S14, writing the RGB value of each display area into the file in sequence according to the physical space sorting; Step S15, repeat steps S12 to S14, process all static images frame by frame, and output RGB values in a hex file after processing all frames of static images.
[0025] Step S2, the hex file generated by the image processing module is transmitted to the controller through the UDS and TP communication protocols. Compared with the standard APP UDS upgrade process and the scene data upgrade process, in this embodiment, the host computer does not need to send the driver of the on-chip storage device, but uses the off-chip storage device driver solidified in the Bootloader program. When the host computer executes the scene data upgrade process, the host computer first performs communication control, mode switching, and security verification before transmitting data.
[0026] Step S3: After receiving the upgrade request, the controller App program determines whether the current upgrade request is an App program upgrade request or a scene data upgrade request, then powers off and then restarts, and enters the Bootloader program to perform App program upgrade or scene data upgrade according to the type of upgrade request. Specifically, the steps include: Step S31, the controller App program receives an upgrade request; Step S32: judging whether the current upgrade request is an App program upgrade request or a scene data upgrade request according to the request flag bit; if it is an App program upgrade request, proceeding to step S33; if it is a scene data upgrade request, proceeding to step S34; Step S33, the host computer sends a request to enter the Bootloader program to the controller through the BootLoader. After the App program receives the instruction to enter the Bootloader program, it sets the flag bit of the Bootloader program request at the specified address in the RAM to request to update the App program, and triggers the controller to restart and enter the Boot mode through the Watchdog, and enters the BootLoader upgrade process; Step S34, the host computer sends a scene data upgrade request to the controller, and then the host computer sends a request to enter the Bootloader program. After the App program receives the instruction to enter the Bootloader program, it sets the flag bit of the Bootloader program request to request to upgrade the scene data at the specified address in the RAM, and triggers the controller to restart and enter the Boot mode through Watchdog, entering the BootLoader upgrade process; Step S35, after the upgrade is completed, jump back to the normal App program, read the scene data information in the off-chip memory, find the corresponding storage start and end positions according to the scene number that needs to be displayed, read out the scene data and control the display of the high-pixel LED lamp.
[0027] There are two programs in the controller of this embodiment. One is a program for upgrading and updating the App, which is called the Bootloader program in this embodiment and is used to manage and determine whether the App program is available and whether there is a new App program that needs to be updated. The other is the App program, which is an application program that realizes the basic function control of the lamp, such as turning on and off the light, adjusting the brightness, etc.
[0028] Whether you are upgrading the App or upgrading the scene data, it will determine whether to request to enter the App upgrade process. In the App upgrade process, the flag will be used to determine whether to upgrade the App or the scene data.
[0029] During normal use, the device runs the App program. To upgrade it, the host computer sends instructions to the App program to set the upgrade flag and upgrade request.
[0030] After powering on and restarting after a power outage, the upgrade request is read and the Bootloader program is entered to update the App program.
[0031] The specific embodiments described above further illustrate the technical problems, technical solutions and beneficial effects solved by the present invention. It should be understood that the above are only specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A high-pixel LED lighting scene upgrade system based on the UDS protocol, characterized by: It includes image processing module, UDS upgrade module and controller; The image processing module is used to convert the display effect image into scene data for use by the controller, and generate the scene data into a hex file; The UDS upgrade module is used to transmit the hex file generated by the image processing module to the controller end through the UDS and TP communication protocols; The controller is used to store scene summary information and scene data content, perform App upgrades and scene data upgrades, and perform display control on high-pixel LED lamps.
2. The high-pixel LED lamp scene upgrade system based on the UDS protocol according to claim 1 is characterized in that: The controller includes an MCU module and an off-chip storage device, and the MCU module is provided with an App program and a Bootloader program; The App program and the Bootloader program are both integrated with an off-chip storage device driver, the App program interacts with the off-chip storage device through the off-chip storage device driver, and the Bootloader program interacts with the off-chip storage device through the off-chip storage device driver; The off-chip storage device is used to store scene data.
3. The high-pixel LED lamp scene upgrade system based on the UDS protocol according to claim 2 is characterized in that: The scene data includes scene summary information and scene data content. The scene summary information includes the number of scenes, the number of each scene, the starting address, the number of frames, and the ending address. The scene data content is the RGB value of a static image converted from the dynamic image in the display effect diagram.
4. An upgrade method for a high-pixel LED lamp scene upgrade system based on the UDS protocol as claimed in any one of claims 1 to 3, characterized in that: It includes the following steps: Step S1, the image processing module converts the display effect image into scene data for use by the controller, and generates the scene data into a hex file; Step S2, transmitting the hex file generated by the image processing module to the controller through UDS and TP communication protocols; Step S3: After receiving the upgrade request, the controller App program determines whether the current upgrade request is an App program upgrade request or a scene data upgrade request, then powers off and then restarts, and enters the Bootloader program to perform App program upgrade or scene data upgrade according to the type of upgrade request.
5. The upgrading method according to claim 4, characterized in that: In the step S1, the display effect diagram is converted into scene data that can be directly used by the controller, and a hex file is generated, which specifically includes the following steps: Step S11, using the ImageSequence module in the Python language Pillow library, traverse each frame of the animated image in the display effect diagram, and save each frame of the image as a static image; Step S12: reading a static image frame, and dividing the static image into a plurality of display areas according to an input resolution; Step S13, calling the PIL library function, looping to obtain the RGB value of each display area, taking the average of R, G, and B in the area as the RGB value of the area; Step S14, writing the RGB value of each display area into the file in sequence according to the physical space sorting; Step S15, repeat steps S12 to S14, process all static images frame by frame, and output RGB values in a hex file after processing all frames of static images.
6. The upgrading method according to claim 4, characterized in that: In step S3, after receiving the upgrade request, the controller's App program determines whether the current upgrade request is an App program upgrade request or a scene data upgrade request, then powers on and restarts after powering off, and enters the Bootloader program to perform App program upgrade or scene data upgrade according to the type of upgrade request, specifically including the following steps: Step S31, the controller App program receives an upgrade request; Step S32: judging whether the current upgrade request is an App program upgrade request or a scene data upgrade request according to the request flag bit; if it is an App program upgrade request, proceeding to step S33; If it is a scene data upgrade request, go to step S34; Step S33, the host computer sends a request to enter the Bootloader program to the controller through the BootLoader. After the App program receives the instruction to enter the Bootloader program, it sets the flag bit of the Bootloader program request at the specified address in the RAM to request to update the App program, and triggers the controller to restart and enter the Boot mode through the Watchdog, and enters the BootLoader upgrade process; Step S34, the host computer sends a scene data upgrade request to the controller, and then the host computer sends a request to enter the Bootloader program. After the App program receives the instruction to enter the Bootloader program, it sets the flag bit of the Bootloader program request to request to upgrade the scene data at the specified address in the RAM, and triggers the controller to restart and enter the Boot mode through Watchdog, entering the BootLoader upgrade process; Step S35, after the upgrade is completed, jump back to the normal App program, read the scene data information in the off-chip memory, find the corresponding storage start and end positions according to the scene number that needs to be displayed, read out the scene data and control the display of the high-pixel LED lamp.