A method, system and related apparatus for device updating

By mounting the underlying system to the target directory in the terminal POS device and generating a customized compressed package, the transmission problem caused by large OTA packages is solved, achieving efficient device updates and improving the user experience.

CN122489109APending Publication Date: 2026-07-31SHENZHEN XINGUODU TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN XINGUODU TECH
Filing Date
2025-01-22
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

In existing technologies, system customization updates for terminal POS devices require the generation of large OTA packages, resulting in long network transmission times, high bandwidth consumption, and negatively impacting user experience.

Method used

By modifying the device's underlying system mount to the target directory, adding copy commands to generate the target script, compiling the modified source code to generate an update resource package, using a system signing tool to generate a customized compressed package, and updating the device according to the target script when it starts up.

Benefits of technology

It effectively reduces the size of the update package, saves transmission time and bandwidth resources, reduces the risk of update failure, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122489109A_ABST
    Figure CN122489109A_ABST
Patent Text Reader

Abstract

This application discloses a method, system, and related apparatus for device updates, used to reduce the size of update packages. The method includes: modifying the device's system-level mounting to a target directory and adding a copy command pointing to the target directory to the system configuration file to obtain a target script; compiling the modified source code to generate an update resource package; storing the update resource package in a user folder and generating a customized compressed package based on the user folder and a system signing tool; copying the customized compressed package to the target directory based on the target script; and updating the device according to the customized compressed package when the device starts up.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of system update technology, and in particular to a method, system and related apparatus for equipment update. Background Technology

[0002] With the widespread application of POS terminals in numerous industries such as retail, catering, and finance, they have become one of the indispensable key devices in modern business transaction scenarios. For merchants, a customized system for a POS terminal can better adapt to the specific business processes of different merchants and directly affect the merchant's operational efficiency and user experience. Therefore, optimizing the customized system of a POS terminal is particularly important.

[0003] In existing technologies, the customization of terminal POS devices involves modifications at multiple levels. The process of generating OTA packages is particularly critical when customizing the system. Generating OTA packages typically requires large-scale modifications to the entire system. For example, to implement a merchant-customized function, adding a single line of code necessitates packaging all other components of the system into an OTA package for transmission.

[0004] However, when merchants need to update the system of their terminal POS devices multiple times, each update requires repackaging the entire system into an OTA (Over-The-Air) package, resulting in a very large update package size. During network transmission, large update packages consume significant time and bandwidth resources, easily leading to update failures or negatively impacting user experience due to lengthy update times. Summary of the Invention

[0005] To address the aforementioned technical problems, this application provides a method, system, and related apparatus for equipment updates.

[0006] The technical solution provided in this application is described below:

[0007] A first aspect of this application provides a method for updating a device, the method comprising:

[0008] Modify the device's system-level mount to the target directory, and add a copy command pointing to the target directory to the system configuration file to obtain the target script;

[0009] The modified source code is compiled to generate an updated resource package;

[0010] The updated resource package is stored in the user folder, and a customized compressed package is generated based on the user folder and the system signature tool;

[0011] Based on the target script, copy the customized compressed package to the target directory;

[0012] When the device starts up, it is updated according to the customized compressed package.

[0013] Optionally, compiling the modified source code to generate an updated resource package includes:

[0014] Based on the modified source code, determine the target resource file to be modified, and determine the target compilation method corresponding to the target resource file;

[0015] The target resource file is compiled according to the target compilation method to generate an updated resource package.

[0016] Optionally, storing the updated resource package in the user folder and generating a customized compressed package based on the user folder and the system signature tool includes:

[0017] Create a user folder containing a frame folder and a META-INF folder;

[0018] Store the updated resource package in the framework folder and the target script in the META-INF folder;

[0019] The user folder is compressed, and a custom compressed package is generated using the system signing tool.

[0020] Optionally, updating the device according to the customized compressed package when the device starts up includes:

[0021] When the device starts up, the customized compressed package is decompressed to obtain the updated resource package;

[0022] Replace the original system file with the same name using the updated resource package.

[0023] Optionally, after replacing the system file with the same name using the updated resource package, the method further includes:

[0024] Perform an integrity check on the system of the device and determine whether the check passes.

[0025] If so, then the device update is complete;

