An AGV upgrade method and system
By using two configuration file copies and two kernel partitions guided by efibootguard, the problem of abnormal self-recovery during AGV upgrade is solved, achieving safe and reliable upgrades and abnormal rollbacks, and ensuring the stable operation of the AGV system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- LINDE CHINA FORKELEVATOR TRUCK CORP
- Filing Date
- 2024-12-02
- Publication Date
- 2026-06-02
AI Technical Summary
Existing AGV upgrade methods lack the ability to self-recover from anomalies, and the upgrade process can easily lead to system environment damage or failure.
An upgrade method based on two copies of configuration files and two kernel partitions using efibootguard is adopted. Through integrity verification, version number management and reboot verification, the safe installation of upgrade files and abnormal rollback are ensured. The high security and reliability of efibootguard are used to manage the boot process.
It ensures the safety and reliability of AGV upgrades, guarantees a smooth upgrade process, and allows for rollback to the latest normal version in case of abnormal situations, thus ensuring the safety and stability of AGV operation.
Smart Images

Figure CN122132053A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of vehicle upgrade technology, and in particular to an AGV upgrade method and system. Background Technology
[0002] Existing upgrade methods mostly use editing GRUB and initrd to achieve system boot and image switching.
[0003] Compare with document 1, "CN 113114730 A, Upgrade Method, Apparatus, Terminal Device and Storage Medium", the method includes: when receiving an instruction to start the terminal device, starting a boot program and reading an upgrade identifier in a configuration file, the upgrade identifier indicating whether there is a stored image of an upgrade version; if the upgrade identifier indicates that there is a stored image of an upgrade version, reading a startup identifier in the configuration file, the startup identifier indicating to start a target image partition, the target image partition being a partition containing a stored image of an upgrade version in a first partition and a second partition; performing a first verification on the image of the upgrade version in the target image partition; if the first verification is successful, starting the image of the upgrade version in the target image partition and modifying the upgrade identifier to indicate that there is no stored image of an upgrade version.
[0004] Comparing document 2, "CN 116954673 A, A Method for Upgrading and Restoring a Linux Operating System," the upgrade method includes: obtaining a new system image file; if the upgrade conditions are met, decompressing the image file to obtain the new system files; obtaining the current system's system configuration information; obtaining the current system's third-party applications; creating a new system-specific boot file (initrd) and a grub configuration file, and booting the new system using these during reboot; during the boot process, moving the current system's files to a backup folder; moving the new system's files to the root directory; and then migrating user data to the new system; after the new system boots and is activated, completing the configuration according to the system configuration information; and migrating the third-party applications to the new system. This invention can avoid upgrade failures caused by complex package dependencies or a corrupted system environment, and can also restore the new system to the old system.
[0005] It can be seen that both comparison file 1 and comparison file 2 are publicly available copies of two configuration files based on efibootguard for booting, and neither comparison file 1 nor comparison file 2 demonstrates the ability to self-recover from abnormalities during the upgrade process. Summary of the Invention
[0006] The main objective of this invention is to overcome the aforementioned deficiencies in the prior art and propose an AGV upgrade method and system. This method and system uses two configuration file copies and two kernel partitions guided by efibootguard for upgrade control, enabling safe upgrades, anomaly recovery, and upgrade rollback, thus ensuring the safety of AGV (Automated Guided Vehicle) upgrades.
[0007] The present invention adopts the following technical solution:
[0008] On the one hand, an AGV upgrade method includes:
[0009] S101, Obtain the upgrade file for the AGV to be installed;
[0010] S102, Perform integrity verification on the upgrade file;
[0011] S103, after the integrity verification is successful, obtain the configuration information of the first configuration file copy with a lower version number and the second configuration file copy with a higher version number, update the version number in the configuration information of the first configuration file copy to be higher than the version number of the second configuration file copy, and install the upgrade file into the kernel partition configured in the first configuration file copy.
[0012] S104. After the upgrade file is installed, perform a restart operation to verify the normal startup. If the verification is normal, proceed to S105; otherwise, proceed to S106.
[0013] S105, receive confirmation command, update configuration information of first configuration file copy, and run kernel partition configured in first configuration file copy;
[0014] S106, perform a reboot operation and run the kernel partition configured in the second configuration file copy.
[0015] Preferably, before installing the upgrade file, the status of the configuration information in both the first configuration file copy and the second configuration file copy is the first status.
[0016] Preferably, in S103, after the integrity verification is successful, the method further includes: updating the status in the configuration information of the first configuration file copy to the second status.
[0017] Preferably, in S104, after performing the restart operation, the method further includes: updating the status in the configuration information of the first configuration file copy to the third status.
[0018] Preferably, in S105, updating the configuration information of the first configuration file copy includes: receiving a configuration that updates the version number in the configuration information of the first configuration file copy to a version number higher than that of the second configuration file copy, and simultaneously updating the status in the configuration information of the first configuration file copy to a first status.
[0019] Preferably, in S106, after performing the restart operation, the method further includes: not accepting the configuration that updates the version number in the configuration information of the first configuration file copy to a higher version number than that of the second configuration file copy, and updating the status in the configuration information of the first configuration file copy to the first status.
[0020] Preferably, the first and second configuration file copies are booted via the efibootguard bootloader.
[0021] Preferably, in S103, the upgrade file is installed into the kernel partition configured by the first configuration file copy. Specifically, the Lua plugin program updated based on swupdate is run to install the file to be upgraded into the kernel partition configured by the first configuration file copy.
[0022] Preferably, in S106, before performing the restart operation, the following steps are also included: recording on-site information.
[0023] On the other hand, an AGV upgrade system includes:
[0024] The upgrade file acquisition module is used to acquire the upgrade files for the AGV to be installed;
[0025] The integrity verification module is used to perform integrity verification on the upgrade files;
[0026] The upgrade file writing module is used to obtain the configuration information of the first configuration file copy with a lower version number and the second configuration file copy with a higher version number after the integrity verification is successful. It updates the version number in the configuration information of the first configuration file copy to a version number higher than that of the second configuration file copy, and installs the upgrade file into the kernel partition configured in the first configuration file copy.
[0027] The restart verification module is used to perform a restart operation after the upgrade file is installed to verify normal startup. If the verification is successful, the system will proceed to the image confirmation module; otherwise, it will proceed to the rollback module.
[0028] The image confirmation module is used to receive confirmation commands, update the configuration information of the first configuration file copy, and run the kernel partition configured in the first configuration file copy.
[0029] The rollback confirmation module is used to perform a reboot operation and run the kernel partition configured by the second configuration file copy.
[0030] As can be seen from the above description of the present invention, compared with the prior art, the present invention has the following beneficial effects:
[0031] (1) The present invention is based on two created configuration file copies and two kernel partitions. The configuration information of the two configuration file copies stores the location and name of the loaded kernel file (i.e. the location and name of the kernel partition) and the version number of the configuration file. Based on the above configuration information, it can be determined which version needs to be upgraded and which kernel partition needs to be updated with the latest upgrade file, thereby ensuring the smooth progress of the upgrade and ensuring that the current version is not updated. It is convenient to revert to the latest normal version after the upgrade is abnormal, and ensure the safe operation of AGV.
[0032] (2) The configuration information of the two configuration file copies of the present invention also includes the update status of the AGV. Before the upgrade, the update status of the configuration information of the two configuration file copies is the first status by default. During the execution of the upgrade command, the status of the configuration information of the second configuration file copy is updated to the second status. During the restart verification process, the status of the configuration information of the first configuration file copy is updated to the third status, and the status of the configuration information of the second configuration file copy is updated to the first status. After the restart verification, the status of the configuration information of the first configuration file copy is updated to the first status. That is, the update status can be queried at each stage of the upgrade, so that the user can clearly understand the current upgrade status.
[0033] (3) This invention is based on efibootguard to boot two copies of configuration files; efibootguard is a boot manager for UEFI systems that can provide higher security and reliability than traditional GRUB, as well as more comprehensive functions, such as watchdog support, simple update mechanism and fault-tolerant algorithm, configuration support, environment tools and update configuration, etc., to meet the upgrade needs of various scenarios;
[0034] (4) After the upgrade is completed, the two kernel partitions store the latest upgraded file image and the file image of the previous version respectively, so that if the latest upgraded system has problems after running for a period of time, it can be rolled back to the latest normal version to ensure the safe operation of AGV. Attached Figure Description
[0035] Figure 1 This is a flowchart of the AGV upgrade method according to an embodiment of the present invention;
[0036] Figure 2 This is a detailed flowchart of the AGV upgrade method implemented in this invention;
[0037] Figure 3 This is a schematic diagram illustrating the configuration information of a copy of the configuration file before the upgrade, as shown in this embodiment of the invention.
[0038] Figure 4 This is a schematic diagram illustrating the configuration information of the configuration file copy during the upgrade file installation process according to an embodiment of the present invention.
[0039] Figure 5 This is a schematic diagram illustrating the configuration information of the configuration file copy during the restart verification process according to an embodiment of the present invention;
[0040] Figure 6 This is a schematic diagram of the configuration information of the configuration file copy after normal startup in an embodiment of the present invention;
[0041] Figure 7 This is a structural block diagram of the AGV upgrade system of the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this invention, and not all of them. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0043] See Figure 1 As shown, the present invention provides an AGV upgrade method, comprising the following steps:
[0044] S101, Obtain the upgrade file for the AGV to be installed;
[0045] S102, Perform integrity verification on the upgrade file;
[0046] S103, after the integrity verification is successful, obtain the configuration information of the first configuration file copy with a lower version number and the second configuration file copy with a higher version number, update the version number in the configuration information of the first configuration file copy to be higher than the version number of the second configuration file copy, and install the upgrade file into the kernel partition configured in the first configuration file copy.
[0047] S104. After the upgrade file is installed, perform a restart operation to verify the normal startup. If the verification is normal, proceed to S105; otherwise, proceed to S106.
[0048] S105, receive confirmation command, update configuration information of first configuration file copy, and run kernel partition configured in first configuration file copy;
[0049] S106, perform a reboot operation and run the kernel partition configured in the second configuration file copy.
[0050] In this embodiment, the AGV upgrade method of the present invention can be applied to the IPC system of AGV for updating and upgrading the AGV vehicle main control system or other systems.
[0051] Specifically, the following steps are required before the first upgrade of the main control system.
[0052] (1) Create a boot partition.
[0053] To use the part tool to create a 16MB partition to store the efibootguard bootloader, the specific commands are as follows:
[0054] part--source efibootguard-efi--fixed-size 16M--label efi--align1024--part-type=EF00--active--fsuuid0xXXXXXXXX--uuid XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
[0055] (2) Create two copies of the configuration file.
[0056] To use the part tool to create two 64MB partitions to store two copies of the configuration file efibootguard bootloader, the specific commands are as follows:
[0057] part--source efibootguard-boot--fixed-size 64M--label BOOT0--align1024--part-type=0700--sourceparams"revision=2"--fsuuid 0xXXXXXXXX--uuidXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX;
[0058] part--source efibootguard-boot--fixed-size 64M--label BOOT1--align1024--part-type=0700--sourceparams"revision=1"--fsuuid 0xXXXXXXXX--uuidXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
[0059] The configuration information fields for setting the configuration file copy storage are as follows:
[0060] a.in_progress: Determines if there are any ongoing update operations.
[0061] b.revision: Sets the version number of the active configuration file.
[0062] c.kernel: Location and name of the loaded kernel file
[0063] d.kernelargs: Specifies the boot parameters passed to the kernel.
[0064] e.watchdog timeout: The timeout period for the watchdog timer.
[0065] f.ustate: Represents the system's update status.
[0066] g.user variables: Other custom environment variables
[0067] (3) Create two system file partitions.
[0068] To use the part tool to create two 4GB system partitions, the specific commands are as follows:
[0069] part--source rawcopy--sourceparams"file=${IMAGE_FULLNAME}.squashfs"--align 1024--fixed-size4G--uuid"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
[0070] part--align 1024--fixed-size 4G--uuid"XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX"
[0071] (4) Create other external partitions.
[0072] Use the part tool to create additional external partitions, ensuring that these partitions are not overwritten by the upgrade files. The specific instructions are as follows:
[0073] part / home--source rootfs--rootfs-dir=${IMAGE_ROOTFS} / home--fstype=ext4--label home--align 1024--size 1G;
[0074] part / opt--source rootfs--rootfs-dir=${IMAGE_ROOTFS} / opt--fstype=ext4--label opt--align 1024--size2G;
[0075] part / var--source rootfs--rootfs-dir=${IMAGE_ROOTFS} / var--fstype=ext4--label var--align 1024--size2G;
[0076] (5) Function optimization: The kernel software update standard is used to allow the kernel to handle forwarding operations during the software update process.
[0077] (6) Develop an upgrade file installer, specifically using the Lua plugin for swupdate to extend the update functionality of swupdate, as detailed below:
[0078] Design a sophisticated polling update handler to poll for updates across multiple devices or partitions to ensure high system availability and fault tolerance. This is achieved by parsing the configuration, executing the polling algorithm, invoking a chain of processors, and updating the boot environment.
[0079] The program content is as follows.
[0080] a. Initialization and configuration loading:
[0081] - Check if the SWUpdate Lua module is loaded; load it if not.
[0082] - Define the polling configuration `rrconfig`.
[0083] - Define the device type enumeration `ROOT_DEVICE_TYPE`.
[0084] - Define the execution point enumeration `WHEN`.
[0085] - Define the log prefix `logprefix`.
[0086] b. Define the parsing and processing functions:
[0087] - Define the `image_device_parse` function to parse device fields.
[0088] - Define the `strip_dev_path` function to handle device paths.
[0089] - Define the `get_dev_path` function to find the complete path of the device.
[0090] - Define the `execute_prepost` function to execute pre / post-processing functions.
[0091] - Define the `load_config` function to load the configuration.
[0092] c. Define the processor modifier and selector algorithm:
[0093] - Define the `handler_fixups` table and related fixation functions.
[0094] - Define the `selector` table and related algorithms.
[0095] d. Define the callback function:
[0096] - Define the `selector.callbacks` table and related callback functions.
[0097] e. Define the polling handler:
[0098] Define the `handler_roundrobin` function as the main handler.
[0099] f. Registration Processing Procedure:
[0100] - Register a polling handler using `swupdate.register_handler`.
[0101] g. Define pre / post-processing functions:
[0102] - Define the `pp_mmclock` function to lock / unlock eMMC partitions.
[0103] h. Import other modules:
[0104] - Import the `handlers` module.
[0105] (7) Function optimization: use swupdate-progress to monitor updates.
[0106] (8) Optimization of the swupdate update mechanism, specifically including:
[0107] a. Added update status to track the status of some threads: ASYNC_THREAD_INIT (initialization), ASYNC_THREAD_RUNNING (running), and ASYNC_THREAD_DONE (complete);
[0108] b. In the `swupdate_async_thread` function, the call to the `swupdate_image_write` function now checks the return value. If the write fails, `swupdate_result` is set to `FAILURE` and the function jumps to the `out` label at the `return` position for cleanup.
[0109] c. In the sigpipe signal handling section, if the pthread_sigmask call fails, swupdate_result will now be set to FAILURE and the function will be redirected to the return position.
[0110] See Figure 2 As shown, further, when upgrading in the future, the following steps should be performed, and the following explanation takes the vehicle main control system upgrade as an example.
[0111] (1) Prepare the compiled AGV upgrade file (such as image-bullseye-ipc.swu) and upload it to the AGVIPC system.
[0112] (2) Perform upgrade file verification.
[0113] The file verification command for the upgrade is as follows:
[0114] swupdate-image-bullseye-ipc.swu--dry-run.
[0115] (3) After the upgrade file is successfully verified, the configuration information of the configuration file copy is updated, and the upgrade file information is updated in the kernel partition.
[0116] After the upgrade file verification is successful, you can start the upgrade with the following command.
[0117] swupdate-image-bullseye-ipc.swu.
[0118] After initiating the upgrade, execute the aforementioned upgrade file installation program. It should be noted that upgrade file verification instructions can also be integrated into the upgrade file installation program; this can be configured as needed, and this embodiment does not impose any restrictions.
[0119] Furthermore, before initiating the upgrade, the configuration information of the configuration file copy retrieved by running the configuration file copy information query command can be found in [link to relevant documentation]. Figure 3As shown, the first configuration file copy (#0) displays version number 16, the corresponding kernel partition name is B00T0, and the current update status is first status 0 (OK); the second configuration file copy (#1) displays version number 17, the corresponding kernel partition name is B00T1, and the current update status is first status 0 (OK); the vehicle main control system runs based on the second configuration file copy.
[0120] After initiating the upgrade but before restarting, the configuration information of the configuration file copy retrieved by running the configuration file copy information query command can be found in [link to configuration file copy information query command]. Figure 4 As shown, the first configuration file copy (#0) displays version number 18, the corresponding kernel partition name is B00T0, and the current update status is second status 1 (INSTALLED); the second configuration file copy (#1) displays version number 17, the corresponding kernel partition name is B00T1, and the current update status is first status 0 (OK).
[0121] (4) After the upgrade file is installed, perform a restart operation to restart the AGV main control system. During the restart process, verify whether the kernel, file system files, etc. can be loaded and started normally.
[0122] After restarting the system, the configuration information of the configuration file copy retrieved by running the configuration file copy information query command can be found in [link to relevant documentation]. Figure 5 As shown, the first configuration file copy (#0) displays version number 18, the corresponding kernel partition name is B00T0, and the current update status is third state 2 (TESTING); the second configuration file copy (#1) displays version number 17, the corresponding kernel partition name is B00T1, and the current update status is first state 0 (OK); the vehicle main control system runs based on the first configuration file copy in the TESTING state.
[0123] (5) If the reboot is normal, execute the confirmation command, update the configuration information of the first configuration file copy, and run the kernel partition configured by the first configuration file copy.
[0124] After a normal restart, the configuration information of the configuration file copy retrieved by running the configuration file copy information query command can be found in [link to relevant documentation]. Figure 6 As shown, the first configuration file copy (#0) displays version number 18, the corresponding kernel partition name is B00T0, and the current update status is first status 0 (OK); the second configuration file copy (#1) displays version number 17, the corresponding kernel partition name is B00T1, and the current update status is first status 0 (OK); the vehicle main control system runs based on the first configuration file copy.
[0125] (6) If a system crash or other issues occur during the restart process, the following operations will be performed:
[0126] Record on-site information: Kernel print statements; By recording on-site information, the cause and location of upgrade anomalies can be identified.
[0127] The system restarts and determines that the last upgrade was abnormal. It then restores to the normal copy (the previous normal startup version) and performs the startup boot, meaning the vehicle's main control system runs based on the second configuration file copy.
[0128] See Figure 7 As shown, the present invention also discloses an AGV upgrade system, comprising:
[0129] The upgrade file acquisition module 701 is used to acquire the upgrade file of the AGV to be installed;
[0130] Integrity verification module 702 is used to verify the integrity of the upgrade file;
[0131] The upgrade file writing module 703 is used to obtain the configuration information of the first configuration file copy with a lower version number and the second configuration file copy with a higher version number after the integrity verification is successful. It updates the version number in the configuration information of the first configuration file copy to a version number higher than that of the second configuration file copy, and installs the upgrade file into the kernel partition configured in the first configuration file copy.
[0132] The restart verification module 704 is used to perform a restart operation after the upgrade file is installed to verify normal startup. If the verification is normal, it enters the image confirmation module; otherwise, it enters the rollback module.
[0133] The image confirmation module 705 is used to receive confirmation commands, update the configuration information of the first configuration file copy, and run the kernel partition configured in the first configuration file copy.
[0134] The rollback confirmation module 706 is used to perform a reboot operation and run the kernel partition configured by the second configuration file copy.
[0135] The specific implementation of each module of an AGV upgrade system and the same AGV upgrade method will not be described again in this embodiment.
[0136] The above are merely specific embodiments of the present invention, but the design concept of the present invention is not limited thereto. Any non-substantial modifications made to the present invention using this concept shall be considered as infringing upon the protection scope of the present invention.
Claims
1. An AGV upgrade method, characterized in that, include: S101, Obtain the upgrade file for the AGV to be installed; S102, Perform integrity verification on the upgrade file; S103, after the integrity verification is successful, obtain the configuration information of the first configuration file copy with a lower version number and the second configuration file copy with a higher version number, update the version number in the configuration information of the first configuration file copy to be higher than the version number of the second configuration file copy, and install the upgrade file into the kernel partition configured in the first configuration file copy. S104. After the upgrade file is installed, perform a restart operation to verify the normal startup. If the verification is normal, proceed to S105; otherwise, proceed to S106. S105, receive confirmation command, update configuration information of first configuration file copy, and run kernel partition configured in first configuration file copy; S106, perform a reboot operation and run the kernel partition configured in the second configuration file copy.
2. The AGV upgrade method according to claim 1, characterized in that, Before installing the upgrade files, both the first and second configuration file copies are in the first state.
3. The AGV upgrade method according to claim 2, characterized in that, In S103, after the integrity verification is successful, the following steps are also included: updating the status in the configuration information of the first configuration file copy to the second status.
4. The AGV upgrade method according to claim 2, characterized in that, In S104, after performing the restart operation, the following is also included: updating the status in the configuration information of the first configuration file copy to the third status.
5. The AGV upgrade method according to claim 4, characterized in that, In S105, updating the configuration information of the first configuration file copy includes: receiving a configuration that updates the version number in the configuration information of the first configuration file copy to a version number higher than that of the second configuration file copy, and simultaneously updating the status in the configuration information of the first configuration file copy to a first status.
6. The AGV upgrade method according to claim 4, characterized in that, In S106, after performing the restart operation, it also includes: not accepting configurations that update the version number in the configuration information of the first configuration file copy to a higher version number than the version number of the second configuration file copy, and updating the status in the configuration information of the first configuration file copy to the first status.
7. The AGV upgrade method according to claim 1, characterized in that, The first and second configuration file copies are booted via the efibootguard bootloader.
8. The AGV upgrade method according to claim 1, characterized in that, In S103, the upgrade files are installed into the kernel partition configured in the first configuration file copy. Specifically, the Lua plugin program updated based on swupdate is run to install the upgrade files into the kernel partition configured in the first configuration file copy.
9. The AGV upgrade method according to claim 1, characterized in that, S106 includes recording site information before performing the restart operation.
10. An AGV upgrade system, characterized in that, include: The upgrade file acquisition module is used to acquire the upgrade files for the AGV to be installed; The integrity verification module is used to perform integrity verification on the upgrade files; The upgrade file writing module is used to obtain the configuration information of the first configuration file copy with a lower version number and the second configuration file copy with a higher version number after the integrity verification is successful. It updates the version number in the configuration information of the first configuration file copy to a version number higher than that of the second configuration file copy, and installs the upgrade file into the kernel partition configured in the first configuration file copy. The restart verification module is used to perform a restart operation after the upgrade file is installed to verify normal startup. If the verification is successful, the system will proceed to the image confirmation module; otherwise, it will proceed to the rollback module. The image confirmation module is used to receive confirmation commands, update the configuration information of the first configuration file copy, and run the kernel partition configured in the first configuration file copy. The rollback confirmation module is used to perform a reboot operation and run the kernel partition configured by the second configuration file copy.