Bug solving or upgrading method for image detection software
By employing a dual firmware architecture and encrypted data transmission in the light source controller, the problems of software bugs and logic defects in the light source controller were solved, enabling remote upgrades and saving time and costs.
Patent Information
- Application Number
- CN202510887100.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-30
- Publication Date
- 2025-11-11
AI Technical Summary
In visual inspection, software bugs in the light source controller are not discovered during the factory or testing phase, leading to the need for return to the factory for upgrades. Furthermore, existing online upgrade methods cannot effectively resolve software bugs or logic defects, increasing time and transportation costs.
It adopts a dual firmware architecture, including a BootLoader layer and an APP application layer, which are stored in non-volatile memory respectively. The firmware upgrade is controlled through the BootLoader layer, and encrypted data transmission and verification are performed between the light source controller and the host computer to realize remote upgrade.
It enables rapid resolution of software bugs and iterative upgrades of light source controller logic in visual inspection, avoiding factory returns for upgrades, saving time and transportation costs, and ensuring a safe and reliable upgrade process.
Smart Images

Figure CN120929099A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software bug fixing or upgrades, and more particularly to a method for fixing or upgrading bugs in image detection software. Background Technology
[0002] Currently, in visual inspection, if a software bug is not found during the manufacturing or testing phase, or if it is discovered during application that the previous requirements cannot meet the current inspection solution, an upgrade is needed. However, chip upgrades require an upgrade line, and the entire structure and circuit board need to be designed with upgrade functionality in mind. But if an online upgrade is performed using existing communication methods, the software bug or the defects in the software application logic can be resolved. Summary of the Invention
[0003] The main objective of this invention is to provide a
[0004] To achieve the above objectives, the technical solution adopted by this invention is: a method for bug fixing or upgrading image detection software, specifically including the following steps:
[0005] Step 1: Construct a dual-firmware architecture for the light source controller: Divide the non-volatile memory into independent storage areas to store the BootLoader layer program and the APP application layer program respectively, satisfying storage space constraints.
[0006] M BL +M APP +M Data ≤M Flash ,
[0007] Where M BL M is the firmware size of the BootLoader layer. APP M is the maximum size of the APP layer firmware. Data To reserve space for the data area, M Flash The total capacity of the Flash memory; the BootLoader layer is dedicated to firmware upgrade control, and the APP application layer executes the normal function logic of the device and has built-in version information fields containing version number, release date and verification code;
[0008] Step 2: Based on the discovered bugs or features that need to be upgraded, modify the existing APP firmware and generate a new APP firmware.
[0009] Step 3: Import the new APP firmware into the host computer. At the same time, the host computer obtains the version information of the current APP firmware of the light source controller that needs to be upgraded, and compares the obtained version information with the version information of the new APP firmware. If the version information of the new APP firmware is higher than the version information of the current APP firmware, then the upgrade is performed.
[0010] Preferably, step three specifically includes the following steps:
[0011] Step 31: The host computer sends an upgrade command and the version information of the new APP firmware. The APP determines whether an upgrade is needed. If the upgrade is confirmed, the current APP guides the light source controller to restart and enter BootLoader mode.
[0012] Step 32: After entering BootLoader mode, BootLoader sends a command to request the host computer to provide upgrade information and erases the APP flash area to prepare for writing the new APP firmware. The upgrade information includes the version information of the new APP firmware, the total CRC check value, and the total length of bin.
[0013] Step 33: The host computer sends the new APP firmware data frame to the light source controller in encrypted form. After receiving the data frame, the BootLoader performs CRC verification and decrypts the data frame. The decrypted data frame is written to the erased APP flash area. Writing to the Flash is considered as successful storage of this frame.
[0014] Step 34: After each data frame is successfully written, an ACK is returned to the host computer; if it fails, a NACK is returned, and the host computer will resend the unsuccessful data frame. If the same data frame fails three times, it is considered an upgrade failure.
[0015] Step 35: After all data frames are successfully transmitted, verified, decrypted and stored, the BootLoader returns a successful upgrade status to the host computer, and the light source controller switches from BootLoader mode back to the Flash area where the APP is located.
[0016] Compared with existing technologies, the present invention has the following advantages:
[0017] The upgrade method of this invention can quickly resolve abnormal problems or software bugs in visual inspection and iterative upgrades of the application logic of the light source controller. It can be resolved remotely without returning to the factory for upgrades, saving time and transportation costs, and is easy to use. Attached Figure Description
[0018] Figure 1 This is a flowchart based on the present invention. Detailed Implementation
[0019] The following description is intended to disclose the invention and enable those skilled in the art to implement it. The preferred embodiments described below are merely examples, and other obvious variations will occur to those skilled in the art.
[0020] A method for fixing or upgrading image detection software, specifically including the following steps:
[0021] Step 1: Construct a dual-firmware architecture for the light source controller: Divide the non-volatile memory into independent storage areas to store the BootLoader layer program and the APP application layer program respectively, satisfying storage space constraints.
[0022] M BL +M APP +M Data ≤M Flash ,
[0023] Where M BL M is the firmware size of the BootLoader layer. APP M is the maximum size of the APP layer firmware. Data To reserve space for the data area, M Flash The total capacity of the Flash memory; the BootLoader layer is dedicated to firmware upgrade control, and the APP application layer executes the normal function logic of the device and has built-in version information fields containing version number, release date and verification code;
[0024] Step 2: Based on the discovered bugs or features that need to be upgraded, modify the existing APP firmware and generate a new APP firmware.
[0025] Step 3: Import the new APP firmware into the host computer. Simultaneously, the host computer obtains the current APP firmware version information of the light source controller that needs upgrading. It compares the obtained version information with the new APP firmware version information. If the new APP firmware version is higher than the current APP firmware version, the upgrade is performed. The specific steps are as follows:
[0026] Step 31: The host computer sends an upgrade command and the version information of the new APP firmware. The APP determines whether an upgrade is needed. If the upgrade is confirmed, the current APP guides the light source controller to restart and enter BootLoader mode.
[0027] Step 32: After entering BootLoader mode, BootLoader sends a command to request the host computer to provide upgrade information and erases the APP flash area to prepare for writing the new APP firmware. The upgrade information includes the version information of the new APP firmware, the total CRC check value, and the total length of bin.
[0028] Step 33: The host computer sends the new APP firmware data frame to the light source controller in encrypted form. After receiving the data frame, the BootLoader performs CRC verification and decrypts the data frame. The decrypted data frame is written to the erased APP flash area. Writing to the Flash is considered as successful storage of this frame.
[0029] Step 34: After each data frame is successfully written, an ACK is returned to the host computer; if it fails, a NACK is returned, and the host computer will resend the unsuccessful data frame. If the same data frame fails three times, it is considered an upgrade failure.
[0030] Step 35: After all data frames are successfully transmitted, verified, decrypted and stored, the BootLoader returns a successful upgrade status to the host computer, and the light source controller switches from BootLoader mode back to the Flash area where the APP is located.
[0031] The bugs in step two were manually discovered communication anomalies, data corruption, or lag after running for too long. In addition, black images appeared during the photo taking process. Ultimately, it was found that the light source controller was not lit or the brightness was too dim. The code was modified and the APP firmware was generated, and iterative updates were made to a higher version than the previous one.
[0032] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The embodiments and descriptions in the specification are merely principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the claimed invention. The scope of protection claimed by the appended claims and their equivalents is defined.
Claims
1. A method for bug fixing or upgrading image detection software, specifically including the following steps: Step 1: Construct a dual-firmware architecture for the light source controller: Divide the non-volatile memory into independent storage areas to store the BootLoader layer program and the APP application layer program respectively, satisfying storage space constraints. M BL +M APP +M Data ≤M Flash , Where M BL M is the firmware size of the BootLoader layer. APP M is the maximum size of the APP layer firmware. Data To reserve space for the data area, M Flash The total capacity of the Flash memory; the BootLoader layer is dedicated to firmware upgrade control, and the APP application layer executes the normal function logic of the device and has built-in version information fields containing version number, release date and verification code; Step 2: Based on the discovered bugs or features that need to be upgraded, modify the existing APP firmware and generate a new APP firmware. Step 3: Import the new APP firmware into the host computer. At the same time, the host computer obtains the version information of the current APP firmware of the light source controller that needs to be upgraded, and compares the obtained version information with the version information of the new APP firmware. If the version information of the new APP firmware is higher than the version information of the current APP firmware, then the upgrade is performed.
2. The method for bug fixing or upgrading image detection software according to claim 1, characterized in that, Step three specifically includes the following steps: Step 31: The host computer sends an upgrade command and the version information of the new APP firmware. The APP determines whether an upgrade is needed. If the upgrade is confirmed, the current APP guides the light source controller to restart and enter BootLoader mode. Step 32: After entering BootLoader mode, BootLoader sends a command to request the host computer to provide upgrade information and erases the APP flash area to prepare for writing the new APP firmware. The upgrade information includes the version information of the new APP firmware, the total CRC check value, and the total length of bin. Step 33: The host computer sends the new APP firmware data frame to the light source controller in encrypted form. After receiving the data frame, the BootLoader performs CRC check and decrypts the data frame. The decrypted data frame is written to the erased APP flash area. Writing to the Flash is considered as successful storage of this frame. Step 34: After each data frame is successfully written, an ACK is returned to the host computer; if it fails, a NACK is returned, and the host computer will resend the unsuccessful data frame. If the same data frame fails three times, it is considered an upgrade failure. Step 35: After all data frames are successfully transmitted, verified, decrypted and stored, the BootLoader returns a successful upgrade status to the host computer, and the light source controller switches from BootLoader mode back to the Flash area where the APP is located.