[0026] If not, the system will be rolled back to its state before the update, and an update error message will be generated.

[0027] Optionally, copying the customized compressed package to the target directory based on the target script includes:

[0028] The target script is executed by applying OTA upgrade or Adb Sideload upgrade to copy the customized compressed package to the target directory.

[0029] Optionally, the target directory has anti-erasing properties.

[0030] A second aspect of this application provides a system for device updating, the system comprising:

[0031] An additional unit is added to modify the device's underlying system mount to the target directory and add a copy command pointing to the target directory to the system configuration file to obtain the target script;

[0032] The compilation unit is used to compile the modified source code and generate an updated resource package;

[0033] The generation unit is used to store the updated resource package to the user folder and generate a customized compressed package based on the user folder and the system signature tool;

[0034] A copy unit is used to copy the customized compressed package to the target directory based on the target script;

[0035] An update unit is used to update the device according to the customized compressed package when the device is started.

[0036] Optionally, the compilation unit is specifically used for:

[0037] Based on the modified source code, determine the target resource file to be modified, and determine the target compilation method corresponding to the target resource file;

[0038] The target resource file is compiled according to the target compilation method to generate an updated resource package.

[0039] Optionally, the generation unit is specifically used for:

[0040] Create a user folder containing a frame folder and a META-INF folder;

[0041] Store the updated resource package in the framework folder and the target script in the META-INF folder;

[0042] The user folder is compressed, and a custom compressed package is generated using the system signing tool.

[0043] Optionally, the update unit is specifically used for:

[0044] When the device starts up, the customized compressed package is decompressed to obtain the updated resource package;

[0045] Replace the original system file with the same name using the updated resource package.

[0046] Optionally, a judgment unit may also be included, specifically used for:

[0047] Perform an integrity check on the system of the device and determine whether the check passes.

[0048] If so, then the device update is complete;

[0049] If not, the system will be rolled back to its state before the update, and an update error message will be generated.

[0050] Optionally, the copying unit is specifically used for:

[0051] The target script is executed by applying OTA upgrade or Adb Sideload upgrade to copy the customized compressed package to the target directory.

[0052] Optionally, the target directory has anti-erasing properties.

[0053] A third aspect of this application provides an apparatus for updating equipment, the apparatus comprising:

[0054] Processor, memory, input / output units, and bus;

[0055] The processor is connected to the memory, the input / output unit, and the bus;

[0056] The memory stores a program, which the processor invokes to execute any of the methods described.

[0057] A fourth aspect of this application provides a computer-readable storage medium on which a program is stored, which, when executed on a computer, performs the methods of the first aspect and any one of the first aspects.

[0058] As can be seen from the above technical solutions, this application has the following advantages:

[0059] This application comprehensively optimizes device updates from multiple aspects, including modifying the system's underlying mount point and generating the target script, effectively solving the problem of large update package size and thus improving system update efficiency and user experience. First, the system's underlying mount point is modified to the target directory, and a copy command is added to the system configuration file to obtain the target script. Then, the source code is modified and compiled to obtain the update resource package. The resulting update resource package only contains the modified source code, effectively reducing the size of the resource update package and avoiding the significant time and bandwidth consumption during transmission of large resource update packages. After obtaining the update resource package, it is stored in the user folder, and a custom compressed package is generated using a system signing tool to ensure its security. Subsequently, the custom compressed package is copied to the target directory according to the copy command in the target script. After copying, the device is started, and the device update is completed based on the custom compressed package. Since the custom compressed package contains only the update resource package with the modified source code, the entire system does not need to be updated during the device update process, further reducing update time and bandwidth consumption, lowering the risk of update failure, and improving user experience. Attached Figure Description

[0060] To more clearly illustrate the technical solutions in this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0061] Figure 1 A schematic flowchart of an embodiment of the device update method provided in this application;

[0062] Figure 2 A schematic flowchart of an embodiment of the process of requesting an updated resource pack in the device update method provided in this application;

[0063] Figure 3 A schematic flowchart of an embodiment of the process for generating a customized compressed package in the device update method provided in this application;

[0064] Figure 4 A schematic flowchart of another embodiment of the device update method provided in this application;

[0065] Figure 5 A schematic diagram of an embodiment of the device update system provided in this application;

