Software synchronization method and device for testing production line off-line detector
By using partition A and partition B in the microcontroller to separately store EOL test software and product software, the problems of EOL test software leakage and extended test cycles are solved, and efficient and secure software synchronization is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies, when performing EOL testing by switching software partitions or downloading product software, there is a risk that the EOL testing software may leak out of the production line or that the testing cycle may be extended.
The microcontroller uses partitions A and B to store EOL test software and product software separately. Through security settings, interrupt blocking, reset, and software copying, the EOL test software is erased and the product software is copied to partition A, thus achieving software synchronization.
It avoids the risk of EOL testing software leakage, improves testing efficiency and security, and reduces the testing cycle.
Smart Images

Figure CN121742876A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of automotive electronics technology, and in particular to a software synchronization method and apparatus for testing off-line inspection equipment. Background Technology
[0002] Automotive EOL (End of Line) testing, also known as production line off-line testing, involves comprehensive inspection of vehicles to ensure they meet predetermined quality standards before leaving the production line.
[0003] In related technologies, independent EOL (End-of-Life) testing software can be developed specifically for EOL testing. During the product manufacturing phase, the EOL testing software and the product software can be injected into the microcontroller, residing in different partitions of the microcontroller's program flash memory. Once the EOL test is complete, the default running software can be switched back to the product software by switching software partitions or re-downloading the product software.
[0004] However, switching via software partitioning increases the risk of EOL testing software leaking from the production line, as the microcontroller software includes EOL testing software. Switching via downloading the product software significantly increases the total EOL testing time. Summary of the Invention
[0005] To address the aforementioned technical problems, this application provides a software synchronization method, apparatus, electronic device, and storage medium for testing with a production line off-line inspection instrument.
[0006] According to a first aspect of this application, a software synchronization method for testing off-line inspection equipment is provided, comprising: Receive the EOL test command sent by the host computer; In response to the EOL test command, the vehicle is subjected to an EOL function test using EOL test software, and the EOL test results are obtained and returned; wherein, the EOL test software is located in partition A of the microcontroller program flash memory, and partition A is the execution partition of the microcontroller; Receive a product software synchronization request instruction sent by the host computer, wherein the product software synchronization request instruction is sent by the host computer after determining that the EOL test has passed based on the EOL test result; In response to the product software synchronization request instruction, a software synchronization operation is performed; wherein, the software synchronization operation includes: performing security settings on the microcontroller and disabling global interrupts; switching the execution partition after the microcontroller reset from partition A to partition B; erasing the EOL test software in partition A; copying the product software located in partition B of the microcontroller's program flash memory to partition A; and triggering a microcontroller reset. After a preset time period, a software version read request sent by the host computer is received, and in response to the software version read request, the version information of the product software is returned.
[0007] Optionally, the software synchronization operation includes: Implement security settings for each core of the microcontroller and disable global interrupts for each core of the microcontroller. After the master core stops its own clock source and enters an infinite loop, it switches the execution partition of the microcontroller after the reset from partition A to partition B; erases the EOL test software in partition A; copies the product software located in partition B in the microcontroller's program flash memory to partition A; and triggers the microcontroller reset.
[0008] Optionally, the security settings for each core of the microcontroller include: For each core, both the internal and external watchdog times are disabled. The power management chip is deinitialized, and if the power management chip has FCCU (Fault Control Collection Unit) functionality, the FCCU function is enabled.
[0009] Optionally, triggering the microcontroller reset includes: If the power management chip supports FCCU functionality, a microcontroller reset is triggered by manipulating the microcontroller's register control pins; or... If the power management chip does not support the FCCU function, a microcontroller reset is triggered by calling the value of the MCU register; or... After a preset time period, a power-on command is received from the host computer, and in response to the power-on command, the microcontroller is powered on again.
[0010] Optionally, partition A contains FlashDriver (Flash Driver, memory driver) code; The method further includes: During microcontroller power-on initialization, the FlashDriver code in partition A is copied to pseudo-static random access memory; The step of erasing the EOL test software from partition A and copying the product software located in partition B of the microcontroller's program flash memory to partition A includes: The FlashDriver code in the pseudo-static random access memory is invoked to erase the EOL test software in partition A and copy the product software located in partition B, which is located in the microcontroller's program flash memory, to partition A.
[0011] According to a second aspect of this application, a software synchronization device for testing off-line inspection equipment is provided, comprising: The EOL test command receiving module is used to receive EOL test commands sent by the host computer. The EOL test module is used to respond to the EOL test command, use EOL test software to perform EOL function tests on the vehicle, obtain and return the EOL test results; wherein, the EOL test software is located in partition A of the microcontroller program flash memory, and partition A is the execution partition of the microcontroller; The product software synchronization request instruction receiving module is used to receive product software synchronization request instructions sent by the host computer. The product software synchronization request instruction is sent by the host computer after determining that the EOL test has passed based on the EOL test results. The product software synchronization module is used to respond to the product software synchronization request instruction and perform software synchronization operations; wherein, the software synchronization operations include: performing security settings on the microcontroller and disabling global interrupts; switching the execution partition after microcontroller reset from partition A to partition B; erasing the EOL test software in partition A; copying the product software located in partition B of the microcontroller's program flash memory to partition A; and triggering microcontroller reset; The software version read request receiving module is used to receive software version read requests sent by the host computer after a preset time period. The product software version information return module is used to return the version information of the product software in response to the software version read request.
[0012] Optionally, the product software synchronization module is specifically used to respond to the product software synchronization request instruction, perform security settings on each core of the microcontroller, and shield the global interrupts on each core of the microcontroller; after the slave core stops its own clock source and enters an infinite loop, the master core switches the execution partition of the microcontroller after reset from partition A to partition B; erases the EOL test software in partition A; copies the product software located in partition B in the microcontroller's program flash memory to partition A; and triggers the microcontroller reset.
[0013] Optionally, the product software synchronization module is specifically used to perform security settings on each core of the microcontroller in the following manner: For each core, both the internal and external watchdog times are disabled. Deinitialize the power management chip, and enable the FCCU function if the power management chip has FCCU functionality.
[0014] Optionally, the product software synchronization module is specifically used to trigger a microcontroller reset in the following manner: If the power management chip supports FCCU functionality, a microcontroller reset is triggered by manipulating the microcontroller's register control pins; or... If the power management chip does not support the FCCU function, a microcontroller reset is triggered by calling the value of the MCU register; or... After a preset time period, a power-on command is received from the host computer, and in response to the power-on command, the microcontroller is powered on again.
[0015] Optionally, partition A contains FlashDriver code; The device further includes: The FlashDriver code copying module is used to copy the FlashDriver code in partition A to the pseudo-static random access memory when the microcontroller is powered on and initialized. The product software synchronization module is specifically used to erase the EOL test software in partition A and copy the product software located in partition B of the microcontroller's program flash memory to partition A in the following manner: The FlashDriver code in the pseudo-static random access memory is invoked to erase the EOL test software in partition A and copy the product software located in partition B, which is located in the microcontroller's program flash memory, to partition A.
[0016] According to a third aspect of this application, an electronic device is provided, comprising: a processor configured to execute a computer program stored in a memory, wherein the computer program, when executed by the processor, implements the method described in the first aspect.
[0017] According to a fourth aspect of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method described in the first aspect.
[0018] According to a fifth aspect of this application, a computer program product is provided that, when the computer program product is run on a computer, causes the computer to perform the method described in the first aspect.
[0019] The technical solution provided in this application has the following advantages compared with the prior art: After the microcontroller performs an EOL (End-of-Life) functional test on the vehicle using EOL testing software, it returns the EOL test results. If the host computer determines that the EOL test has passed based on the results, it sends a product software synchronization request command to the microcontroller. The microcontroller performs software synchronization operations, including setting security parameters for the microcontroller and disabling global interrupts; switching the execution partition after the microcontroller reset from partition A to partition B; erasing the EOL testing software in partition A; copying the product software located in partition B of the microcontroller's program flash memory to partition A; and triggering a microcontroller reset. After the microcontroller resets, it can directly execute the product software in partition B. Since the EOL testing software and the product software are located in partitions A and B of the microcontroller's program flash memory respectively, there is no need to download the product software after the EOL test, thus avoiding the extension of the EOL test cycle and improving the efficiency of the EOL test. Furthermore, after the EOL test passes, the software synchronization operation makes the software in partitions A and B identical, i.e., both are product software, avoiding the risk of EOL testing software leakage and improving the security of the EOL test. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a flowchart of a software synchronization method for testing a production line off-line inspection instrument, as described in this application. Figure 2 This is a schematic diagram of the software distribution in the embodiments of this application; Figure 3 This is an interactive flowchart of the software synchronization method for testing the off-line inspection instrument in the embodiments of this application; Figure 4 This is a schematic diagram illustrating the synchronous operation of various core execution software in an embodiment of this application; Figure 5 This is a schematic diagram of a software synchronization device used for testing a production line off-line inspection instrument in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of an electronic device in an embodiment of this application. Detailed Implementation
[0023] To better understand the above-mentioned objectives, features, and advantages of this application, the solution of this application will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0024] Many specific details are set forth in the following description in order to provide a full understanding of this application, but this application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some embodiments of this application, and not all embodiments.
[0025] See Figure 1 , Figure 1 This is a flowchart of a software synchronization method for testing an EOL (Exit-of-Line) testing instrument, as described in this application. Applied to the lower-level machine (microcontroller) for EOL testing, it may include the following steps: Step S102: Receive the EOL test command sent by the host computer.
[0026] In this embodiment of the application, when an EOL test is to be performed, the tester can send an EOL test command to the microcontroller through a host computer.
[0027] Step S104: In response to the EOL test command, the EOL test software is used to perform an EOL function test on the vehicle, and the EOL test result is obtained and returned. The EOL test software is located in partition A of the microcontroller's program flash memory, and partition A is the microcontroller's execution partition.
[0028] like Figure 2 As shown, the microcontroller's PFALSH (Program Flash) is divided into two partitions: Partition A and Partition B. Partition A is used to store the EOL test software, while Partition B is used to store the product software. When the system starts, it will run the software in Partition A by default. When the microcontroller receives an EOL test command, it can use the EOL test software in Partition A to perform EOL function tests on the vehicle. After obtaining the EOL test results, it returns the results to the host computer.
[0029] Step S106: Receive the product software synchronization request instruction sent by the host computer. The product software synchronization request instruction is sent by the host computer after determining that the EOL test has passed based on the EOL test results.
[0030] After the host computer determines that the EOL test has passed based on the EOL test results, it sends a product software synchronization request command to the microcontroller, instructing the microcontroller to prepare to perform the software synchronization operation.
[0031] Step S108: In response to the product software synchronization request instruction, perform software synchronization operation.
[0032] The software synchronization operation is the process of synchronizing the product software from partition B to partition A.
[0033] Performing software synchronization operations includes: 1) Configure the microcontroller for safety and disable global interrupts to prevent the software synchronization process from being affected by microcontroller reset or execution of interrupt code in PFALSH during software synchronization.
[0034] 2) Switch the execution partition from partition A to partition B after the microcontroller is reset. The execution partition before the microcontroller is reset is partition A, and the execution partition after the reset is partition B. In this way, after the microcontroller is reset, the product software in partition B will be executed.
[0035] 3) Erase the EOL test software in partition A, and copy the product software located in partition B (microcontroller program flash memory) to partition A, so that the software in partition A and partition B are consistent and are both product software, thus preventing the EOL test software from leaving the production line.
[0036] Optionally, partition A contains FlashDriver code; during microcontroller power-on initialization, the FlashDriver code in partition A is copied to pseudo-static random access memory (PSRAM). During software erasure and copying, the FlashDriver code in PSRAM can be invoked to erase the EOL test software in partition A and copy the product software located in partition B, which is located in the microcontroller's program flash memory, to partition A.
[0037] 4) After software synchronization is complete, a microcontroller reset is triggered. After the microcontroller resets, the product software in partition B will be executed. Optionally, if the power management chip supports FCCU functionality, the microcontroller reset is triggered by manipulating the microcontroller's register control pins; or, if the power management chip does not support FCCU functionality, the microcontroller reset is triggered by calling the value of the MCU register. Alternatively, if the microcontroller cannot trigger its own reset, it can be triggered by the host computer. That is, after a preset time period, the microcontroller receives a power-on command from the host computer and, in response to the power-on command, re-powers the microcontroller.
[0038] Step S110: After a preset time period, receive a software version read request sent by the host computer, and respond to the software version read request by returning the version information of the product software.
[0039] Since software synchronization requires a certain amount of time, a preset time period is established to ensure sufficient execution time for the software synchronization operation. This preset time period is longer than the time required for the microcontroller to complete the software synchronization operation. For example, if the software synchronization operation takes 7 seconds, the preset time period can be 10 seconds. After the preset time period, the host computer sends a software version read request to the microcontroller to obtain the product software version information and verify whether the software has been successfully switched to the product software version.
[0040] Figure 3 for Figure 1 The interaction flowchart corresponding to the embodiment may include the following steps: In step S302, the host computer sends an EOL test command to the microcontroller.
[0041] In step S304, the microcontroller responds to the EOL test command and uses the EOL test software to perform an EOL function test on the vehicle, and obtains the EOL test result.
[0042] Step S306: The microcontroller returns the EOL test result to the host computer.
[0043] In step S308, after the host computer determines that the EOL test has passed based on the EOL test results, it sends a product software synchronization request command to the microcontroller.
[0044] In step S310, the microcontroller responds to the product software synchronization request instruction and performs software synchronization operation.
[0045] In step S312, after a preset time period, the host computer sends a software version read request to the microcontroller.
[0046] In step S314, the microcontroller responds to the software version read request and returns the product software version information to the host computer.
[0047] Microcontrollers typically include multiple cores, see [link to relevant documentation] Figure 4 , Figure 4 This is a schematic diagram illustrating the synchronous operation of various core execution software in an embodiment of this application.
[0048] When performing software synchronization operations on each core, safety settings can be configured for each core of the microcontroller. Optionally, the internal and external watchdog times can be disabled for each core to prevent the software synchronization process from being interrupted by restarting the microcontroller. The power management chip can also be deinitialized, and if the power management chip has FCCU functionality, its FCCU function can be enabled. This prevents the power management chip from resetting the microcontroller, thus avoiding interruption of the software synchronization process. A power management chip with FCCU functionality can automatically pull down the microcontroller's RESET pin after detecting a change in the level of a certain pin. By enabling the FCCU function, subsequent microcontroller resets can be triggered by manipulating the microcontroller's register control pins.
[0049] Since interrupt code is usually stored in PFlash, if an interrupt occurs suddenly, the contents of PFlash will be executed immediately. However, the execution of Flash code is not allowed during software synchronization. Therefore, global interrupts can be masked for each core of the microcontroller to prevent the execution of Flash code during software synchronization.
[0050] Based on the principles of microcontrollers, when the master core operates on the PFlash, it needs to wait for the slave core to suspend or enter the PSRAM space. Therefore, after the slave core stops its own clock source and enters an infinite loop, the master core switches the execution partition after the microcontroller is reset from partition A to partition B; erases the EOL test software in partition A; copies the product software located in partition B of the microcontroller's program flash memory to partition A; and triggers the microcontroller reset.
[0051] The software synchronization method for testing production line off-line testing instruments according to embodiments of this application allows the host computer to send a product software synchronization request command to the microcontroller after the EOL test passes. Upon receiving the product software synchronization request command, the microcontroller performs software synchronization operations, including setting security parameters for the microcontroller and disabling global interrupts; switching the execution partition after microcontroller reset from partition A to partition B; erasing the EOL test software in partition A; copying the product software located in partition B of the microcontroller's program flash memory to partition A; and triggering a microcontroller reset. After the microcontroller resets, the product software in partition B can be executed directly. Since the EOL test software and the product software are located in partitions A and B of the microcontroller's program flash memory respectively, there is no need to download the product software after the EOL test, thus avoiding an extension of the EOL test cycle and improving the efficiency of the EOL test. Furthermore, after the EOL test passes, the software synchronization operation makes the software in partitions A and B identical, i.e., both are product software, avoiding the risk of EOL test software leakage and improving the security of the EOL test.
[0052] It should be noted that although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0053] This application also provides a software synchronization device for testing with an off-line inspection instrument, see [link to relevant documentation]. Figure 5 The software synchronization device 500 for testing the off-line inspection instrument on the production line includes: EOL test command receiving module 502 is used to receive EOL test commands sent by the host computer; EOL test module 504 is used to respond to EOL test commands, use EOL test software to perform EOL function tests on the vehicle, obtain and return EOL test results; wherein, the EOL test software is located in partition A of the microcontroller program flash memory, and partition A is the execution partition of the microcontroller; The product software synchronization request instruction receiving module 506 is used to receive the product software synchronization request instruction sent by the host computer. The product software synchronization request instruction is sent by the host computer after determining that the EOL test has passed based on the EOL test results. The product software synchronization module 508 is used to respond to the product software synchronization request command and perform software synchronization operations. The software synchronization operations include: setting security settings for the microcontroller and disabling global interrupts; switching the execution partition after the microcontroller is reset from partition A to partition B; erasing the EOL test software in partition A; copying the product software located in partition B in the microcontroller's program flash memory to partition A; and triggering the microcontroller reset. The software version read request receiving module 510 is used to receive a software version read request sent by the host computer after a preset time period. Product software version information return module 512 is used to return product software version information in response to software version read request.
[0054] Optionally, the product software synchronization module 508 is specifically used to respond to the product software synchronization request command, perform security settings on each core of the microcontroller, and shield the global interrupts on each core of the microcontroller; after the slave core stops its own clock source and enters an infinite loop, the master core switches the execution partition of the microcontroller after reset from partition A to partition B; erases the EOL test software in partition A; copies the product software located in partition B in the microcontroller's program flash memory to partition A; and triggers the microcontroller reset.
[0055] Optionally, the product software synchronization module 508 is specifically used to perform security settings on each core of the microcontroller in the following manner: For each core, both the internal and external watchdog times are disabled. Deinitialize the power management chip, and enable the FCCU function if the power management chip has FCCU functionality.
[0056] Optionally, the product software synchronization module 508 is specifically used to trigger a microcontroller reset in the following manner: If the power management chip supports FCCU functionality, a microcontroller reset is triggered by manipulating the microcontroller's register control pins; or... If the power management chip does not support the FCCU function, a microcontroller reset is triggered by calling the value of the MCU register; or... After a preset time period, the microcontroller receives a power-on command from the host computer and, in response to the power-on command, powers on the microcontroller.
[0057] Optionally, partition A contains FlashDriver code; The aforementioned software synchronization device 500 for testing the production line off-line inspection instrument also includes: The FlashDriver code copying module is used to copy the FlashDriver code in partition A to the pseudo-static random access memory when the microcontroller is powered on and initialized. Product software synchronization module 508 is specifically used to erase the EOL test software in partition A and copy the product software located in partition B, which is located in the microcontroller's program flash memory, to partition A in the following ways: The FlashDriver code in the pseudo-static random access memory is invoked to erase the EOL test software in partition A and copy the product software located in partition B, which is located in the microcontroller's program flash memory, to partition A.
[0058] The specific details of each module or unit in the above-mentioned device have been described in detail in the corresponding methods, so they will not be repeated here.
[0059] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0060] This application also provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the software synchronization method for testing a production line off-line inspection instrument described in this example embodiment.
[0061] Reference Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device in an embodiment of this application. The specific embodiments of this application do not limit the specific implementation of the electronic device.
[0062] like Figure 6 As shown, the electronic device may include: a processor 602, a communication interface 604, a memory 606, and a communication bus 608.
[0063] The processor 602, communication interface 604, and memory 606 communicate with each other via communication bus 608.
[0064] Communication interface 604 is used for communication with other electronic devices or servers.
[0065] The processor 602 is used to execute program 610, specifically to perform the relevant steps in the above method embodiments.
[0066] Specifically, program 610 may include program code that includes computer operation instructions.
[0067] Processor 602 may be a central processing unit, a specific integrated circuit, or one or more integrated circuits configured to implement the embodiments of this application. The one or more processors included in the smart device may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs.
[0068] Memory 606 is used to store program 610. Memory 606 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0069] Specifically, program 610 can be used to cause processor 602 to execute the steps in the above-described embodiment of the LIN bus short-ground fault confirmation and handling method.
[0070] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.
[0071] In this embodiment of the application, a computer-readable storage medium is also provided, on which a computer program is stored, wherein when the computer program is executed by a processor, the above-described software synchronization method for testing the off-line inspection instrument of the production line is implemented.
[0072] It should be noted that the computer-readable storage medium shown in this application can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, radio frequency, etc., or any suitable combination thereof.
[0073] In this embodiment of the application, a computer program product is also provided, which, when run on a computer, causes the computer to execute the above-described software synchronization method for testing the off-line inspection instrument of the production line.
[0074] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0075] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A software synchronization method for testing off-line inspection instruments on a production line, characterized in that, include: Receive the EOL (End of Production) test command sent by the host computer; In response to the EOL test command, the vehicle is subjected to an EOL function test using EOL test software, and the EOL test results are obtained and returned; wherein, the EOL test software is located in partition A of the microcontroller program flash memory, and partition A is the execution partition of the microcontroller; Receive a product software synchronization request instruction sent by the host computer, wherein the product software synchronization request instruction is sent by the host computer after determining that the EOL test has passed based on the EOL test result; In response to the product software synchronization request instruction, a software synchronization operation is performed; wherein, the software synchronization operation includes: performing security settings on the microcontroller and disabling global interrupts; switching the execution partition after the microcontroller reset from partition A to partition B; erasing the EOL test software in partition A; copying the product software located in partition B of the microcontroller's program flash memory to partition A; and triggering a microcontroller reset. After a preset time period, a software version read request sent by the host computer is received, and in response to the software version read request, the version information of the product software is returned.
2. The method according to claim 1, characterized in that, The software synchronization operation includes: Implement security settings for each core of the microcontroller and disable global interrupts for each core of the microcontroller. After the master core stops its own clock source and enters an infinite loop, it switches the execution partition of the microcontroller after the reset from partition A to partition B; erases the EOL test software in partition A; copies the product software located in partition B in the microcontroller's program flash memory to partition A; and triggers the microcontroller reset.
3. The method according to claim 2, characterized in that, The security settings for each core of the microcontroller include: For each core, both the internal and external watchdog times are disabled. The power management chip is deinitialized, and the FCCU function is enabled if the power management chip has a Security Control Collection Unit (FCCU) function.
4. The method according to claim 1, characterized in that, The triggering of microcontroller reset includes: If the power management chip supports the FCCU function, a microcontroller reset is triggered by manipulating the microcontroller's register control pins; or... If the power management chip does not support the FCCU function, a microcontroller reset is triggered by calling the value of the MCU register; or... After a preset time period, a power-on command is received from the host computer, and in response to the power-on command, the microcontroller is powered on again.
5. The method according to claim 1, characterized in that, Partition A contains the FlashDriver memory driver code; The method further includes: During the microcontroller's power-on initialization, the FlashDriver code in partition A is copied to the pseudo-static random access memory; The step of erasing the EOL test software from partition A and copying the product software located in partition B of the microcontroller's program flash memory to partition A includes: The FlashDriver code in the pseudo-static random access memory is invoked to erase the EOL test software in partition A and copy the product software located in partition B, which is located in the microcontroller's program flash memory, to partition A.
6. A software synchronization device for testing off-line inspection instruments on a production line, characterized in that, The device includes: The EOL test command receiving module is used to receive the production line EOL test command sent by the host computer. The EOL test module is used to respond to the EOL test command, use EOL test software to perform EOL function tests on the vehicle, obtain and return the EOL test results; wherein, the EOL test software is located in partition A of the microcontroller program flash memory, and partition A is the execution partition of the microcontroller; The product software synchronization request instruction receiving module is used to receive product software synchronization request instructions sent by the host computer. The product software synchronization request instruction is sent by the host computer after determining that the EOL test has passed based on the EOL test results. The product software synchronization module is used to respond to the product software synchronization request instruction and perform software synchronization operations; wherein, the software synchronization operations include: performing security settings on the microcontroller and disabling global interrupts; switching the execution partition after microcontroller reset from partition A to partition B; erasing the EOL test software in partition A; copying the product software located in partition B of the microcontroller's program flash memory to partition A; and triggering microcontroller reset; The software version read request receiving module is used to receive software version read requests sent by the host computer after a preset time period. The product software version information return module is used to return the version information of the product software in response to the software version read request.
7. The apparatus according to claim 6, characterized in that, The product software synchronization module is specifically used to respond to the product software synchronization request command, perform security settings on each core of the microcontroller, and shield the global interrupts of each core of the microcontroller; after the slave core stops its own clock source and enters an infinite loop, the master core switches the execution partition of the microcontroller after reset from partition A to partition B; erases the EOL test software in partition A; copies the product software located in partition B in the microcontroller's program flash memory to partition A; and triggers the microcontroller reset.
8. The apparatus according to claim 7, characterized in that, The product software synchronization module is specifically used to perform security settings on each core of the microcontroller in the following ways: For each core, both the internal and external watchdog times are disabled. The power management chip is deinitialized, and the FCCU function is enabled if the power management chip has a Security Control Collection Unit (FCCU) function.
9. The apparatus according to claim 6, characterized in that, The product software synchronization module is specifically used to trigger a microcontroller reset in the following manner: If the power management chip supports the FCCU function, a microcontroller reset is triggered by manipulating the microcontroller's register control pins; or... If the power management chip does not support the FCCU function, the microcontroller is reset by calling the value of the MCU register. or, After a preset time period, a power-on command is received from the host computer, and in response to the power-on command, the microcontroller is powered on again.
10. The apparatus according to claim 6, characterized in that, Partition A contains the FlashDriver memory driver code; The device further includes: The FlashDriver code copying module is used to copy the FlashDriver code in partition A to the pseudo-static random access memory when the microcontroller is powered on and initialized. The product software synchronization module is specifically used to erase the EOL test software in partition A and copy the product software located in partition B of the microcontroller's program flash memory to partition A in the following manner: The FlashDriver code in the pseudo-static random access memory is invoked to erase the EOL test software in partition A and copy the product software located in partition B, which is located in the microcontroller's program flash memory, to partition A.