System update exception processing method and device and storage medium
By monitoring and analyzing the abnormal status information during the Android system update process and determining the corresponding exception handling measures, the problems of infinite restart and dead loop during the system update process are solved, and the stability and reliability of the system are improved.
Patent Information
- Application Number
- CN202510159668.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-06-27
AI Technical Summary
In the process of Android system service update, the existing technology can easily lead to infinite restarts or dead loops when encountering exceptions, affecting system stability and reliability.
By monitoring the abnormal status information during the system update process, judging the abnormal situation, and determining the corresponding abnormal handling measures based on the judgment results, avoiding infinite restart and dead loop. Specific measures include loading the update patch file, detecting the reason for exit of the system service, obtaining the relationship between the system and the update patch file, and rolling back when the number of exits of the system service above the preset threshold is above.
It effectively avoids infinite restarts and dead loops during system updates, improves the stability and reliability of the system, and ensures user experience.
Smart Images

Figure CN120216233A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a system update exception processing method, a computer device, and a computer-readable storage medium. Background Art
[0002] Android system services are the core components of the Android operating system. They are responsible for performing various system-level tasks, such as managing the life cycle of applications, processing user input, and providing network connections. They are essential to ensuring the normal operation of the system and user experience. The importance of monitoring the operating status of system services lies in being able to promptly detect and handle service anomalies, prevent service exit or performance degradation, thereby ensuring system stability and reliability and improving user experience.
[0003] In the current related technology, the process of updating Android system services when the system starts is monitored based on the Watchdog process. When it is detected that the service is unresponsive, exits or loads timeout, the current related technical solutions generally tend to restart the system directly, but this may cause system operation instability or other unpredictable risks. Summary of the invention
[0004] The present application provides a system update exception handling method, a computer device, and a computer-readable storage medium.
[0005] The system update exception handling method involved in the implementation mode of the present application includes:
[0006] In the case that an abnormality occurs in the system update, an abnormality handling measure corresponding to the abnormality status information is determined according to the abnormality status information of the abnormality.
[0007] In this way, the system update exception handling method in the implementation mode of the present application can judge the occurrence of the above-mentioned abnormal situation based on the abnormal status information corresponding to the above-mentioned exception when an exception occurs in the system update, and further determine the corresponding exception handling measures based on the judgment result according to the situation, so as to avoid infinite restart and other dead loops that may be triggered in certain situations as much as possible, thereby improving the reliability of system use.
[0008] In some implementations, when an exception occurs in the system update, determining an exception handling measure corresponding to the exception status information according to the exception status information includes:
[0009] In response to loading the update patch file, monitoring and acquiring the abnormal state information;
[0010] The exception handling measure is determined according to the abnormal state information.
[0011] In this way, the present application can achieve an update when the system loads the update patch file, and at the same time, monitor the update process and capture the abnormal state based on the anomaly detection module, so as to facilitate the subsequent determination of the anomaly handling measures corresponding to the abnormal state.
[0012] In some embodiments, the system update anomaly handling method further includes:
[0013] When the system starts up, load the update patch file.
[0014] In this way, the present application can also achieve an update when the system starts up and executes the update while loading the update patch file.
[0015] In some embodiments, in response to the system starting up and loading the update patch file, monitoring and obtaining the abnormal state information, and then further including:
[0016] When the system service exits, determine the exit reason of the system service according to the abnormal state information.
[0017] In this way, the present application can detect the exit of the system service during the system startup and update process and further determine the exit reason of the system service, so as to lay a data foundation for the determination of the anomaly handling measures.
[0018] In some embodiments, the method further includes:
[0019] When the exit reason of the system service indicates that the system service exits abnormally, obtain the association relationship between the system service and the update patch file.
[0020] In this way, the present application can determine the association relationship between the abnormal exit and the system update process according to the target file list in the update patch file when the system service exits abnormally.
[0021] In some embodiments, the method further includes:
[0022] When there is an association relationship between the system service and the update patch file, obtain the startup state of the system.
[0023] In this way, the present application can determine the corresponding anomaly handling measures based on the above association relationship and further based on the startup state of the system.
[0024] In some embodiments, for determining the anomaly handling measures according to the abnormal state information, it further includes:
[0025] When the startup state is the first state, determine the anomaly handling measures corresponding to the abnormal state information.
[0026] In some embodiments, the method further includes:
[0027] When the startup state is the second state, obtaining the exit interval of the system service;
[0028] When the exit interval exceeds a first preset threshold, resetting the exit interval count of the system service and determining an exception handling measure corresponding to the exception status information.
[0029] In this way, the present application can re-evaluate the repeated restart and repeated exit of some system services according to the current startup state of the system, so as to exclude the interference of the system services with normal restart and normal exit on determining the exception handling measure.
[0030] In some embodiments, the determining an exception handling measure corresponding to the exception status information includes:
[0031] Updating or resetting the exit times of the system service;
[0032] When the exit times exceed a second preset threshold, performing a rollback process on the system.
[0033] In this way, the present application can perform a corresponding rollback process on the system when the exit times of the system service exceed the preset threshold, so as to restore the system to the state before the update and fundamentally stop the continuous exit of the system service.
[0034] In some embodiments, the performing a rollback process on the system when the exit times exceed a second preset threshold includes:
[0035] Revoking the loading of the update patch file;
[0036] Recording the rollback process and the update patch file in a preset rollback information list.
[0037] In this way, the present application also provides an execution manner of the rollback process.
[0038] In some embodiments, the determining an exception handling measure corresponding to the exception status information further includes:
[0039] When the rollback process fails and the system startup is not completed, performing a restart process on the system; and / or
[0040] Recording the failure and the update patch file in a preset rollback information list.
[0041] Thus, the present application can also determine further processing measures according to the startup state of the system after a rollback failure.
[0042] In some embodiments, the update patch file is generated according to the following method:
[0043] Obtain the update file to be written;
[0044] Determine a target file list according to the update file and the system, where the target files included in the target file list have an associated relationship with the update file;
[0045] Determine the update patch file according to the update file and the target file list.
[0046] Thus, the present application provides a specific way to generate an update patch file.
[0047] In some embodiments, the determining the update patch file according to the update file and the target file list includes:
[0048] Perform an encryption process on the update file according to a preset compilation server to determine an encrypted update file;
[0049] Determine the update patch file according to the encrypted update file and the target file list.
[0050] Thus, the present application can also perform signature encryption at different levels when packaging and generating an update patch file to improve the security of the system update process.
[0051] In some embodiments, the method further includes:
[0052] When the system startup is completed, obtain a preset rollback information list;
[0053] Report the unreported record entries according to the preset rollback information list;
[0054] Update the preset rollback information list.
[0055] Thus, the present application can also implement the active reporting of rollback processing information.
[0056] The computer device in the embodiments of the present application includes a memory and a processor, and the memory stores a computer program. When the computer program is executed by the processor, the above method is implemented.
[0057] The computer-readable storage medium in the embodiments of the present application stores a computer program. When the computer program is executed by one or more processors, the above method is implemented.
[0058] The computer program product in the embodiments of the present application includes executable instructions executed on a computer, and the executable instructions are used to execute the system update exception handling method described above.
[0059] In the embodiments of the present application, a vehicle is provided with an in-vehicle system, and the in-vehicle system can implement the system update exception handling method described above.
[0060] Additional aspects and advantages of the embodiments of the present application will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the embodiments of the present application. Description of the Drawings
[0061] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood from the following description of the embodiments in conjunction with the drawings, where:
[0062] Figure 1 is one of the flow diagrams of the system update exception handling method in the embodiments of the present application;
[0063] Figure 2 is the second flow diagram of the system update exception handling method in the embodiments of the present application;
[0064] Figure 3 is the third flow diagram of the system update exception handling method in the embodiments of the present application;
[0065] Figure 4 is the fourth flow diagram of the system update exception handling method in the embodiments of the present application;
[0066] Figure 5 is the fifth flow diagram of the system update exception handling method in the embodiments of the present application;
[0067] Figure 6 is the sixth flow diagram of the system update exception handling method in the embodiments of the present application;
[0068] Figure 7 is the seventh flow diagram of the system update exception handling method in the embodiments of the present application;
[0069] Figure 8 is the eighth flow diagram of the system update exception handling method in the embodiments of the present application;
[0070] Figure 9 is the ninth flow diagram of the system update exception handling method in the embodiments of the present application;
[0071] Figure 10 is the tenth flow diagram of the system update exception handling method in the embodiments of the present application. Detailed Embodiments
[0072] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and should not be construed as a limitation to the embodiments of the present application.
[0073] Please refer to Figure 1 , the system update exception handling method in the embodiments of the present application includes the following steps:
[0074] 01: In the case where a system update fails, determine an exception handling measure corresponding to the exception status information according to the exception status information of the exception.
[0075] The system update exception handling device in the embodiments of the present application can implement the above-mentioned system update exception handling method. Specifically, the system update exception handling device includes a processing module, where the processing module is used to determine an exception handling measure corresponding to the exception status information according to the exception status information of the exception in the case where a system update fails.
[0076] The computer device in the embodiments of the present application can implement the above-mentioned system update exception handling method. Specifically, the computer device includes a memory and a processor, where the memory stores a computer program, and the processor is used to determine an exception handling measure corresponding to the exception status information according to the exception status information of the exception in the case where a system update fails.
[0077] Specifically, the system update exception handling method in the embodiments of the present application is mainly for the Android system or other operating systems developed based on the Android platform, and the scenario is to perform an update while the system is starting up. When the system starts up, the system will load system services according to a preset order. Further, when starting the update, file copying and updating of relevant system services will be performed according to the relevant information in the update patch file. However, in some cases, due to errors in the relevant files in the update patch file or errors in the system files themselves, the update during system startup may be incorrect. Specifically, it is manifested as the situation that the system service exits during the loading process. In order to solve the above errors, the system generally adopts methods such as restarting the corresponding system service and cleaning up hardware resources to improve the system performance during startup. When the above error is a fatal error and cannot be simply solved, it will be achieved by restarting. However, in some cases, if there are many errors in the relevant files in the update patch file or there are many faults in the system files themselves, the update process may induce continuous multiple or even infinite loop system service restarts or even system restarts, which greatly affects the stability and reliability of the system.
[0078] Therefore, this application proposes the above-mentioned system update exception handling method. The main idea is to perform multiple gradient and multiple levels of judgment on the current startup status of the system, the number of errors and the interval duration during the system update process, and the relationship between the system update process and the update patch file, and further determine different processing measures based on different judgment results, so as to avoid repeated restarts of system services or the system itself as much as possible, thereby improving the efficiency of handling abnormal situations during system updates.
[0079] Specifically, when the system starts, the system enters the startup update process. On the one hand, the system needs to load each system service according to the preset order to achieve startup. On the other hand, the system adds or overwrites the system files corresponding to the system services based on the pre-configured update information. At the same time, the system monitors the above startup and update process through a pre-configured exception monitoring module and collects data during the system service startup and update process.
[0080] In addition, when the system is running normally, it can also enter the update process. The system directly adds or overwrites the system files corresponding to the system services based on the pre-configured update information. At the same time, the system monitors the above update process through the pre-configured exception monitoring module and collects data during the system service startup and update process.
[0081] Furthermore, when the abnormal monitoring module determines that an abnormality has occurred in the system update process based on the acquired data, the abnormal monitoring module will acquire the corresponding abnormal status information based on the actual abnormal situation, and further make a situation judgment based on one or more information in the abnormal status information, and finally determine the next abnormal handling measures to be performed for the above abnormal situation based on the judgment result. In this way, the abnormal cause of the abnormal situation when the update occurs can be determined through the above situation judgment, and the abnormal handling measures corresponding to the above abnormal cause can be determined in a targeted manner, thereby reducing the frequency of invalid restarts.
[0082] In this way, the system update exception handling method in the implementation mode of the present application can judge the occurrence of the above-mentioned abnormal situation based on the abnormal status information corresponding to the above-mentioned exception when an exception occurs in the system update, and further determine the corresponding exception handling measures based on the judgment result according to the situation, so as to avoid infinite restart and other dead loops that may be triggered in certain situations as much as possible, thereby improving the reliability of system use.
[0083] See also Figure 2 In some embodiments, step 01 includes:
[0084] 011: Monitor and obtain abnormal status information in response to loading an update patch file;
[0085] 012: Determine abnormal handling measures according to the abnormal status information.
[0086] Further, in some embodiments, the system update abnormal handling method further includes:
[0087] Load the update patch file when the system starts.
[0088] In some embodiments, the processing module is further configured to monitor and obtain abnormal status information in response to loading an update patch file, and to determine abnormal handling measures according to the abnormal status information.
[0089] In some embodiments, the processor is further configured to monitor and obtain abnormal status information in response to loading an update patch file, and to determine abnormal handling measures according to the abnormal status information.
[0090] Specifically, on the basis of the above embodiments, when the system enters the update process, for example, the system loads a pre-configured update patch file. The generation of the update patch file can be generated, packaged, and encrypted by the system according to the update information obtained from the server. Next, the system adds or overwrites the system files corresponding to each system service according to the update files and configuration information included in the above update patch file, so as to implement the update.
[0091] Next, take the trigger of starting the update when the system starts as an example to illustrate. For example, when the system starts, the update_dpk method is executed. This method is responsible for mounting each *.so format file in the update patch file to the corresponding specified system directory, and at the same time parsing configuration files such as *.rc format files in the update patch file, so as to replace the startup file path corresponding to the system service to be updated with the corresponding file path recorded in the configuration files such as *.rc format files in the update patch file, so as to ensure that the update patch file loaded by the system at startup is the content of the latest patch package. The *.so format file is the system file corresponding to the system service, and the *.rc format file is a special configuration file written in the Android initialization language, which is mainly used in the initialization process of the Android system. These files are usually not compiled or linked, but are loaded and parsed by the system's Init process. They contain information such as commands to be executed when the system starts, startup configurations of services, and settings of properties.
[0092] Next, during the system startup process, the system starts each system service in a preset order, and at the same time loads and runs the already mounted files to implement the dynamic upgrade content of the system update. Meanwhile, the system starts the anomaly detection module to detect anomalies in the startup, running, and loading and updating processes of each system service during the system startup process, and prepares to capture any abnormal situations.
[0093] In this way, the present application can implement an update when the system starts and executes the update while loading the update patch file, and further implement a startup update when the system loads the update patch file, and at the same time monitor the update process and capture the abnormal state based on the anomaly detection module, so as to facilitate subsequent determination of the anomaly handling measures corresponding to the abnormal state.
[0094] Please refer to Figure 3 , in some embodiments, the update patch file is generated according to the following method:
[0095] 001: Obtain the update file to be written;
[0096] 002: Determine the target file list according to the update file and the system,
[0097] where the target files included in the target file list have an association relationship with the update file;
[0098] 003: Determine the update patch file according to the update file and the target file list.
[0099] In some embodiments, the processing module is further configured to obtain the update file to be written, and to determine the target file list according to the update file and the system, where the target files included in the target file list have an association relationship with the update file, and to determine the update patch file according to the update file and the target file list.
[0100] In some embodiments, the processor is further configured to obtain the update file to be written, and to determine the target file list according to the update file and the system, where the target files included in the target file list have an association relationship with the update file, and to determine the update patch file according to the update file and the target file list.
[0101] Specifically, based on the above embodiments, for the determination and generation of the update patch file, exemplarily, first, the system can obtain the update files to be overwritten or added from a server or other storage media. The above update files are generally ELF files (Executable and Linkable Format, ELF). The ELF file is a standard file format for executable files, object code, shared libraries, and core dumps, mainly used in Unix-like systems such as Linux, Android, Mac OS X, etc.
[0102] Next, the system determines the target system files that have an association relationship with the above ELF file according to the above ELF file and the system's own configuration information, and forms a target file list based on the attribute information of these system files. The above association relationship generally represents the association relationship of the target system file to the ELF file, that is, it represents the association relationship that the target system file needs to rely on the ELF file to perform overwriting or addition in order to complete the update.
[0103] Finally, the above target file list is packaged with the update file to form the above update patch file.
[0104] In this way, the present application provides a specific method for generating an update patch file.
[0105] Please refer to Figure 4 , in some embodiments, step 003 includes:
[0106] 0031: Perform encryption processing on the update file according to a preset compilation server to determine the encrypted update file;
[0107] 0032: Determine the update patch file according to the encrypted update file and the target file list.
[0108] In some embodiments, the processing module is further configured to perform encryption processing on the update file according to a preset compilation server to determine the encrypted update file, and to determine the update patch file according to the encrypted update file and the target file list.
[0109] In some embodiments, the processor is further configured to perform encryption processing on the update file according to a preset compilation server to determine the encrypted update file, and to determine the update patch file according to the encrypted update file and the target file list.
[0110] Specifically, on the basis of the above embodiments, for the process of packing the target file list and the updated file to generate an update patch file, exemplarily, the system first uploads the updated file to a dedicated compilation server, and performs signature encryption processing on the updated file by using encryption technology, so that during the system update process, the updated file can be verified based on the above signature encryption, avoiding adverse situations such as the system being attacked due to the updated file being tampered with, and improving the security of the system update process.
[0111] Secondly, the system compresses and packs the already encrypted updated file and the target file list to form a compressed package file, and the compression algorithm can be implemented by using compression logics such as zip, 7z, rar, etc. Finally, perform APKV2 signature encryption on the generated compressed package number, so as to perform signature encryption on the entire update patch file under the Android system framework, facilitating the verification of the entire update patch file based on the above signature encryption during the system update process, avoiding adverse situations such as the system being attacked due to the file being tampered with, and improving the security of the system update process.
[0112] In this way, the present application can also perform signature encryption at different levels when packing and generating the update patch file, so as to improve the security of the system update process.
[0113] Please refer to Figure 5 , in some embodiments, after step 011, it further includes:
[0114] 0111: In the case where the system service exits, determine the exit reason of the system service according to the abnormal status information.
[0115] In some embodiments, the processing module is further configured to determine the exit reason of the system service according to the abnormal status information in the case where the system service exits.
[0116] In some embodiments, the processor is further configured to determine the exit reason of the system service according to the abnormal status information in the case where the system service exits.
[0117] Specifically, on the basis of the above embodiments, when the system starts and loads the update patch file to execute the update process, if the anomaly detection module detects that a certain system service exits, the anomaly detection module will centrally obtain the anomaly status information for the exited system service. It should be noted that there are some system services in the Android system that are only executed during the system startup phase. When the system startup process reaches a certain stage, these system services will directly exit, which belongs to the normal process of system startup. The above anomaly status information generally includes the number of service exit signals, service identifiers, error codes of the service when it exits, and other information when the system service exits. Then, the anomaly detection module centrally analyzes the above anomaly status information to obtain the reason for the exit of the above system service, and this reason can indicate whether the exit of the system service is a normal process or an abnormal exit.
[0118] In this way, the present application can detect the exit of the system service during the system startup and update process and further determine the reason for the exit of the system service, so as to lay a data foundation for determining the anomaly handling measures.
[0119] Please further refer to Figure 5 , in some embodiments, the system update anomaly handling method further includes:
[0120] 0112: When the reason for the exit of the system service indicates an abnormal exit of the system service, obtain the association relationship between the system service and the update patch file.
[0121] In some embodiments, the processing module is further configured to obtain the association relationship between the system service and the update patch file when the reason for the exit of the system service indicates an abnormal exit of the system service.
[0122] In some embodiments, the processor is further configured to obtain the association relationship between the system service and the update patch file when the reason for the exit of the system service indicates an abnormal exit of the system service.
[0123] Specifically, on the basis of the above embodiments, after the anomaly detection module centrally analyzes according to the anomaly status information corresponding to the system service with the exit situation and determines that the exit of the corresponding system service is an abnormal exit, the target file list is retrieved from the update patch file to obtain whether there is the above-mentioned association relationship between the abnormally exited system service and the ELF file in the update patch file. Generally speaking, when obtaining the above association relationship, the ELF file in the update patch file and the system file corresponding to the abnormally exited system service are referred to.
[0124] For the above-mentioned association relationship, there are the following two cases: If there is the above-mentioned association relationship between the two, it indicates that the exit of the above-mentioned system service is caused by loading the update patch file to execute the update process. On the contrary, if there is no such association relationship between the two, it indicates that the exit of the above-mentioned system service is not caused by loading the update patch file to execute the update process.
[0125] In this way, the present application can determine the association relationship between the abnormal exit and the system update process according to the target file list in the update patch file when the system service exits abnormally.
[0126] Please further refer to Figure 5 , in some embodiments, the system update exception handling method further includes:
[0127] 0113: When there is an association relationship between the system service and the update patch file, obtain the startup state of the system.
[0128] In some embodiments, the processing module is further configured to obtain the startup state of the system when there is an association relationship between the system service and the update patch file.
[0129] In some embodiments, the processor is further configured to obtain the startup state of the system when there is an association relationship between the system service and the update patch file.
[0130] Specifically, on the basis of the above embodiments, by way of example, if there is an association relationship between the system file corresponding to the exited system service and the ELF file in the update patch file according to the target file list, it indicates that the exit of the above-mentioned system service is caused by loading the update patch file to execute the update process. Then, the system obtains the execution state of the current startup process, so as to determine different processing measures according to the current running state of the system to stop the current update process and avoid further negative impacts of the above update on the normal startup of the system.
[0131] In addition, if there is no association relationship between the system file corresponding to the exited system service and the ELF file in the update patch file according to the target file list, it indicates that the exit of the above-mentioned system service is not caused by loading the update patch file to execute the update process. At this time, the system update exception handling method is terminated, and the current running state of the system is maintained.
[0132] In this way, the present application can determine the corresponding exception handling measures based on the above-mentioned association relationship and further based on the startup state of the system.
[0133] Please refer to Figure 6 , in some embodiments, step 012 includes:
[0134] 0121: When the startup state is the first state, determine the exception handling measures corresponding to the exception status information.
[0135] In addition, step 012 further includes:
[0136] 0122: When the startup state is the second state, obtain the exit interval of the system service;
[0137] 0123: When the exit interval exceeds the first preset threshold, reset the exit interval count of the system service and determine the exception handling measures corresponding to the exception status information.
[0138] Specifically, based on the above embodiments, for obtaining the system startup state, exemplarily, the startup state includes two types, where the first state indicates that the system is not currently started up completely, and the second state indicates that the system is currently started up completely.
[0139] If the current system is not started up completely, then there is no need to count the intervals of repeatedly restarting and exiting certain services, and directly determine the corresponding exception handling measures that need to be taken currently, without reconfirming the specific situations of repeatedly exiting the above services.
[0140] If the current system is currently started up completely, then it is necessary to further count the intervals of repeatedly restarting and exiting certain services. If the above intervals exceed the first preset threshold, it means that these system services that repeatedly restart and exit cannot be considered to repeatedly restart due to errors, but rather indicate that the repeated restart and exit of these system services are manifestations of the normal operation of the system. At this time, the statistical data of the exit intervals of these system services needs to be reset to the default initial value to avoid interfering with the process of determining the exception handling measures subsequently.
[0141] In this way, the present application can re-evaluate the repeated restart and exit situations of some system services according to the current startup state of the system, so as to exclude the interference of the system services that are normally restarted and normally exited on determining the exception handling measures.
[0142] In some embodiments, the above determination of the exception handling measures corresponding to the exception status information includes the following steps:
[0143] 0001: Update or reset the exit times of the system service;
[0144] 0002: When the exit times exceed the second preset threshold, perform a rollback process on the system.
[0145] In some embodiments, the processing module is further configured to update or reset the number of times of exiting the system service, and to perform a rollback process on the system when the number of times of exiting exceeds a second preset threshold.
[0146] In some embodiments, the processor is further configured to update or reset the number of times of exiting the system service, and to perform a rollback process on the system when the number of times of exiting exceeds a second preset threshold.
[0147] Specifically, based on the above embodiments, for the specific process of determining the exception handling measure, exemplarily, first, based on the current statistical count and the current startup state of the system, the count of the number of times of exiting each system service is updated or reset. Among them, updating the count of the number of times of exiting is mainly for the case where the determination of the exception handling measure corresponding to the exception status information starts when the system startup is not completed. By bringing the previously statistical data into the process of determining the exception handling measure, the correctness of determining the exception handling measure is ensured. Resetting the count of the number of times of exiting is mainly for the case of re-evaluating the repeated restarting and repeated exiting of some system services after the system startup is completed. Resetting the count of the number of times of exiting generally restores the above count of the number of times of exiting to the default initial value to exclude the interference of the system services with normal restarting and normal exiting on determining the exception handling measure. That is, whether it is updating the count of the number of times of exiting or resetting the count of the number of times of exiting, the purpose is to ensure the correctness of determining the exception handling measure and exclude the interference brought by the error information.
[0148] Next, after updating or resetting the number of times of exiting the system service, continue to obtain and real-time detect the number of times of exiting the system service. When it is detected that the number of times of exiting exceeds the second preset threshold, that is, it means that the current system service is still in an abnormal state. Then the exception handling measure at this time is a rollback process, that is, the system performs a rollback on the entire update process.
[0149] In addition, when it is detected within a specified time that the number of times of exiting does not exceed the second preset threshold, that is, the loading and running of the current system service return to the normal state. At this time, it can be considered that the operation of the system resumes normal, so no action needs to be taken, and the system update exception handling method is terminated, and the current running state of the system is maintained.
[0150] In this way, the present application can perform a corresponding rollback process on the system when the number of times of exiting the system service exceeds the preset threshold, so as to restore the system to the state before the update and fundamentally stop the continuous exiting of the system service.
[0151] Please refer to Figure 8 , in some embodiments, step 0002 includes:
[0152] 00021: Cancel the loading of the update patch file;
[0153] 00022: Record the rollback process and update the patch file in the preset rollback information list.
[0154] In some embodiments, the processing module is further configured to revoke the loading of the updated patch file, and to record the rollback process and the updated patch file in the preset rollback information list.
[0155] In some embodiments, the processor is further configured to revoke the loading of the updated patch file, and to record the rollback process and the updated patch file in the preset rollback information list.
[0156] Specifically, on the basis of the above embodiments, by way of example, the way to implement the rollback process is that, in the case where backups are pre-executed for each system file to be updated before the update process, the backed-up files are restored to the corresponding file positions, and the loading of the updated patch file is stopped, which externally appears as revoking the loading of the updated patch file and restoring the system to the state before the update process is executed, so as to restore the system to a state known to be able to be used normally, and to stop the continuous exit of the system service fundamentally by stopping the continued execution of the update process.
[0157] In addition, by way of example, after the above rollback process is executed, the system will also record the relevant information of the just-executed rollback process and the relevant information of the updated patch file that caused the current rollback process to be executed in the preset rollback information list, so as to facilitate the user to consult, analyze and manually restore the update at any time when performing maintenance on the system. The relevant information of the rollback process may include the start time, end time, rollback version number information, rollback file information, etc. In this way, by recording the rollback information, it is possible to record the system update process and the execution of the exception handling measures, so as to facilitate the user to consult, maintain and manually restore the execution process of the exception handling measures at any time.
[0158] Thus, the present application also provides an execution manner of the rollback process.
[0159] In some embodiments, the above determination of the exception handling measure corresponding to the exception status information further includes:
[0160] 0003: When the rollback process fails and the system startup is not completed, perform a restart process on the system; and / or
[0161] 0004: Record the failure and the updated patch file in the preset rollback information list.
[0162] In some embodiments, the processing module is further configured to restart the system when the rollback process fails and the system startup is not completed, and to record failures in a preset rollback information list and update patch files.
[0163] In some embodiments, the processor is further configured to restart the system when the rollback process fails and the system startup is not completed, and to record failures in a preset rollback information list and update patch files.
[0164] Specifically, based on the above embodiments, by way of example, the above rollback process may fail due to conflicts of some files or loss of backup data, etc. In this case, in order to ensure the normal operation of the system, it is necessary to further confirm the current startup state of the system. Therefore, by way of example, when the rollback process fails, the current startup state of the system is further confirmed again.
[0165] When the current startup state of the system is not started completely, since the rollback process fails, the system services associated with the updated patch files will repeatedly exit and restart again and again, resulting in system startup failure. At this time, considering the stable operation of the system, a restart command is executed on the system to end all system services and restart the system. When restarting the system, the updated patch files are not loaded, so that the system can be restored to the state where it can be used normally before the update.
[0166] When the current startup state of the system is already started, even if the rollback process has failed, since the system has been started normally, it means that although there are errors in the update process and the rollback process fails, the above errors and rollback failures do not affect the normal startup of the system. Therefore, considering the stable operation of the system, it is only necessary to maintain the current running state of the system and continue to track and detect each system service, and then determine corresponding exception handling measures according to the actual situation when further errors occur in the system services.
[0167] Next, similar to the case where the rollback process is successful in the above embodiments, when restarting or maintaining the running state of the system in the case of rollback failure, the system will save the relevant information about the failure of the rollback process, the information about the processing measures of restarting or maintaining the running state after the failure, and the relevant information about the updated patch file that caused the rollback process to fail into a preset rollback information list, so as to facilitate the user to check, maintain, and manually restore the execution process of the exception handling measures at any time.
[0168] In this way, the present application can also determine further processing measures according to the startup state of the system after rollback failure.
[0169] In some embodiments, the system update exception handling method further includes:
[0170] 00051: When the system startup is completed, obtain a preset rollback information list;
[0171] 00052: Report unreported record entries according to the preset rollback information list;
[0172] 00053: Update the preset rollback information list.
[0173] In some embodiments, the processing module is further configured to obtain a preset rollback information list when the system startup is completed, and to report unreported record entries according to the preset rollback information list, and to update the preset rollback information list.
[0174] In some embodiments, the processor is further configured to obtain a preset rollback information list when the system startup is completed, and to report unreported record entries according to the preset rollback information list, and to update the preset rollback information list.
[0175] Specifically, on the basis of the above embodiments, by way of example, in the preset rollback information list, each entry further includes a field indicating the reporting status, and this field can be a Boolean variable, and the two values of this Boolean variable respectively indicate that the entry has been reported to the processing module or has not been reported to the processing module. After the system startup is completed, the system will first call the above rollback information list and read the values in the fields indicating the reporting status in all entries. If a Boolean variable value indicating that it has not been reported to the processing module is read in the field of each entry, the relevant information included in the corresponding entry will be reported to the processing module.
[0176] Further, after receiving the above relevant information, the processing module will update the data included in each entry of the rollback information list. By way of example, the Boolean variable value in the field indicating the reporting status in each entry of the rollback information list is modified to indicate that it has been reported to the processing module. In this way, the active reporting of the execution situation of the rollback process can be completed, so that the processing module can immediately grasp the system update process and the execution status of the rollback process, so as to facilitate the information processing of the system itself or the user to manually manage the system.
[0177] In this way, the present application can also implement the active reporting of rollback processing information.
[0178] The computer-readable storage medium in the embodiments of the present application stores a computer program, and when the computer program is executed by one or more processors, the above method is implemented.
[0179] The computer program product in the embodiments of the present application includes executable instructions executed on a computer, and the executable instructions are used to execute the above-mentioned system update exception handling method.
[0180] In the embodiments of the present application, a vehicle is provided with an in-vehicle system, and the in-vehicle system can implement the above-mentioned system update exception handling method.
[0181] In the description of this specification, the descriptions referring to terms such as "certain embodiments", "in one example", "exemplarily", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0182] Any process or method description shown in the flowchart or described in other ways herein can be understood to represent a module, segment or part of code including one or more executable instructions for implementing a specific logical function or process, and the scope of the preferred embodiments of the present application includes additional implementations, where the functions can be executed in a substantially simultaneous manner or in the reverse order according to the functions involved, rather than in the order shown or discussed, which should be understood by those skilled in the technical field of the embodiments of the present application.
[0183] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present application.
Claims
1. A method for handling system update exceptions, characterized in that: The method comprises: In the case that an abnormality occurs in the system update, an abnormality handling measure corresponding to the abnormality status information is determined according to the abnormality status information of the abnormality.
2. The method according to claim 1, characterized in that In the case where an exception occurs in the system update, determining an exception handling measure corresponding to the exception status information according to the exception status information, including: In response to loading the update patch file, monitoring and acquiring the abnormal state information; The exception handling measure is determined according to the abnormal state information.
3. The method according to claim 2, characterized in that The method further comprises: When the system starts, the update patch file is loaded.
4. The method according to claim 2, characterized in that: After the step of monitoring and acquiring the abnormal status information in response to loading the update patch file, the method further includes: In the case of system service exit, the reason for the system service exit is determined according to the abnormal status information.
5. The method according to claim 4, characterized in that The method further comprises: When the system service exit reason indicates that the system service exits abnormally, an association relationship between the system service and the update patch file is obtained.
6. The method according to claim 5, characterized in that The method further comprises: In the case where the system service is associated with the update patch file, the startup status of the system is obtained.
7. The method according to claim 6, characterized in that The determining the abnormality handling measure according to the abnormal state information further includes: When the startup state is the first state, an abnormality handling measure corresponding to the abnormal state information is determined.
8. The method according to claim 6, characterized in that The method further comprises: When the startup state is the second state, obtaining an exit interval of the system service; In the case where the exit interval exceeds a first preset threshold, the exit interval count of the system service is reset, and an abnormality handling measure corresponding to the abnormal state information is determined.
9. The method according to claim 7 or 8, characterized in that: The determining of an abnormality handling measure corresponding to the abnormal state information includes: Update or reset the exit count of the system service; When the number of exits exceeds a second preset threshold, a rollback process is performed on the system.
10. The method according to claim 9, characterized in that When the number of exits exceeds a second preset threshold, performing rollback processing on the system includes: Unloading the update patch file; The rollback process and the update patch file are recorded in a preset rollback information list.
11. The method according to claim 9, characterized in that The determining of the abnormality handling measures corresponding to the abnormal state information further includes: If the rollback process fails and the system startup is not completed, restart the system; and / or The failure and the update patch file are recorded in a preset rollback information list.
12. The method according to any one of claims 2 to 11, characterized in that: The update patch file is generated according to the following method: Get the update file to be written; Determine a target file list according to the update file and the system, wherein the target files included in the target file list are associated with the update file; The update patch file is determined according to the update file and the target file list.
13. The method according to claim 12, characterized in that The step of determining the update patch file according to the update file and the target file list includes: According to a preset compiling server, encrypting the update file to determine an encrypted update file; The update patch file is determined according to the encrypted update file and the target file list.
14. The method according to any one of claims 1 to 13, characterized in that: The method further comprises: When the system is started, obtaining a preset rollback information list; According to the preset rollback information list, reporting the unreported record entries; The preset rollback information list is updated.
15. A computer device, characterized in that: The computer device comprises a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 14 is implemented.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the method according to any one of claims 1 to 14 is implemented.
17. A computer program product, characterized in that The computer program product comprises executable instructions executed on a computer, wherein the executable instructions are used to perform the method according to any one of claims 1 to 14.
18. A vehicle, characterized in that: The vehicle is provided with an on-board system, and the on-board system can implement the method according to any one of claims 1-14.