[0066] Figure 6 A schematic diagram of an embodiment of the device update apparatus provided in this application. Detailed Implementation

[0067] This application provides a method for device updates that reduces the size of the update package. It should be noted that the method provided in this application can be applied to POS devices, smartphones, computers, tablets, smart TVs, smartwatches, portable computer devices, and fixed devices such as desktop computers.

[0068] Please see Figure 1 This application first provides an embodiment of a device update method, which includes:

[0069] S101. Modify the device's system-level mount to the target directory, and add a copy command pointing to the target directory to the system configuration file to obtain the target script;

[0070] In this embodiment, modifying the device's underlying system mount requires making changes in the device's underlying system settings. The original mount point is adjusted to the target directory. For example, in the configuration script at the system's underlying level, the copy command controlling the mount point is found, and the copy command controlling the mount point is modified to point to the target directory.

[0071] When modifying the system's underlying mount to the target directory, a copy command can be added to the system configuration file to obtain the target script. For example, open the init.rc file with a text editor and add the copy command "cp -r [source path][target path]" to the init.rc file during the mount operation. This enables the system to perform the copy operation at startup. By adding the copy command to the system configuration file to obtain the target script, the system can automatically complete the necessary file copy operations during startup without manual intervention, thereby improving the automation and efficiency of device updates.

[0072] S102. Compile the modified source code to generate an updated resource package;

[0073] In this embodiment, the user's actual needs are first obtained, and the source code is modified based on these needs. After the source code modification is completed, a compilation command is used to compile the modified source code. Modifying and compiling the source code based on user needs allows for targeted compilation, significantly shortening compilation time and reducing complexity compared to compiling the entire system's source code, thus improving development and update efficiency. During the compilation process, by executing the compilation command, the system performs syntax checks, code optimization, and other operations on the modified source code. Once compilation is complete, an update resource package is generated. The generated update resource package is smaller than the update resource package generated after compiling the entire source code, saving time and bandwidth for subsequent transmission and updates.

[0074] S103. Store the updated resource package in the user folder and generate a customized compressed package based on the user folder and the system signature tool;

[0075] In this embodiment, after generating the update resource package, the compiled update resource package is stored in the user folder via file copy or move commands. After storage, a customized compressed package is generated based on the user folder containing the update resource package and the system signing tool. First, the user folder is packaged into a compressed package using a compression tool. The generated compressed package contains all the update resources and related file structures. Then, the system signing tool signs the compressed package to ensure the trustworthiness of its source and the integrity of its content. During the signing process, the system signing tool encrypts and authenticates the compressed package, generating a customized compressed package with signature information.

[0076] The updated resource package is stored in the user folder and a compressed file is generated, which enables unified management and transmission of updated resources. After storage, the compressed file is signed by the system signing tool to generate a customized compressed file, which ensures the security and reliability of the customized compressed file and prevents it from being tampered with or maliciously attacked during subsequent transmission and updates. In addition, the customized compressed file only contains the necessary updated resources and related scripts, and its small size further saves traffic and transmission time and reduces unnecessary resource consumption.

[0077] S104. Copy the customized compressed package to the target directory based on the target script;

[0078] In this embodiment, the copy instructions already added to the target script are first read. Based on the path pointed to in the copy instructions, the corresponding file copying program of the system is started. The customized compressed package is copied to the target directory through the target script, avoiding errors and omissions that may occur during manual copying, improving the reliability and stability of device updates. Furthermore, the target directory to which the customized compressed package is copied has anti-erasing properties, ensuring the security of device customization.

[0079] During the copying process, strict verification and monitoring will be performed to ensure that no data loss or corruption occurs in the customized compressed package. If an error is encountered during the copying process, the terminal will record the error information in a timely manner and attempt to repair it without damaging the customized compressed package.

[0080] S105. When the device starts up, update the device according to the customized compressed package.

[0081] In this embodiment, when the device starts up, the system detects a customized compressed package located in the target directory. First, the initialization process accesses the target directory, locates the customized compressed package, and, according to the target script, replaces the files in the specified path with the update resource package from the customized compressed package to update the device.

[0082] During the update process, the system will verify and check the files in the specified path to ensure that the new files can correctly overwrite the old files and will not affect the critical components and functions of the system.

