An operating system debugging method and a terminal
By generating and uploading the target PKG file to the server, OTA upgrade and rollback packages are automatically generated, solving the problem of low debugging efficiency in user versions. This enables non-developers to complete debugging independently, reducing labor costs and compilation time.
Patent Information
- Application Number
- CN202311711502.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-12-13
AI Technical Summary
Existing technologies cannot be directly debugged in the user version of Android smart products, resulting in low debugging efficiency. It is necessary to modify the source code and compile the relevant image, which increases manpower and compilation time.
By obtaining the target debug file and the general PKG file, the target PKG file of the corresponding version is generated and uploaded to the server for compilation, automatically generating OTA upgrade packages and OTA rollback packages, simplifying the debugging process.
OTA upgrade and rollback packages can be generated without modifying the source code, shortening compilation time, reducing labor costs, and enabling non-developers to complete debugging independently.
Smart Images

Figure CN117724964B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent product debugging technology, and in particular to an operating system debugging method and terminal. Background Technology
[0002] When debugging Android (Android operating system) smart products, a debug version is typically used. This involves rooting the terminal, disabling dm-verity, and mounting the terminal as read-write, then debugging the terminal (i.e., the Android smart product). This debugging method is feasible for terminals under development. However, for security reasons, production terminals use a user version. In a user version, it's impossible to root the terminal or disable dm-verity, and the terminal is read-only. Therefore, it's not possible to directly debug a production terminal.
[0003] If a system problem occurs in the official terminal, it is necessary to locate the problem (e.g., add more logs), such as Figure 1 As shown, current troubleshooting methods typically require compiling a debug OTA (Over-the-Air) upgrade package and an OTA rollback package based on the current terminal version. The debug OTA upgrade package is then used to upgrade the terminal. After the upgrade, the terminal is debugged and the problem is located. Once debugging is complete, a matching OTA rollback package needs to be installed to revert to the state before debugging. This technique requires modifying the source code and compiling the relevant source code to generate a new OTA base package, which in turn generates the corresponding debug OTA upgrade and rollback packages.
[0004] This debugging method has the following problems: After modifying the source code on the terminal, the relevant image source code needs to be compiled to generate a new OTA base package. This process recompiles other code unrelated to the current debugging, resulting in long compilation times and low debugging efficiency. For the terminal, only the underlying developers have the authority to modify the source code and add debugging information. Therefore, during debugging, customer service personnel need to be on-site to capture terminal log information, and developers need to be asked to generate corresponding OTA upgrade and rollback packages for the on-site terminal version, increasing the manpower required for debugging. Summary of the Invention
[0005] The technical problem to be solved by the present invention is to provide an operating system debugging method and terminal, which debugs the official terminal based on the user version, and allows non-developers to independently complete the debugging work, thereby reducing labor costs and improving debugging efficiency.
[0006] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0007] An operating system debugging method, comprising:
[0008] Obtain the target debug file and the generic PKG file;
[0009] Package the target debug file to generate a target PKG file of the corresponding version;
[0010] Obtain the operating system version information of the client terminal, and search for the first preset OTA basic package in the server based on the version information;
[0011] Upload the general PKG file and the target PKG file to the server;
[0012] The target PKG file is compiled by the server to generate a second OTA base package;
[0013] The server differentially generates OTA upgrade and OTA rollback packages from the first OTA base package and the second OTA base package.
[0014] The operating system was debugged using the general PKG file, OTA upgrade package, and OTA rollback package.
[0015] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows:
[0016] An operating system debugging terminal includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the various steps of the aforementioned operating system debugging method.
[0017] The beneficial effects of this invention are as follows: By acquiring the target debug file and the general PKG file, and packaging the target debug file to generate the corresponding target PKG file, subsequent debugging of the client terminal's operating system can be achieved simply by uploading the target PKG file to the server for compilation, generating the corresponding OTA base package. This process eliminates the need to compile other code unrelated to debugging, thus shortening compilation time. Simultaneously, uploading the general PKG file used during debugging to the server solves the problems of client terminals being unable to be rooted or have dm-verity disabled in user versions, and the terminal being read-only. This allows non-developers to directly use the corresponding general PKG file to complete debugging tasks. Furthermore, this invention automatically generates corresponding OTA upgrade and OTA rollback packages after uploading the PKG file to the server for compilation, eliminating the need for developers to compile and generate packages. This simplifies debugging, allowing non-developers to independently complete debugging work, reducing labor costs and improving debugging efficiency. Attached Figure Description
[0018] Figure 1A flowchart of the terminal debugging method for related technologies;
[0019] Figure 2 A flowchart illustrating the steps of an operating system debugging method provided in an embodiment of the present invention;
[0020] Figure 3 An interactive schematic diagram of an operating system debugging method provided in an embodiment of the present invention;
[0021] Figure 4 This is a schematic diagram of the structure of an operating system debugging terminal provided in an embodiment of the present invention;
[0022] Label Explanation:
[0023] 200. An operating system debugging terminal; 201. A memory; 202. A processor. Detailed Implementation
[0024] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.
[0025] Please refer to Figure 2 This invention provides an operating system debugging method, including:
[0026] Obtain the target debug file and the generic PKG file;
[0027] Package the target debug file to generate a target PKG file of the corresponding version;
[0028] Obtain the operating system version information of the client terminal, and search for the first preset OTA basic package in the server based on the version information;
[0029] Upload the general PKG file and the target PKG file to the server;
[0030] The target PKG file is compiled by the server to generate a second OTA base package;
[0031] The server differentially generates OTA upgrade and OTA rollback packages from the first OTA base package and the second OTA base package.
[0032] The operating system was debugged using the general PKG file, OTA upgrade package, and OTA rollback package.
[0033] As described above, the beneficial effects of this invention are as follows: By acquiring the target debug file and the general PKG file, and packaging the target debug file to generate the corresponding target PKG file, subsequent debugging of the client terminal's operating system can be achieved simply by uploading the target PKG file to the server for compilation, thereby generating the corresponding OTA base package. This process eliminates the need to compile other code unrelated to debugging, shortening compilation time. Simultaneously, uploading the general PKG file used during debugging to the server solves the problems of client terminals being unable to be rooted or have dm-verity disabled in user versions, and the terminal being read-only. This facilitates non-developers directly using the corresponding general PKG file to complete debugging tasks. Furthermore, this invention automatically generates corresponding OTA upgrade and OTA rollback packages after uploading the PKG file to the server for compilation, eliminating the need for developers to compile and generate packages, simplifying debugging. Non-developers can also independently complete debugging work, reducing labor costs and improving debugging efficiency. The PKG file is a software maintenance format.
[0034] Furthermore, obtaining the target debug file and the general PKG file includes:
[0035] Obtain the target debugging module, compile the target debugging module, and generate the target debugging file;
[0036] Obtain the debug bridge instructions and debugger, and package the debug bridge instructions and debugger into a generic PKG file.
[0037] As described above, compiling the corresponding target debug files for the target debug module facilitates subsequent server installation and execution of these files. Furthermore, the unified packaging and management of the target debug files within the debug module prevents operational errors that could lead to unintended functional integration issues. Since some high-security client terminals may have trimmed debug bridge instructions and debuggers, the complete debug bridge instructions and debuggers need to be uploaded to the server together for easier debugging. By packaging the debug bridge instructions and debuggers into a generic PKG file, non-developers can directly use these instructions and programs without compilation, simplifying the code management process.
[0038] Furthermore, the step of packaging the target debug file to generate the corresponding version of the target PKG file includes:
[0039] Generate a corresponding description information file based on the functional category of the target debugging module;
[0040] The target debug file is packaged according to the description information file to generate a target PKG file of the corresponding version.
[0041] As described above, by specifying the version of the target PKG file in the description information file, the target debugging modules under different debugging scenarios can be packaged to generate the corresponding target PKG file. During subsequent debugging, non-developers only need to select the target PKG file of the corresponding version according to the debugging requirements and upload it to the server to complete the debugging work, which simplifies the debugging difficulty, avoids the intervention of developers, and reduces the consumption of human resources.
[0042] Furthermore, the step of compiling the target PKG file through the server to generate the second OTA base package includes:
[0043] The target PKG file is decompressed by the server to obtain the installation information of the target debug file;
[0044] The target debug file is compiled using the server to generate a target image that matches the installation information;
[0045] A second OTA base package is generated based on the target image and the first OTA base package.
[0046] As described above, compared to existing technologies that require compiling and generating an image corresponding to the entire source code after modifying the source code, this invention only requires decompressing the target PKG file to the relevant directory to obtain the installation information, and then generating a target image related to the installation information. There is no need to compile other code besides the installation information, thus avoiding invalid compilation, shortening compilation time, and improving compilation efficiency.
[0047] Furthermore, it also includes:
[0048] The server randomly generates a maintenance status file, which is then integrated into the second OTA base package. The maintenance status file includes a UUID identifier.
[0049] As described above, by integrating the maintenance status file into the second OTA base package, when the operating system is debugged via OTA upgrade packages and OTA rollback packages, the client terminal will display a corresponding debugging watermark, reminding the debugging personnel that the client terminal is currently in maintenance mode. This effectively prevents the debugging personnel from forgetting to roll back to the state before debugging, thus avoiding security risks to the client terminal.
[0050] Furthermore, the step of debugging the operating system based on the general PKG file, OTA upgrade package, and OTA rollback package includes:
[0051] Obtain the URL address generated by the server;
[0052] Download the OTA upgrade package and OTA rollback package according to the URL address;
[0053] After the server decompresses the generic PKG file, a generic image is generated.
[0054] The OTA upgrade package triggers the operating system to upgrade, thereby controlling the client terminal to enter the debugging state;
[0055] The operating system is debugged based on the general image;
[0056] The OTA rollback packet triggers the operating system to roll back, thereby controlling the client terminal to exit the debugging state.
[0057] As described above, for client terminals with higher security, a universal PKG file needs to be uploaded to the server to install the fully functional debugging bridge instructions and debugging program, facilitating subsequent operating system debugging. When debugging is required, the operating system is first upgraded via an OTA update package to enter the client terminal's debugging state; then, an OTA rollback package is used to revert the operating system to the version before debugging. For abnormal issues encountered by the client terminal during user operation, the debugging method of this invention can effectively help non-developers perform on-site debugging of the client terminal, improving debugging efficiency.
[0058] Furthermore, the universal image includes a fallback application;
[0059] Also includes:
[0060] The rollback application is integrated into the OTA upgrade package;
[0061] The step of triggering the client terminal's operating system to roll back based on the OTA rollback package, in order to control the client terminal to exit the debugging state, includes:
[0062] The rollback application is launched, and the rollback application triggers the operating system of the client terminal to roll back according to the OTA rollback package, so as to control the client terminal to exit the debugging state.
[0063] As described above, the rollback operation can be performed directly by rolling back the application to exit the debug state, which makes it easier for non-developers to perform on-site debugging of problematic client terminals and optimize the user experience.
[0064] Furthermore, launching the fallback application includes:
[0065] If a rollback request is received, the rollback application is launched according to the rollback request.
[0066] As described above, after debugging is completed, the debugging personnel can proactively initiate a request to start the rollback application to perform the OTA rollback function, and roll back the client terminal to the previous official version state so that the client terminal can use it.
[0067] Furthermore, launching the fallback application includes:
[0068] Obtain the debugging duration of the client terminal in the debugging state;
[0069] Determine whether the debugging duration has reached a preset time threshold; if so, start the rollback application.
[0070] As described above, if a client terminal does not revert to the official version after switching to debug mode for an extended period of time, the rollback application will automatically execute the OTA rollback function to prevent debuggers from forgetting to revert to the state before debugging, thus avoiding security risks to the client terminal.
[0071] Please refer to Figure 4 Another embodiment of the present invention provides an operating system debugging terminal, including a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the various steps in the above-described operating system debugging method.
[0072] As described above, the beneficial effects of this invention are as follows: By acquiring the target debug file and the general PKG file, and packaging the target debug file to generate the corresponding target PKG file, subsequent debugging of the client terminal's operating system can be achieved simply by uploading the target PKG file to the server for compilation, thereby generating the corresponding OTA base package. During this process, no other code unrelated to debugging needs to be compiled, shortening compilation time. Simultaneously, uploading the general PKG file used during debugging to the server solves the problems of the client terminal being unable to be rooted and dm-verity being disabled in the user version, and the terminal being read-only, making it convenient for non-developers to directly use the corresponding general PKG file to complete debugging tasks. Furthermore, this invention automatically generates the corresponding OTA upgrade package and OTA rollback package after uploading the PKG file to the server for compilation, eliminating the need for developers to compile and generate the package, simplifying debugging difficulty. This allows non-developers to independently complete debugging work, reducing labor costs and improving debugging efficiency.
[0073] This invention provides an operating system debugging method and terminal, which can be applied to smart products developed based on operating systems such as Android or HarmonyOS. It debugs the official product used by users based on the user version, allowing non-developers to independently complete the debugging work, reducing labor costs and improving debugging efficiency. The following specific embodiments illustrate this:
[0074] Please refer to Figures 2 to 3 Embodiment 1 of the present invention is as follows:
[0075] An operating system debugging method, comprising:
[0076] S1. Obtain the target debug file and the general PKG file.
[0077] Specifically, step S1 includes:
[0078] S11. Obtain the target debugging module, compile the target debugging module, and generate the target debugging file;
[0079] In some embodiments, the target debugging module is the code for the "Add More Logs" function. The module is compiled to generate the corresponding target debugging file. This target debugging file includes system libraries, executable binaries, or system applications, such as .so libraries, .bin files, applications, and configuration files. Packaging these target debugging files together avoids issues caused by missing a target debugging file or using a different version of the target file, which could lead to unexpected integration problems.
[0080] S12. Obtain the debug bridge instructions and debugger, and package the debug bridge instructions and debugger into a universal PKG file.
[0081] It should be noted that, for security reasons, the official version of the terminal used by the client (hereinafter referred to as the client terminal) may only support a small number of debug bridge commands, and most commands or root programs have been removed. For example, the adb (Android Debug Bridge) of a client terminal developed based on the Android system only includes regular commands such as devices, getprop, and logcat, and does not include shell commands; the root program mainly refers to the su executable file, which the client terminal cannot include to prevent root access. Therefore, for the convenience of debugging, the traditional debugging method is to compile the fully functional adb commands and the root program together into the system. This debugging method requires different branch management of the code or the use of different compilation scripts, making code management relatively complex.
[0082] This invention packages complete adb instructions (debugging bridge instructions) and a su executable file (debugging program) into a universal PKG file, providing a general version for debuggers to use directly. Debuggers do not need to repackage the adb instructions and su executable file, nor do they need to compile. When debugging is required on the client terminal, the debugger only needs to upload the universal PKG file containing the adb instructions and the root program to the server. The client terminal in debug mode then contains fully functional adb instructions and the su executable file, facilitating debugging. Compared to traditional compilation and debugging methods, this invention does not impose additional code management burdens, and even non-developers can independently complete the debugging process.
[0083] S2. Package the target debug file to generate the target PKG file of the corresponding version.
[0084] Specifically, step S2 includes:
[0085] S21. Generate a corresponding description information file based on the functional category of the target debugging module;
[0086] S22. Package the target debug file according to the description information file to generate the target PKG file of the corresponding version.
[0087] It's important to note that a PKG file is a publicly available installation package, and the description file within it can specify the PKG file's version number. Therefore, for different debugging scenarios or different module functionalities, corresponding description files can be generated, thus packaging different versions of the PKG file.
[0088] It's important to note that after the target debug file is packaged into a corresponding version of the target PKG file, the target PKG file includes the target debug file and its installation information. This installation information includes the directory where the target debug file will be installed in the terminal, the specified directory and file read / write permissions, the file owner, and the group. For example, the target PKG file can integrate the target debug file's installation information into a data.tar.gz file, which is a standard Linux package file. The data.tar.gz file contains the target debug file's installation directory, owner, and read / write permissions.
[0089] S3. Obtain the operating system version information of the client terminal, and search for the preset first OTA base package in the server based on the version information. The first OTA base package is a historical version of the OTA base package.
[0090] It should be noted that the server in this invention is a backend compilation server, and the operating system version information is the client terminal OTA version information.
[0091] It's important to note that, under normal circumstances, developers' compilation servers do not contain historical versions of the OTA base package. To debug a specific client version, a matching OTA base package needs to be found. If multiple client versions need debugging, this process of finding the matching OTA base package requires manual intervention, and the corresponding OTA upgrade and rollback packages must be manually compiled. In traditional debugging methods, if the code to be debugged is integrated into the source code for compilation, two sets of code need to be maintained: one for production use and one for debugging, resulting in a significant maintenance workload. The server in this invention is a backend compilation server that contains OTA base packages for all historical versions. Debuggers only need to upload the target PKG file and the client terminal's version information to the backend compilation server, which automatically generates the OTA upgrade and rollback packages for debugging.
[0092] S4. Upload the generic PKG file and the target PKG file to the server.
[0093] In some embodiments, when debugging is required on the client terminal, the debugging personnel only need to package the corresponding target PKG file, and then select the target PKG file and the general PKG file to upload to the server to complete the debugging steps. There is no need for designated developers to compile and debug, and the debugging operation is simple and convenient.
[0094] S5. The target PKG file is compiled by the server to generate the second OTA base package.
[0095] Specifically, step S5 includes:
[0096] S51. Decompress the target PKG file via the server to obtain the installation information of the target debug file;
[0097] S52. Compile the target debug file through the server to generate a target image that matches the installation information;
[0098] In some embodiments, when the server decompresses the target PKG file, it decompresses the target PKG file to the corresponding directory according to the installation information recorded in the file, thereby obtaining the installation information of the target debug file, and then generating the target image in that directory. For example, if the application in the target PKG file is decompressed, its application is directly decompressed to the / system / app / directory, generating the system image.
[0099] S53. Generate the second OTA base package based on the target image and the first OTA base package.
[0100] In one alternative implementation, it further includes:
[0101] S54. Randomly generate a maintenance status file through the server and integrate the maintenance status file into the second OTA base package. The maintenance status file includes a UUID (Universally Unique Identifier) identifier.
[0102] It should be noted that the maintenance status file is a file used by the server to identify whether a client terminal is in a maintenance state. The file includes UUID information with timestamps as factors.
[0103] In some embodiments, if the maintenance status file is integrated into the second OTA base package, then during subsequent processes, if the client terminal detects the existence of the maintenance status file, the client terminal will display the corresponding debug watermark. Simultaneously, the version numbers of the OTA upgrade packages and OTA rollback packages generated by the second OTA base package also include UUID information. For example, if the client terminal's version number is 2.3.6, the version number of the OTA upgrade package generated by the server is 2.3.6 (UUID), meaning it's an OTA upgrade package from 2.3.6 to 2.3.6 (UUID); the version number of the OTA rollback package generated by the server is 2.3.6, meaning it's an OTA rollback package from 2.3.6 (UUID) to 2.3.6. That is, the UUID identifier can identify the version number of the OTA package.
[0104] S6. Generate OTA upgrade package and OTA rollback package by differentially processing the first OTA base package and the second OTA base package through the server.
[0105] It's important to note that personnel needing to debug client terminals include underlying system developers, application developers, tool developers, testers, and customer service personnel. Typically, only a select group of people have access to and can compile the system source code. While most others have debugging needs, they cannot directly compile the source code. Therefore, if debuggers need to modify the source code, they must collaborate with those who have source code access to generate OTA upgrade and rollback packages. Thus, in traditional debugging methods, debuggers cannot complete the debugging work independently. This invention generates corresponding target debug files based on the debugger's own compilation environment (native code compilation environment). For example, it generates target debug files by compiling modules from native Android code; or it generates APK files using tools like Eclipse or Android Studio. The generated target debug files are then packaged into target PKG files. These PKG files are then uploaded to the server for compilation, generating debugged OTA upgrade and rollback packages. No source code modification or compilation is required, so OTA upgrade and rollback packages can be generated without the need for cooperation with personnel who have access to the source code, enabling debuggers to complete debugging work independently.
[0106] S7. Complete the debugging of the operating system based on the general PKG file, OTA upgrade package, and OTA rollback package.
[0107] Specifically, step S7 includes:
[0108] S71. Obtain the URL address generated by the server;
[0109] S72. Download the OTA upgrade package and OTA rollback package according to the URL address;
[0110] S73. After decompressing the generic PKG file via the server, a generic image is generated;
[0111] S74. Trigger the operating system to upgrade based on the OTA upgrade package in order to control the client terminal to enter the debugging state;
[0112] In some embodiments, a maintenance state file exists in the client terminal, so the client terminal is in maintenance mode, and a debug watermark will be displayed on the client terminal.
[0113] S75. Complete the debugging of the operating system based on the general image;
[0114] S76. Trigger the operating system to roll back based on the OTA rollback packet to control the client terminal to exit the debugging state.
[0115] In one alternative implementation, the universal image includes a rollback application, which is integrated into the OTA upgrade package.
[0116] In some embodiments, the rollback application is integrated into the OTA upgrade package at the same time as generating the OTA upgrade package. However, the OTA rollback package does not contain the rollback application. Therefore, after the client terminal rolls back to the official version, the client terminal does not contain the rollback application, and at this time, there is no maintenance status file on the client terminal. The client terminal has exited maintenance mode, and the client terminal no longer displays the debug watermark.
[0117] Specifically, step S76 includes:
[0118] S761. Start the rollback application. The rollback application triggers the client terminal's operating system to roll back based on the OTA rollback package, thereby controlling the client terminal to exit the debugging state.
[0119] In one alternative implementation, launching the rollback application includes:
[0120] S7611. If a rollback request is received, start the rollback application according to the rollback request.
[0121] In some embodiments, the rollback application provides a trigger button. After debugging is complete, the debugger can manually click the application's trigger button to generate a rollback request and launch the rollback application.
[0122] In one alternative implementation, launching the rollback application includes:
[0123] S7612. Obtain the debugging duration of the client terminal in debug mode;
[0124] S7613. Determine whether the debugging duration has reached the preset time threshold. If so, start the rollback application.
[0125] In some embodiments, when the client terminal enters the debugging state, a countdown begins from a preset time threshold, and when the countdown ends, the rollback application will start automatically.
[0126] like Figure 3 As shown, the main body for executing steps S1 to S7 is the PC tool, and the above-mentioned operating system debugging method is implemented through the interaction of the PC tool, the corresponding client terminal, and the server.
[0127] Please refer to Figure 4 Embodiment two of the present invention is as follows:
[0128] An operating system debugging terminal 200 includes a memory 201, a processor 202, and a computer program stored in the memory 201 and running on the processor 202. When the processor 202 executes the computer program, it implements the various steps of the operating system debugging method described in Embodiment 1.
[0129] In some embodiments, the operating system debugging terminal 200 is... Figure 3 The image shows a PC tool.
[0130] In summary, the operating system debugging method and terminal provided by this invention address the issue of debugging terminals running official operating systems. If debugging is required due to abnormal issues during use, debuggers can obtain the target debugging module, generate the corresponding target debugging file, and package it into a target PKG file. Then, using a PC tool, they can upload the debugging bridge instructions, debugging program, and target PKG file to a server. The server then compiles the target PKG file to automatically generate OTA upgrade and rollback packages. This process does not require modification of the source code, thus eliminating the need to compile other code unrelated to debugging and effectively shortening compilation time. Furthermore, the compilation of the target PKG file can be achieved through the debugger's own compilation environment, without requiring specific personnel to access the source code. Therefore, debuggers can independently complete the debugging work, effectively improving the efficiency of on-site debugging of client terminals. In addition, the debugging bridge instructions and debugging program can complete the removed instructions and programs in the client terminal, thereby improving debugging convenience and solving the problems of user-version client terminals being unable to be rooted, have dm-verity disabled, and are read-only. Furthermore, the debug bridge instructions and debuggers are packaged into a generic PKG file, making it easy for non-developers to directly use the corresponding generic PKG file to complete debugging tasks, simplifying debugging difficulty, reducing labor costs, and improving debugging efficiency.
[0131] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.
Claims
1. An operating system debugging method, characterized in that, include: Obtain the target debug file and the generic PKG file; Package the target debug file to generate a target PKG file of the corresponding version; Obtain the operating system version information of the client terminal, and search for the first preset OTA basic package in the server based on the version information; Upload the general PKG file and the target PKG file to the server; The target PKG file is compiled by the server to generate a second OTA base package; The server differentially generates OTA upgrade and OTA rollback packages from the first OTA base package and the second OTA base package. The operating system was debugged using the general PKG file, OTA upgrade package, and OTA rollback package. The acquisition of the target debug file and the general PKG file includes: Obtain the target debugging module, compile the target debugging module, and generate the target debugging file; Obtain the debug bridge instructions and debugger, and package the debug bridge instructions and debugger into a generic PKG file; The step of debugging the operating system based on the general PKG file, OTA upgrade package, and OTA rollback package includes: Obtain the URL address generated by the server; Download the OTA upgrade package and OTA rollback package according to the URL address; After the server decompresses the generic PKG file, a generic image is generated. The OTA upgrade package triggers the operating system to upgrade, thereby controlling the client terminal to enter the debugging state; The operating system is debugged based on the general image; The OTA rollback packet triggers the operating system to roll back, thereby controlling the client terminal to exit the debugging state.
2. The operating system debugging method according to claim 1, characterized in that, The step of packaging the target debug file to generate a target PKG file of the corresponding version includes: Generate a corresponding description information file based on the functional category of the target debugging module; The target debug file is packaged according to the description information file to generate a target PKG file of the corresponding version.
3. The operating system debugging method according to claim 1, characterized in that, The step of compiling the target PKG file through the server to generate the second OTA base package includes: The target PKG file is decompressed by the server to obtain the installation information of the target debug file; The target debug file is compiled using the server to generate a target image that matches the installation information; A second OTA base package is generated based on the target image and the first OTA base package.
4. The operating system debugging method according to claim 1, characterized in that, Also includes: The server randomly generates a maintenance status file, which is then integrated into the second OTA base package. The maintenance status file includes a UUID identifier.
5. The operating system debugging method according to claim 1, characterized in that, The universal image includes a fallback application; Also includes: The rollback application is integrated into the OTA upgrade package; The step of triggering the client terminal's operating system to roll back based on the OTA rollback package, in order to control the client terminal to exit the debugging state, includes: The rollback application is launched, and the rollback application triggers the operating system of the client terminal to roll back according to the OTA rollback package, so as to control the client terminal to exit the debugging state.
6. The operating system debugging method according to claim 5, characterized in that, Activating the fallback application includes: If a rollback request is received, the rollback application is launched according to the rollback request.
7. The operating system debugging method according to claim 5, characterized in that, Activating the fallback application includes: Obtain the debugging duration of the client terminal in the debugging state; Determine whether the debugging duration has reached a preset time threshold; if so, start the rollback application.
8. An operating system debugging terminal, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements each step of the operating system debugging method as described in any one of claims 1-7.
Citation Information
Patent Citations
Method and system for obtaining root privilege in SELinux enforcing mode by android user version
CN108595214A
System rollback method and device and storage medium
CN115357295A