[0083] This embodiment comprehensively optimizes device updates from multiple aspects, including modifying the system's underlying mount point and generating the target script, effectively solving the problem of large update package size and thus improving system update efficiency and user experience. First, the system's underlying mount point is modified to the target directory, and a copy command is added to the system configuration file to obtain the target script. Then, the source code is modified and compiled to obtain the update resource package. The resulting update resource package only contains the modified source code, effectively reducing the size of the resource update package and avoiding the significant time and bandwidth consumption during transmission of large resource update packages. After obtaining the update resource package, it is stored in the user folder, and a custom compressed package is generated using a system signature to ensure its security. Subsequently, the custom compressed package is copied to the target directory according to the copy command in the target script. After copying, the device is started, and the device update is completed based on the custom compressed package. Since the custom compressed package contains only the update resource package with the modified source code, the entire system does not need to be updated during the device update process, further reducing update time and bandwidth consumption, lowering the risk of update failure, and improving user experience.

[0084] In step S102 above, during the compilation of the modified source code to generate the updated resource package, it is necessary to determine the target resource file and the corresponding target compilation method. Please refer to [link / reference needed]. Figure 2 , Figure 2 One embodiment of the method for updating a device provided in this application is to request an updated resource package, the embodiment including:

[0085] S201. Determine the target resource file to be modified based on the modified source code, and determine the target compilation method corresponding to the target resource file;

[0086] After obtaining the modified source code, a detailed analysis and comparison are first conducted to identify the parts that have been modified compared to the original source code. Then, based on the location and content of the modifications, the target resource file to be modified is determined. For example, if the code related to ActivityManagerService is modified, then the corresponding target resource file is the source file related to ActivityManagerService.

[0087] After identifying the target resource file, the target compilation method is determined based on factors such as the file type, the system module it belongs to, and system requirements. For example, Java source files require compilation using a Java compiler. By identifying the target resource file to be modified and its corresponding target compilation method, the process of fully compiling the entire system source code is avoided, compiling time is shortened, compilation efficiency is improved, and targeted compilation can select the most suitable compilation method based on the characteristics of different target resource files, optimizing the compilation results.

[0088] S202. Compile the target resource files according to the target compilation method to generate an updated resource package.

[0089] In this embodiment, after determining the corresponding target compilation method, the target resource file is compiled according to the target compilation method. For example, if the target compilation method is to use a Java compiler to compile Java source files, then the corresponding compilation command can be entered in the integrated development environment, specifying the path of the Java source files and the directory of the compilation output, and the compilation process can be started.

[0090] Specifically, during the compilation process, the compiler performs syntax checking, lexical analysis, and semantic analysis on the target resource files. It then converts the target resource files into executable bytecode or machine code to generate resource files. Finally, the generated resource files are packaged according to directory structure and rules to generate an updated resource package. The updated resource package contains all compiled target resource files, related dependency files, and configuration information.

[0091] This embodiment avoids the process of fully compiling the entire system source code by identifying the target resource file to be modified and its corresponding target compilation method, thus shortening compilation time, improving compilation efficiency, and selecting the most suitable compilation method based on the characteristics of different target resource files, thereby optimizing the compilation results. Compiling according to the target compilation method ensures the quality and compatibility of the generated updated resource package. Subsequently, compiling the target resource file according to the corresponding target compilation method can promptly detect and correct errors and problems in the code, improving the stability of the updated resource package.

[0092] In step S103 above, during the process of storing the update resource package to the user folder and generating a customized compressed package based on the user folder and the system signing tool, it is necessary to create a user folder containing a framework folder and a META-INF folder, and store the update resource package and target script in the framework folder and META-INF folder respectively. Please refer to [link to relevant documentation]. Figure 3 , Figure 3 One embodiment of the method for generating a customized compressed package in the device update provided in this application includes:

[0093] S301. Create a user folder containing a frame folder and a META-INF folder;

[0094] User folders should have appropriate read and write permissions. User folders can be created through a file management interface or command-line tools. For example, on Linux-based devices, the "mkdir" command can be used to create user folders. During creation, a directory structure containing a framework folder and a META-INF folder needs to be created simultaneously. The framework folder is used to store update resource packages, enabling centralized management and facilitating subsequent retrieval and use. The META-INF folder is used to store target scripts. Separating target scripts from resource packages improves the maintainability and scalability of the folder.

[0095] S302. Store the updated resource package in the framework folder and the target script in the META-INF folder;

[0096] After creating the user folder containing the framework folder and the META-INF folder, you need to store the updated resource package in the framework folder and the target script in the META-INF folder. This can be done by copying or moving the files. During the storage process, you need to check and set the file integrity and permissions in real time to ensure that the files are stored correctly and can be used later.

[0097] By storing updated resource packages and target scripts in designated folders, file classification management is achieved, improving file access efficiency.

[0098] S303. Compress the user folder and use the system signing tool to generate a custom compressed package.

[0099] After storing the update resource package and target script in their respective folders, compression can be achieved using compression commands or tools, such as the Linux command "tar -czvf [compressed file name.tar.gz] [list of files or directories to be compressed]".

[0100] After compression, use the system signing tool to sign the compressed file. The system signing tool encrypts and authenticates the compressed file, generating a customized compressed file with signature information. During the signing process, it is necessary to ensure the integrity of the compressed file's content to prevent update failures due to compression omissions.

[0101] Compressing user folders reduces file size, facilitating transmission and storage. After compression, a custom compressed package is generated using the system's signing tool, providing security for the package. The signature information allows devices to verify the authenticity and integrity of the custom compressed package upon receipt, enhancing device security and reliability.

[0102] The following is a detailed description of the update process of a device update method provided in this application. Please refer to [link / reference]. Figure 4 , Figure 4 Another embodiment of a device update method provided in this application includes:

[0103] S401. Modify the device's system-level mount to the target directory, and add a copy command pointing to the target directory to the system configuration file to obtain the target script;

[0104] S402. Compile the modified source code to generate an updated resource package;

[0105] S403. Store the updated resource package in the user folder and generate a customized compressed package based on the user folder and the system signature tool;

[0106] In this embodiment, steps S401 to S403 are similar to steps S101 to S103 in the previous embodiment, and will not be described again here.

[0107] S404. Copy the customized compressed package to the target directory based on the target script;

[0108] In some specific embodiments, after obtaining the customized compressed package and the target script, the execution of the target script can be triggered by applying OTA upgrade or Adb Sideload upgrade to copy the customized compressed package to the target directory.

[0109] If you choose to use the OTA (Over-The-Air) upgrade method, you first need to connect the device to the terminal. The terminal will detect the availability of a customized compressed package and send update information to the device. After receiving the update information pushed by the server, the device will prompt the user to confirm the update. Once the user confirms the update, the device will automatically download the customized compressed package to a local temporary storage address. After the download is complete, the target script will be executed. The target script will copy the customized compressed package from the local temporary storage address to the target directory according to the copy command and the copy path. The OTA upgrade method eliminates the need for complex operations by the user; simply connecting to the network is sufficient for automatic detection and download of updates, improving the user experience and the convenience of device updates.

[0110] If you choose the Adb Sideload upgrade method, you first need to connect the device to the terminal via USB cable, open the corresponding command-line tool on the terminal, and then enter the Adb Sideload upgrade command in the command line, specifying the path to the customized compressed package. After receiving the command, the device will start Adb Sideload mode, trigger the execution of the target script, and copy the customized compressed package from the terminal to the target directory on the device. The Adb Sideload upgrade method is more convenient for debugging and testing, and can quickly push the customized compressed package to the device for updates locally.

[0111] S405. When the device starts up, the customized compressed package is decompressed to obtain the updated resource package;

[0112] When the device starts up, it first automatically scans the target directory. Upon finding a customized compressed package, it determines the decompression method based on the package's file format. For example, if the package is in tar.gz format, it can be decompressed using a decompression tool or command. After decompression, it performs an integrity check on the resulting update package, comparing file count, file size, and file hash values ​​to ensure the update package's content matches expectations.

[0113] Specifically, the target directory can be set to a directory with anti-erasure properties. By modifying the system's underlying mount to a target directory with anti-erasure properties, important data and files in the target directory can be prevented from being deleted when the device is restored to factory settings or other operations that may erase data.

[0114] S406. Replace the original system file with the same name using the updated resource package;

[0115] After obtaining the decompressed update resource package, first iterate through all files and directories within the package, then obtain the filename of the update resource package and search for a system file with the same name in the original system file directory. During the search process, a search algorithm can be used to improve search efficiency.

[0116] Once a file with the same name is found, back up the original system file to a permanently saved backup directory. During the backup process, all contents, attributes, and permissions of the original system file will be preserved. Then, replace the original system file with the file from the update package. When replacing the file, strictly adhere to the permissions and attributes set in the update package to ensure the update package runs correctly on the system. Also, update the relevant file indexes and system configuration information to reflect the replacement status of the update package.

[0117] By replacing the original system file with the same name using an update resource package, system files can be updated and upgraded, enabling the device to obtain all the updated functions and improving the user experience.

[0118] S407. Perform an integrity check on the equipment system and determine whether the check passes.

[0119] Once the replacement is complete, an integrity verification process is initiated. First, a comprehensive check is performed on the system's critical components, file directory structure, and important files. For example, the hash value of each file can be calculated and compared with a pre-stored correct hash value to ensure the integrity and accuracy of the file content; file permission settings can be checked to prevent system malfunctions due to permission issues; the system directory structure can be checked to verify the existence of each directory and the integrity of files and subdirectories within each directory; and critical system configuration files can be checked to ensure they have been correctly modified and updated, and related system services can start and run normally.

[0120] After completing all the checks, the system will make a judgment based on the combined results. If all checks meet the requirements, the check is deemed successful and step 408 is executed; if any one or more checks fail, the check is deemed unsuccessful and step 409 is executed.

[0121] By conducting a comprehensive and meticulous integrity check on the system, problems that may arise during the system update process can be identified in a timely manner. This can prevent system failures, performance degradation, and security vulnerabilities caused by incomplete or incorrect updates, ensuring that the system maintains a stable and reliable operating state after the update.

[0122] S408. Confirm that the equipment update is complete;

[0123] When the integrity verification passes, the system updates the device's version information in its internal system status log, marking it with the latest version number for subsequent system management and retrieval. The system log also records detailed information about the update, including the update time, content, and verification result. This recorded information serves as an important reference for system maintenance and troubleshooting. After recording, resources are released, and the device update is complete.

[0124] This embodiment can clearly identify the completion status of device updates and keep track of the update progress in a timely manner.

[0125] S409. Roll back to the system state before the update and generate an update error message.

[0126] When the integrity check fails, the system immediately initiates a rollback mechanism to restore the system to its state before the update. First, based on the original system files backed up during step 406 when replacing the original system file with the same name, all replaced files and directories are restored to their pre-update state, ensuring that the system's files and configurations are completely consistent with those before the update. During the restoration process, the permissions, attributes, and directory structure of the backed-up original system files are strictly followed.

[0127] After the rollback operation is completed, a detailed update error message is generated, including the specific reason for the verification failure, the problematic file, and the operation steps.

[0128] Rolling back to the system state before the update when integrity verification fails minimizes the impact of update failure on devices and users, ensuring that devices can still operate normally when update problems occur, thus protecting user data and system stability. After the rollback is complete, detailed update error messages are generated, helping to quickly understand the cause of the update failure and facilitating problem localization and resolution.

[0129] The following provides a detailed description of the equipment update system provided in this application. Please refer to [link / reference]. Figure 5 , Figure 5 Another embodiment of the device update system provided in this application, the system comprising:

[0130] Add unit 501 to modify the device's system underlying mount to the target directory, and add a copy command pointing to the target directory to the system configuration file to obtain the target script;

[0131] Compilation unit 502 is used to compile the modified source code and generate an updated resource package;

[0132] The generation unit 503 is used to store the updated resource package to the user folder and generate a customized compressed package based on the user folder and the system signature tool;

[0133] Copy unit 504 is used to copy a customized compressed package to a target directory based on the target script;

[0134] Update unit 505 is used to update the device according to a customized compressed package when the device starts up.

[0135] Optionally, compilation unit 502 is specifically used for:

[0136] Based on the modified source code, determine the target resource file that was modified, and determine the target compilation method corresponding to the target resource file;

[0137] The target resource files are compiled according to the target compilation method to generate an updated resource package.

[0138] Optionally, the generating unit 503 is specifically used for:

[0139] Create a user folder containing a frame folder and a META-INF folder;

[0140] Store the updated resource package in the framework folder and the target script in the META-INF folder;

[0141] Compress the user folder and use the system signing tool to generate a custom compressed package.

[0142] Optionally, update unit 505 is specifically used for:

[0143] When the device starts up, the customized compressed package is decompressed to obtain the updated resource package;

[0144] Replace the original system file with the same name using the updated resource package.

[0145] Optionally, a judgment unit 506 is also included, specifically used for:

[0146] Perform an integrity check on the device's system and determine whether the check passes.

[0147] If so, then confirm that the device update is complete;

[0148] If not, the system will be rolled back to its state before the update, and an update error message will be generated.

[0149] Optionally, copy unit 504 is specifically used for:

[0150] The target script is executed by applying OTA upgrade or Adb Sideload upgrade to copy the customized compressed package to the target directory.

[0151] Optionally, the target directory has an anti-erasure attribute.

[0152] This application also provides an apparatus for device updating; please refer to [link to relevant documentation]. Figure 6 , Figure 6 One embodiment of the device updating apparatus provided in this application includes:

[0153] Processor 601, memory 602, input / output unit 603, bus 604;

[0154] The processor 601 is connected to the memory 602, the input / output unit 603, and the bus 604;

[0155] The memory 602 stores a program, and the processor 601 calls the program to execute any of the methods described above.

[0156] This application also relates to a computer-readable storage medium on which a program is stored, characterized in that, when the program is run on a computer, it causes the computer to perform any of the methods described above.

[0157] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0158] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection between apparatuses or units through some interfaces, and may be electrical, mechanical, or other forms.

[0159] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0160] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0161] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

Claims

1. A method for equipment renewal, characterized in that, The method includes: Modify the device's system-level mount to the target directory, and add a copy command pointing to the target directory to the system configuration file to obtain the target script; The modified source code is compiled to generate an updated resource package; The updated resource package is stored in the user folder, and a customized compressed package is generated based on the user folder and the system signature tool; Based on the target script, copy the customized compressed package to the target directory; When the device starts up, it is updated according to the customized compressed package.

2. The method according to claim 1, characterized in that, The process of compiling the modified source code to generate an updated resource package includes: Based on the modified source code, determine the target resource file to be modified, and determine the target compilation method corresponding to the target resource file; The target resource file is compiled according to the target compilation method to generate an updated resource package.

3. The method according to claim 1, characterized in that, The step of storing the updated resource package in the user folder and generating a customized compressed package based on the user folder and the system signature tool includes: Create a user folder containing a frame folder and a META-INF folder; Store the updated resource package in the framework folder and the target script in the META-INF folder; The user folder is compressed, and a custom compressed package is generated using the system signing tool.

4. The method according to claim 1, characterized in that, The step of updating the device according to the customized compressed package when the device starts up includes: When the device starts up, the customized compressed package is decompressed to obtain the updated resource package; Replace the original system file with the same name using the updated resource package.

5. The method according to claim 4, characterized in that, After replacing the system file with the same name using the updated resource package, the method further includes: Perform an integrity check on the system of the device and determine whether the check passes. If so, then the device update is complete; If not, the system will be rolled back to its state before the update, and an update error message will be generated.

6. The method according to claim 1, characterized in that, The step of copying the customized compressed package to the target directory based on the target script includes: The target script is executed by applying OTA upgrade or Adb Sideload upgrade to copy the customized compressed package to the target directory.

7. The method according to any one of claims 1 to 6, characterized in that, The target directory has anti-erasing properties.

8. A system for updating equipment, characterized in that, include: An additional unit is added to modify the device's underlying system mount to the target directory and add a copy command pointing to the target directory to the system configuration file to obtain the target script; The compilation unit is used to compile the modified source code and generate an updated resource package; The generation unit is used to store the updated resource package to the user folder and generate a customized compressed package based on the user folder and the system signature tool; A copy unit is used to copy the customized compressed package to the target directory based on the target script; An update unit is used to update the device according to the customized compressed package when the device is started.

9. An apparatus for updating equipment, characterized in that, The device includes: Processor, memory, input / output units, and bus; The processor is connected to the memory, the input / output unit, and the bus; The memory stores a program, which the processor invokes to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a program stored thereon, the program performing the method as claimed in any one of claims 1 to 7 when executed on a computer.