Brick-changing self-rescue method and system based on Android system and medium

By obtaining and analyzing the log data packets of Android system devices, providing solutions to realize self-rescue after the equipment becomes brick, solving the problem of the equipment becoming bricked due to failure of system upgrades, reducing commercial losses and user inconvenience.

CN119440580APending Publication Date: 2025-02-14SHENZHEN SDMC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411524979.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Android system devices are easily bricked due to failure during system upgrade process. The existing processing methods are cumbersome and time-consuming, resulting in commercial losses and inconvenience to users.

Method used

By obtaining the storage requirements data during the device startup process, obtaining log partition space data, determining the log partition storage location, obtaining file system configuration file Fstab data, setting up mount method and file system format, performing log redirection, and analyzing network performance Status, start the upgrade program, obtain the upgrade log data packet, analyze the equipment upgrade status, and finally perform a new system upgrade based on the solution data.

Benefits of technology

It realizes self-rescue after the equipment becomes bricked, and provides solutions to quickly restore equipment functions by obtaining and analyzing log data packets, reducing commercial losses and user inconvenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440580A_ABST
    Figure CN119440580A_ABST
Patent Text Reader

Abstract

The invention provides a brick-changing self-rescue method and system based on an Android system and a medium. The method comprises the steps of obtaining stage storage demand data, processing the stage storage demand data and preset storage cycle data to obtain log partition space data, determining log partition storage position data according to the log partition space data, obtaining Fstab data of a file system configuration file, setting a mounting mode and a file system format according to the log partition storage position data, and storing the mounting mode and the file system format in the file system. Then log redirection is carried out, an upgrading network preparation condition is obtained according to network performance state data processing, an upgrading log data packet is obtained after an upgrading program is started, solution data is obtained after the upgrading log data packet is analyzed according to the equipment upgrading state, and finally new system upgrading is carried out on the equipment according to the solution data. Therefore, by obtaining the storage position of the log partition, uploading the log partition and analyzing the upgrade log data packet, the solution data after the equipment is changed into the brick is obtained, and the brick-changing self-rescue technology is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of Android systems, and more specifically, to a bricking self-rescue method, system and medium based on the Android system. Background Art

[0002] In the process of using the Android system, device bricking is a more serious problem. Device bricking usually means that the device cannot be used normally due to some reasons, which is similar to becoming a non-functional "brick". In the Android system, system upgrade is an important module. The most common upgrade method is recovery upgrade, but these upgrade processes may fail due to various factors. If the upgrade fails, it is easy to cause the device to become bricked. After the device is bricked, the existing processing method is often that the user returns the device to the OEM manufacturer, and the OEM manufacturer debugs on-site and uses logs to obtain the reason for the upgrade failure. However, this method has many disadvantages. The process of the device from the user to the retailer and then to the OEM manufacturer will take a lot of time and may cause serious business losses. It also brings great inconvenience to the user. Therefore, a low-cost and efficient bricking self-help method is needed.

[0003] In view of the above problems, effective technical solutions are urgently needed. Summary of the invention

[0004] The purpose of the present application is to provide a bricking self-rescue method, system and medium based on the Android system, which obtains the stage storage demand data, and then processes the preset storage period data to obtain the log partition space data, and determines the log partition storage location data according to the log partition space data, obtains the file system configuration file Fstab data, sets the mount mode and file system format according to the log partition storage location data, and then redirects the log, and then obtains the upgrade network preparation status according to the network performance status data, and then obtains the upgrade log data packet after starting the upgrade program, obtains the solution data after analyzing the upgrade log data packet according to the device upgrade status, and finally upgrades the device to a new system according to the solution data; thereby, by obtaining the log partition storage location, uploading the log partition and analyzing the upgrade log data packet, the solution data after the device is bricked is obtained, and the bricking self-rescue technology is realized.

[0005] This application also provides a brick self-help method based on the Android system, including the following steps:

[0006] Acquire the stage storage requirement data during the device startup process, obtain the log partition space data according to the stage storage requirement data and the preset storage period data, and determine the log partition storage location data according to the log partition space data;

[0007] Obtain the file system configuration file Fstab data, and set the mounting mode and file system format according to the log partition storage location data;

[0008] Redirect logs according to the mounting method;

[0009] Acquire network performance status data, obtain the upgrade network readiness status according to the network performance status data processing, start the upgrade program according to the upgrade network readiness status, and obtain the upgrade log data packet after log partition storage;

[0010] Obtain the device upgrade status, and analyze the upgrade log data packet according to the device upgrade status to obtain solution data;

[0011] Perform a new system upgrade through U-boot according to the solution data.

[0012] Optionally, in the bricking self-rescue method based on the Android system described in the present application, the step of obtaining the stage storage requirement data during the device startup process, obtaining the log partition space data according to the stage storage requirement data and the preset storage period data, and determining the log partition storage location data according to the log partition space data specifically includes:

[0013] Obtain the stage storage requirement data during the device startup process, including the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, and the Android system startup stage storage requirement data;

[0014] Input the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, the Android system startup stage storage requirement data and the preset storage period data into the preset partition storage space evaluation model for processing, and obtain the log partition space data;

[0015] The log partition storage position data is determined according to the log partition space data, including the log partition storage start position data and the log partition storage end position data.

[0016] Optionally, in the bricking self-rescue method based on the Android system described in the present application, obtaining the file system configuration file Fstab data and setting the mounting mode and file system format according to the log partition storage location data specifically include:

[0017] Get the file system configuration file Fstab data, and set the mount point data of the log partition in combination with the log partition storage start position data and log partition storage end position data;

[0018] Set the file system format of the journal partition to ext4.

[0019] Optionally, in the bricking self-rescue method based on the Android system described in the present application, the log redirection according to the mounting method specifically includes:

[0020] Modify the Bootloader configuration file data to redirect the Bootloader stage log information to the log partition;

[0021] Modify the log output function of the kernel startup phase to redirect the kernel startup phase log information to the log partition;

[0022] Adjust the log service configuration during the Android system startup phase and redirect the log information during the Android system startup phase to the log partition.

[0023] Optionally, in the bricking self-rescue method based on the Android system described in the present application, the obtaining of network performance status data, obtaining the upgrade network readiness status according to the network performance status data processing, and starting the upgrade program according to the upgrade network readiness status, and obtaining the upgrade log data packet after log partition storage, specifically includes:

[0024] Acquire network performance status data, including wired network performance status data and wireless network performance status data;

[0025] Performing AND operation on the wired network performance status data and the wireless network performance status data to obtain upgrade network preparation status data, and determining the upgrade network preparation status according to the upgrade network preparation status data, including a ready status or a waiting-for-complete status;

[0026] If the upgrade network preparation status is ready, start the upgrade program according to the user instruction;

[0027] After starting the upgrade program, use the binary reading method to read the Bootloader phase log information, the kernel startup phase log information, and the Android system startup phase log information, and send them to the log partition storage location and mark them as upgrade log data packets;

[0028] Upload the upgrade log data package to the preset server.

[0029] Optionally, in the bricking self-rescue method based on the Android system described in the present application, obtaining the device upgrade status and analyzing the upgrade log data packet according to the device upgrade status to obtain the solution data specifically includes:

[0030] Get the device upgrade status, including upgrade success or upgrade failure status;

[0031] If the device upgrade status is an upgrade failure status, the upgrade log data packet is analyzed by a preset log analysis neural network model;

[0032] The solution data corresponding to the upgrade failure state is obtained, where the solution data includes hardware solution data or software solution data.

[0033] Optionally, in the bricking self-rescue method based on the Android system described in the present application, the new system upgrade is performed through U-boot according to the solution data, specifically including:

[0034] Obtain the compatibility status of the U-boot version, and start U-boot according to the compatibility status;

[0035] Loading the hardware solution data or software solution data into the terminal management system through U-boot;

[0036] The device is re-upgraded according to the hardware solution data or the software solution data.

[0037] In a second aspect, the present application provides a bricking self-rescue system based on an Android system, the system comprising: a memory and a processor, the memory storing a program of a bricking self-rescue method based on an Android system, and the program of the bricking self-rescue method based on an Android system is executed by the processor to implement the following steps:

[0038] Acquire the stage storage requirement data during the device startup process, obtain the log partition space data according to the stage storage requirement data and the preset storage period data, and determine the log partition storage location data according to the log partition space data;

[0039] Obtain the file system configuration file Fstab data, and set the mounting mode and file system format according to the log partition storage location data;

[0040] Redirect logs according to the mounting method;

[0041] Acquire network performance status data, obtain the upgrade network readiness status according to the network performance status data processing, start the upgrade program according to the upgrade network readiness status, and obtain the upgrade log data packet after log partition storage;

[0042] Obtain the device upgrade status, and analyze the upgrade log data packet according to the device upgrade status to obtain solution data;

[0043] Perform a new system upgrade through U-boot according to the solution data.

[0044] Optionally, in the bricking self-rescue system based on the Android system described in the present application, the step of obtaining the stage storage requirement data during the device startup process, obtaining the log partition space data according to the stage storage requirement data and the preset storage period data, and determining the log partition storage location data according to the log partition space data specifically includes:

[0045] Obtain the stage storage requirement data during the device startup process, including the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, and the Android system startup stage storage requirement data;

[0046] Input the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, the Android system startup stage storage requirement data and the preset storage period data into the preset partition storage space evaluation model for processing, and obtain the log partition space data;

[0047] The log partition storage position data is determined according to the log partition space data, including the log partition storage start position data and the log partition storage end position data.

[0048] On the third aspect, the present application also provides a readable storage medium, which stores a bricking self-rescue method program based on the Android system. When the bricking self-rescue method program based on the Android system is executed by a processor, the steps of a bricking self-rescue method based on the Android system as described in any one of the above items are implemented.

[0049] From the above, it can be seen that the present application provides a bricking self-rescue method, system and medium based on the Android system. After obtaining the stage storage demand data, the method obtains the log partition space data with the preset storage cycle data processing, and determines the log partition storage location data according to the log partition space data, obtains the file system configuration file Fstab data, sets the mount mode and file system format according to the log partition storage location data, and then performs log redirection, and then obtains the upgrade network preparation status according to the network performance status data processing, and then obtains the upgrade log data packet after starting the upgrade program, obtains the solution data after analyzing the upgrade log data packet according to the device upgrade status, and finally upgrades the device to a new system according to the solution data; thereby, by obtaining the log partition storage location, uploading the log partition and analyzing the upgrade log data packet, the solution data after the device is bricked is obtained, and the bricking self-rescue technology is realized.

[0050] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0052] Figure 1 A flowchart of a brick self-rescue method based on an Android system provided in an embodiment of the present application;

[0053] Figure 2 A flowchart of obtaining log partition storage location data of a bricked self-rescue method based on an Android system provided in an embodiment of the present application;

[0054] Figure 3 A flowchart of setting the mounting mode and file system format for a bricking self-rescue method based on an Android system provided in an embodiment of the present application;

[0055] Figure 4 A flowchart of log redirection in a bricking self-rescue method based on an Android system is provided in an embodiment of the present application. DETAILED DESCRIPTION

[0056] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0057] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0058] Please refer to Figure 1 , Figure 1Flowchart of a bricking self-rescue method based on an Android system in some embodiments of the present application. The bricking self-rescue method based on an Android system is used in a terminal device, such as a computer, a mobile phone, etc. The bricking self-rescue method based on an Android system comprises the following steps:

[0059] S11, obtaining stage storage demand data during the device startup process, obtaining log partition space data according to the stage storage demand data and the preset storage period data, and determining log partition storage location data according to the log partition space data;

[0060] S12, obtaining the file system configuration file Fstab data, and setting the mounting mode and file system format according to the log partition storage location data;

[0061] S13, redirecting the log according to the mounting method;

[0062] S14, obtaining network performance status data, obtaining an upgrade network readiness status according to the network performance status data, starting an upgrade program according to the upgrade network readiness status, and obtaining an upgrade log data packet after log partition storage;

[0063] S15, obtaining the device upgrade status, and analyzing the upgrade log data packet according to the device upgrade status to obtain solution data;

[0064] S16. Upgrading the new system through U-boot according to the solution data.

[0065] It should be noted that the device refers to an Android-based device. During the device startup process, it needs to go through three stages, namely the Bootloader stage, the kernel startup stage, and the Android system startup stage. These three stages all affect whether the device can be upgraded successfully. Once the device upgrade fails, in order to determine which stage is the cause, the log data of the three stages will be stored separately to facilitate subsequent reading and analysis. In order to facilitate the retrieval of the stored log data, separate partition storage is required. Before partition storage, the size of the partition storage space needs to be determined according to the log size and preset storage cycle data of the Bootloader stage, the kernel startup stage, and the Android system startup stage. Then, the log partition storage location data is determined according to the partition storage space data, that is, the starting and ending positions of the partition storage are determined, and the file system configuration file Fstab data is obtained. The mount mode and file system format are set in combination with the log partition storage location data, and then log redirection is performed. In order to ensure that the device can store and send logs of each stage to the server or OEM during the upgrade, it is necessary to first determine the upgrade network preparation status. Only when the upgrade network is ready can the upgrade program be started, and the log partition storage is obtained to obtain the upgrade log package, and the device upgrade status is obtained. If the upgrade fails, the upgrade log data packet is analyzed to obtain a solution, and the device performs a new system upgrade through U-boot according to the solution.

[0066] Please refer to Figure 2 , Figure 2 This is a flowchart of determining log partition storage location data of a bricking self-rescue method based on an Android system provided by an embodiment of the present application. According to an embodiment of the present invention, the acquisition of stage storage requirement data during the device startup process, obtaining log partition space data according to the stage storage requirement data and the preset storage period data processing, and determining log partition storage location data according to the log partition space data specifically include:

[0067] S21, obtaining the stage storage requirement data during the device startup process, including the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, and the Android system startup stage storage requirement data;

[0068] S22, inputting the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, the Android system startup stage storage requirement data and the preset storage period data into the preset partition storage space evaluation model for processing, and obtaining the log partition space data;

[0069] S23. Determine log partition storage position data according to the log partition space data, including log partition storage start position data and log partition storage end position data.

[0070] It should be noted that there are three stages in the device startup process, and the log volume size of each stage is different. In order to determine the space size required for partition storage, it is necessary to obtain the storage requirement data of the Bootloader stage, the storage requirement data of the kernel startup stage and the storage requirement data of the Android system startup stage respectively. The Bootloader stage storage requirement data refers to the storage space size data required for generating logs in the Bootloader stage, the kernel startup stage storage requirement data refers to the storage space size data required for generating logs in the kernel startup stage, and the Android system startup stage storage requirement data refers to the storage space size data required for generating logs in the Android system startup stage; the Bootloader stage is an important stage in the operating system startup process, and its main function is to load the operating system kernel into the memory and set necessary startup parameters for it; the preset storage cycle data refers to the number of device startup logs to be stored in the partition storage space, that is, the partition storage space is cyclically updated when storing logs. In this example, the storage cycle data is set to 5 times, that is, when the sixth startup and log storage are performed, the stored first startup log will be deleted; the preset partition storage space evaluation model is a calculation model obtained by training based on historical data, and the log partition space data can be calculated through this model;

[0071] The calculation formula for log partition space data in the partition storage space evaluation model is:

[0072]

[0073] Among them, F k is the log partition space data, Z q , B j 、N j , A j They are storage cycle data, Bootloader stage storage requirement data, kernel startup stage storage requirement data, and Android system startup stage storage requirement data, and α, β1, β2, and β3 are preset characteristic coefficients respectively;

[0074] The log partition space data refers to the space size data of the log partition storage area. The log partition storage location data is determined according to the log partition space data in accordance with a preset storage space distinction method. The log partition storage location data is the data of the location where the partition is stored in the entire storage space.

[0075] Please refer to Figure 3 , Figure 3This is a flowchart of setting the mount mode and file system format of a bricking self-rescue method based on an Android system provided by an embodiment of the present application. According to an embodiment of the present invention, the method of obtaining the file system configuration file Fstab data and setting the mount mode and file system format according to the log partition storage location data specifically includes:

[0076] S31, obtaining the file system configuration file Fstab data, and setting the mount point data of the log partition in combination with the log partition storage start position data and the log partition storage end position data;

[0077] S32. Set the file system format of the log partition to ext4.

[0078] It should be noted that Fstab (File System Table) is a configuration file used to describe file system mounting information in Unix-like systems (including Linux and Android systems). It plays a vital role in the system startup process, mainly used to specify how the file system is mounted on the system directory tree at startup; the mount point indicates the location where the file system is mounted on the system directory tree; ext4 is the fourth generation extended file system (English: Fourth extended file system, abbreviated as ext4) is a log file system under the Linux system, and is the successor version of the ext3 file system.

[0079] Please refer to Figure 4 , Figure 4 This is a flow chart of log redirection based on a bricking self-rescue method of an Android system provided by an embodiment of the present application. According to an embodiment of the present invention, the log redirection according to the mounting method specifically includes:

[0080] S41, modify the configuration file data of the Bootloader, and redirect the Bootloader stage log information to the log partition;

[0081] S42, modify the log output function of the kernel startup phase, and redirect the log information of the kernel startup phase to the log partition;

[0082] S43. Adjust the log service configuration during the startup phase of the Android system, and redirect the log information during the startup phase of the Android system to the log partition.

[0083] It should be noted that log redirection is performed separately for the three key stages of Android device startup: bootloader stage, kernel startup stage, and Android system startup stage. In the Bootloader stage, the log information generated in this stage is written to the newly defined log partition by modifying the relevant code or configuration file of the Bootloader; for the kernel startup stage, the relevant log output function is found in the kernel source code, and the logs of the kernel startup stage are redirected to the log partition by modifying the parameters or logic of these functions; in the Android system startup stage, the log service configuration is adjusted to ensure that the logs of this stage can be accurately written to the log partition.

[0084] According to an embodiment of the present invention, the network performance status data is obtained, the upgrade network readiness status is obtained according to the network performance status data processing, and the upgrade program is started according to the upgrade network readiness status, and the upgrade log data packet is obtained after log partition storage, specifically including:

[0085] Acquire network performance status data, including wired network performance status data and wireless network performance status data;

[0086] Performing AND operation on the wired network performance status data and the wireless network performance status data to obtain upgrade network preparation status data, and determining the upgrade network preparation status according to the upgrade network preparation status data, including a ready status or a waiting-for-complete status;

[0087] If the upgrade network preparation status is ready, start the upgrade program according to the user instruction;

[0088] After starting the upgrade program, use the binary reading method to read the Bootloader phase log information, the kernel startup phase log information, and the Android system startup phase log information, and send them to the log partition storage location and mark them as upgrade log data packets;

[0089] Upload the upgrade log data package to the preset server.

[0090] It should be noted that in order to ensure that the device can store logs and upload them to the preset server when upgrading, it is necessary to ensure that the device can be in a network connection state. In order to ensure the reliability of the network connection, it is necessary to obtain the wired network performance status data and the wireless network performance status data at the same time; the wired network performance status data includes the wired available performance status data or the wired unavailable performance status data; the wireless network performance status data includes the wireless available performance status data or the wireless unavailable performance status data; the formula for performing AND operation on the wired network performance status data and the wireless network performance status data is:

[0091] S w =Y w &Ww ;

[0092] Among them, S w To upgrade network readiness data, Y w is the wired network performance status data, W w Wireless network performance status data;

[0093] In this embodiment, the wired available performance status data is 1, and the wired unavailable performance status data is 0; the wireless available performance status data is 1, and the wireless unavailable performance status data is 0, and when the upgrade network readiness status data is 1, it corresponds to the ready state; binary reading is used to read log data because binary reading can ensure the integrity and accuracy of the data and avoid errors caused by character encoding or text format conversion.

[0094] According to an embodiment of the present invention, the step of obtaining the device upgrade status and analyzing the upgrade log data packet according to the device upgrade status to obtain the solution data specifically includes:

[0095] Get the device upgrade status, including upgrade success or upgrade failure status;

[0096] If the device upgrade status is an upgrade failure status, the upgrade log data packet is analyzed by a preset log analysis neural network model;

[0097] The solution data corresponding to the upgrade failure state is obtained, where the solution data includes hardware solution data or software solution data.

[0098] It should be noted that there are two reasons for the failure of equipment upgrade, either hardware or software, so the solution will also give opinions around these two aspects; the log analysis neural network model is obtained after training with a large amount of historical data. By analyzing the upgrade log data packet through this model, the reason for the upgrade failure can be obtained, and then a solution can be proposed and sent to the user end.

[0099] According to an embodiment of the present invention, performing a new system upgrade through U-boot according to the solution data specifically includes:

[0100] Obtain the compatibility status of the U-boot version, and start U-boot according to the compatibility status;

[0101] Loading the hardware solution data or software solution data into the terminal management system through U-boot;

[0102] The device is re-upgraded according to the hardware solution data or the software solution data.

[0103] It should be noted that U-boot (Universal Boot Loader) is an open source boot loader widely used in embedded systems. Before U-boot is started, it is necessary to obtain the compatibility of the version and the device. Only when it is compatible can it be started. After starting, the hardware solution data or software solution data is loaded into the terminal management system through the preset loading method.

[0104] It is worth mentioning that when obtaining the upgrade network readiness, it also includes:

[0105] The upgraded network readiness data includes ready data or waiting-for-completion data;

[0106] If the upgrade network preparation status data is ready data, then the upgrade network preparation status is a ready state;

[0107] If the upgraded network preparation status data is data waiting to be completed, reacquiring the upgraded network preparation status data according to a preset time interval period;

[0108] Count the number of times data is waiting to be completed, and compare the number of times data is waiting to be completed with the preset network preparation number threshold to obtain the upgrade network preparation status;

[0109] If the number of waiting for data completion is greater than or equal to a preset network preparation number threshold, the upgrade network preparation status is a waiting for completion status.

[0110] It should be noted that when judging the upgrade network readiness status, when the wired network and the wireless network are well prepared, the readiness status data can be directly obtained; but sometimes due to some influencing factors, it is not reasonable to judge only once, and it is necessary to try again; therefore, if the upgrade network readiness status data is waiting for completion data, it is necessary to obtain the upgrade network readiness status data again after a preset time interval, and count the number of waiting for completion data, and then give the upgrade network readiness status after threshold comparison; in this embodiment, the time interval is 1 minute, and the network preparation number threshold is set to 3. When the number of waiting for completion status is greater than or equal to 3, it means that the data is waiting to be completed within the preset time period, so the upgrade network readiness status is waiting for completion status; if the upgrade network readiness status data is ready data, the upgrade network readiness status is directly determined to be ready status.

[0111] The present invention also discloses a bricking self-rescue system based on an Android system, comprising a memory and a processor, wherein the memory stores a bricking self-rescue method program based on an Android system, and when the bricking self-rescue method program based on an Android system is executed by the processor, the following steps are implemented:

[0112] Acquire the stage storage requirement data during the device startup process, obtain the log partition space data according to the stage storage requirement data and the preset storage period data, and determine the log partition storage location data according to the log partition space data;

[0113] Obtain the file system configuration file Fstab data, and set the mounting mode and file system format according to the log partition storage location data;

[0114] Redirect logs according to the mounting method;

[0115] Acquire network performance status data, obtain the upgrade network readiness status according to the network performance status data processing, start the upgrade program according to the upgrade network readiness status, and obtain the upgrade log data packet after log partition storage;

[0116] Obtain the device upgrade status, and analyze the upgrade log data packet according to the device upgrade status to obtain solution data;

[0117] Perform a new system upgrade through U-boot according to the solution data.

[0118] It should be noted that the device refers to an Android-based device. During the device startup process, it needs to go through three stages, namely the Bootloader stage, the kernel startup stage, and the Android system startup stage. These three stages all affect whether the device can be upgraded successfully. Once the device upgrade fails, in order to determine which stage is the cause, the log data of the three stages will be stored separately to facilitate subsequent reading and analysis. In order to facilitate the retrieval of the stored log data, separate partition storage is required. Before partition storage, the size of the partition storage space needs to be determined according to the log size and preset storage cycle data of the Bootloader stage, the kernel startup stage, and the Android system startup stage. Then, the log partition storage location data is determined according to the partition storage space data, that is, the starting and ending positions of the partition storage are determined, and the file system configuration file Fstab data is obtained. The mount mode and file system format are set in combination with the log partition storage location data, and then log redirection is performed. In order to ensure that the device can store and send logs of each stage to the server or OEM during the upgrade, it is necessary to first determine the upgrade network preparation status. Only when the upgrade network is ready can the upgrade program be started, and the log partition storage is obtained to obtain the upgrade log package, and the device upgrade status is obtained. If the upgrade fails, the upgrade log data packet is analyzed to obtain a solution, and the device performs a new system upgrade through U-boot according to the solution.

[0119] According to an embodiment of the present invention, the step of obtaining the stage storage requirement data during the device startup process, obtaining the log partition space data according to the stage storage requirement data and the preset storage period data, and determining the log partition storage location data according to the log partition space data specifically includes:

[0120] Obtain the stage storage requirement data during the device startup process, including the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, and the Android system startup stage storage requirement data;

[0121] Input the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, the Android system startup stage storage requirement data and the preset storage period data into the preset partition storage space evaluation model for processing, and obtain the log partition space data;

[0122] The log partition storage position data is determined according to the log partition space data, including the log partition storage start position data and the log partition storage end position data.

[0123] It should be noted that there are three stages in the device startup process, and the log volume size of each stage is different. In order to determine the space size required for partition storage, it is necessary to obtain the storage requirement data of the Bootloader stage, the storage requirement data of the kernel startup stage and the storage requirement data of the Android system startup stage respectively. The Bootloader stage storage requirement data refers to the storage space size data required for generating logs in the Bootloader stage, the kernel startup stage storage requirement data refers to the storage space size data required for generating logs in the kernel startup stage, and the Android system startup stage storage requirement data refers to the storage space size data required for generating logs in the Android system startup stage; the Bootloader stage is an important stage in the operating system startup process, and its main function is to load the operating system kernel into the memory and set necessary startup parameters for it; the preset storage cycle data refers to the number of device startup logs to be stored in the partition storage space, that is, the partition storage space is cyclically updated when storing logs. In this example, the storage cycle data is set to 5 times, that is, when the sixth startup and log storage are performed, the stored first startup log will be deleted; the preset partition storage space evaluation model is a calculation model obtained by training based on historical data, and the log partition space data can be calculated through this model;

[0124] The calculation formula for log partition space data in the partition storage space evaluation model is:

[0125]

[0126] Among them, F k is the log partition space data, Zq , B j 、N j , A j They are storage cycle data, Bootloader stage storage requirement data, kernel startup stage storage requirement data, and Android system startup stage storage requirement data, and α, β1, β2, and β3 are preset characteristic coefficients respectively;

[0127] The log partition space data refers to the space size data of the log partition storage area. The log partition storage location data is determined according to the log partition space data according to a preset storage space distinction method. The log partition storage location data is the data of the location where the partition is stored in the entire storage space.

[0128] According to an embodiment of the present invention, obtaining the file system configuration file Fstab data and setting the mounting mode and the file system format according to the log partition storage location data specifically includes:

[0129] Get the file system configuration file Fstab data, and set the mount point data of the log partition in combination with the log partition storage start position data and log partition storage end position data;

[0130] Set the file system format of the journal partition to ext4.

[0131] It should be noted that Fstab (File System Table) is a configuration file used to describe file system mounting information in Unix-like systems (including Linux and Android systems). It plays a vital role in the system startup process, mainly used to specify how the file system is mounted on the system directory tree at startup; the mount point indicates the location where the file system is mounted on the system directory tree; ext4 is the fourth generation extended file system (English: Fourth extended file system, abbreviated as ext4) is a log file system under the Linux system, and is the successor of the ext3 file system.

[0132] According to an embodiment of the present invention, the log redirection according to the mounting mode specifically includes:

[0133] Modify the Bootloader configuration file data to redirect the Bootloader stage log information to the log partition;

[0134] Modify the log output function of the kernel startup phase to redirect the kernel startup phase log information to the log partition;

[0135] Adjust the log service configuration during the Android system startup phase and redirect the log information during the Android system startup phase to the log partition.

[0136] It should be noted that log redirection is performed separately for the three key stages of Android device startup: bootloader stage, kernel startup stage, and Android system startup stage. In the Bootloader stage, the log information generated in this stage is written to the newly defined log partition by modifying the relevant code or configuration file of the Bootloader; for the kernel startup stage, the relevant log output function is found in the kernel source code, and the logs of the kernel startup stage are redirected to the log partition by modifying the parameters or logic of these functions; in the Android system startup stage, the log service configuration is adjusted to ensure that the logs of this stage can be accurately written to the log partition.

[0137] According to an embodiment of the present invention, the network performance status data is obtained, the upgrade network readiness status is obtained according to the network performance status data processing, and the upgrade program is started according to the upgrade network readiness status, and the upgrade log data packet is obtained after log partition storage, specifically including:

[0138] Acquire network performance status data, including wired network performance status data and wireless network performance status data;

[0139] Performing AND operation on the wired network performance status data and the wireless network performance status data to obtain upgrade network preparation status data, and determining the upgrade network preparation status according to the upgrade network preparation status data, including a ready status or a waiting-for-complete status;

[0140] If the upgrade network preparation status is ready, start the upgrade program according to the user instruction;

[0141] After starting the upgrade program, use the binary reading method to read the Bootloader phase log information, the kernel startup phase log information, and the Android system startup phase log information, and send them to the log partition storage location and mark them as upgrade log data packets;

[0142] Upload the upgrade log data package to the preset server.

[0143] It should be noted that in order to ensure that the device can store logs and upload them to the preset server when upgrading, it is necessary to ensure that the device can be in a network connection state. In order to ensure the reliability of the network connection, it is necessary to obtain the wired network performance status data and the wireless network performance status data at the same time; the wired network performance status data includes the wired available performance status data or the wired unavailable performance status data; the wireless network performance status data includes the wireless available performance status data or the wireless unavailable performance status data; the formula for performing AND operation on the wired network performance status data and the wireless network performance status data is:

[0144] S w =Yw &W w ;

[0145] Among them, S w To upgrade network readiness data, Y w is the wired network performance status data, W w Wireless network performance status data;

[0146] In this embodiment, the wired available performance status data is 1, and the wired unavailable performance status data is 0; the wireless available performance status data is 1, and the wireless unavailable performance status data is 0, and when the upgrade network readiness status data is 1, it corresponds to the ready state; binary reading is used to read log data because binary reading can ensure the integrity and accuracy of the data and avoid errors caused by character encoding or text format conversion.

[0147] According to an embodiment of the present invention, the step of obtaining the device upgrade status and analyzing the upgrade log data packet according to the device upgrade status to obtain the solution data specifically includes:

[0148] Get the device upgrade status, including upgrade success or upgrade failure status;

[0149] If the device upgrade status is an upgrade failure status, the upgrade log data packet is analyzed by a preset log analysis neural network model;

[0150] The solution data corresponding to the upgrade failure state is obtained, where the solution data includes hardware solution data or software solution data.

[0151] It should be noted that there are two reasons for the failure of equipment upgrade, either hardware or software, so the solution will also give opinions around these two aspects; the log analysis neural network model is obtained after training with a large amount of historical data. By analyzing the upgrade log data packet through this model, the reason for the upgrade failure can be obtained, and then a solution can be proposed and sent to the user end.

[0152] According to an embodiment of the present invention, performing a new system upgrade through U-boot according to the solution data specifically includes:

[0153] Obtain the compatibility status of the U-boot version, and start U-boot according to the compatibility status;

[0154] Loading the hardware solution data or software solution data into the terminal management system through U-boot;

[0155] The device is re-upgraded according to the hardware solution data or the software solution data.

[0156] It should be noted that U-boot (Universal Boot Loader) is an open source boot loader widely used in embedded systems. Before U-boot is started, it is necessary to obtain the compatibility of the version and the device. Only when it is compatible can it be started. After starting, the hardware solution data or software solution data is loaded into the terminal management system through the preset loading method.

[0157] It is worth mentioning that when obtaining the upgrade network readiness, it also includes:

[0158] The upgraded network readiness data includes ready data or waiting-for-completion data;

[0159] If the upgrade network preparation status data is ready data, then the upgrade network preparation status is a ready state;

[0160] If the upgraded network preparation status data is data waiting to be completed, reacquiring the upgraded network preparation status data according to a preset time interval period;

[0161] Count the number of times data is waiting to be completed, and compare the number of times data is waiting to be completed with the preset network preparation number threshold to obtain the upgrade network preparation status;

[0162] If the number of waiting for data completion is greater than or equal to a preset network preparation number threshold, the upgrade network preparation status is a waiting for completion status.

[0163] It should be noted that when judging the upgrade network readiness status, when the wired network and the wireless network are well prepared, the readiness status data can be directly obtained; but sometimes due to some influencing factors, it is not reasonable to judge only once, and it is necessary to try again; therefore, if the upgrade network readiness status data is waiting for completion data, it is necessary to obtain the upgrade network readiness status data again after a preset time interval, and count the number of waiting for completion data, and then give the upgrade network readiness status after threshold comparison; in this embodiment, the time interval is 1 minute, and the network preparation number threshold is set to 3. When the number of waiting for completion status is greater than or equal to 3, it means that the data is waiting to be completed within the preset time period, so the upgrade network readiness status is waiting for completion status; if the upgrade network readiness status data is ready data, the upgrade network readiness status is directly determined to be ready status.

[0164] A third aspect of the present invention provides a readable storage medium, which includes a bricking self-rescue method program based on the Android system. When the bricking self-rescue method program based on the Android system is executed by a processor, the steps of the bricking self-rescue method based on the Android system as described in any one of the above items are implemented.

[0165] The present invention discloses a bricking self-rescue method, system and medium based on the Android system. After acquiring stage storage demand data, the data is processed with preset storage period data to obtain log partition space data, and the log partition storage position data is determined according to the log partition space data, and the file system configuration file Fstab data is acquired. The mounting mode and file system format are set according to the log partition storage position data, and then log redirection is performed. The upgrade network preparation status is obtained according to the network performance status data processing, and then the upgrade program is started to obtain an upgrade log data packet. The upgrade log data packet is analyzed according to the device upgrade status to obtain solution data, and finally the device is upgraded to a new system according to the solution data; thereby, the solution data after the device is bricked is obtained by acquiring the log partition storage position, uploading the log partition and analyzing the upgrade log data packet, and the bricking self-rescue technology is realized.

[0166] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.

[0167] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0168] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0169] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0170] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A bricking self-rescue method based on Android system, characterized in that: include: Acquire the stage storage requirement data during the device startup process, obtain the log partition space data according to the stage storage requirement data and the preset storage period data, and determine the log partition storage location data according to the log partition space data; Obtain the file system configuration file Fstab data, and set the mounting mode and file system format according to the log partition storage location data; Redirect logs according to the mounting method; Acquire network performance status data, obtain the upgrade network readiness status according to the network performance status data processing, start the upgrade program according to the upgrade network readiness status, and obtain the upgrade log data packet after log partition storage; Obtain the device upgrade status, and analyze the upgrade log data packet according to the device upgrade status to obtain solution data; Perform a new system upgrade through U-boot according to the solution data.

2. The bricking self-rescue method based on the Android system according to claim 1 is characterized in that: The step of obtaining the stage storage requirement data during the device startup process, obtaining the log partition space data according to the stage storage requirement data and the preset storage period data, and determining the log partition storage location data according to the log partition space data specifically includes: Obtain the stage storage requirement data during the device startup process, including the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, and the Android system startup stage storage requirement data; Input the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, the Android system startup stage storage requirement data and the preset storage period data into the preset partition storage space evaluation model for processing, and obtain the log partition space data; The log partition storage position data is determined according to the log partition space data, including the log partition storage start position data and the log partition storage end position data.

3. The bricking self-rescue method based on the Android system according to claim 2 is characterized in that: The step of obtaining the file system configuration file Fstab data and setting the mounting mode and the file system format according to the log partition storage location data specifically includes: Get the file system configuration file Fstab data, and set the mount point data of the log partition in combination with the log partition storage start position data and log partition storage end position data; Set the file system format of the journal partition to ext4.

4. The bricking self-rescue method based on the Android system according to claim 3 is characterized in that: The log redirection according to the mounting method specifically includes: Modify the Bootloader configuration file data to redirect the Bootloader stage log information to the log partition; Modify the log output function of the kernel startup phase to redirect the kernel startup phase log information to the log partition; Adjust the log service configuration during the Android system startup phase and redirect the log information during the Android system startup phase to the log partition.

5. The bricking self-rescue method based on the Android system according to claim 4 is characterized in that: The obtaining of network performance status data, obtaining an upgrade network readiness status according to the network performance status data processing, starting an upgrade program according to the upgrade network readiness status, and obtaining an upgrade log data packet after log partition storage specifically includes: Acquire network performance status data, including wired network performance status data and wireless network performance status data; Performing AND operation on the wired network performance status data and the wireless network performance status data to obtain upgrade network preparation status data, and determining the upgrade network preparation status according to the upgrade network preparation status data, including a ready status or a waiting-for-complete status; If the upgrade network preparation status is ready, start the upgrade program according to the user instruction; After starting the upgrade program, use the binary reading method to read the Bootloader phase log information, the kernel startup phase log information, and the Android system startup phase log information, and send them to the log partition storage location and mark them as upgrade log data packets; Upload the upgrade log data package to the preset server.

6. The bricking self-rescue method based on the Android system according to claim 5 is characterized in that: The obtaining of the device upgrade status and analyzing the upgrade log data packet according to the device upgrade status to obtain the solution data specifically includes: Get the device upgrade status, including upgrade success or upgrade failure status; If the device upgrade status is an upgrade failure status, the upgrade log data packet is analyzed by a preset log analysis neural network model; The solution data corresponding to the upgrade failure state is obtained, where the solution data includes hardware solution data or software solution data.

7. The bricking self-rescue method based on the Android system according to claim 6 is characterized in that: The new system upgrade is performed through U-boot according to the solution data, specifically including: Obtain the compatibility status of the U-boot version, and start U-boot according to the compatibility status; Loading the hardware solution data or software solution data into the terminal management system through U-boot; The device is re-upgraded according to the hardware solution data or the software solution data.

8. A brick-recovery self-help system based on Android system, characterized in that: The device comprises a memory and a processor, wherein the memory comprises a brick self-rescue method program based on an Android system, and the brick self-rescue method program based on an Android system is executed by the processor to implement the following steps: Acquire the stage storage requirement data during the device startup process, obtain the log partition space data according to the stage storage requirement data and the preset storage period data, and determine the log partition storage location data according to the log partition space data; Obtain the file system configuration file Fstab data, and set the mounting mode and file system format according to the log partition storage location data; Redirect logs according to the mounting method; Acquire network performance status data, obtain the upgrade network readiness status according to the network performance status data processing, start the upgrade program according to the upgrade network readiness status, and obtain the upgrade log data packet after log partition storage; Obtain the device upgrade status, and analyze the upgrade log data packet according to the device upgrade status to obtain solution data; Perform a new system upgrade through U-boot according to the solution data.

9. The brick-changing self-rescue system based on Android system according to claim 8, characterized in that: The step of obtaining the stage storage requirement data during the device startup process, obtaining the log partition space data according to the stage storage requirement data and the preset storage period data, and determining the log partition storage location data according to the log partition space data specifically includes: Obtain the stage storage requirement data during the device startup process, including the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, and the Android system startup stage storage requirement data; Input the Bootloader stage storage requirement data, the kernel startup stage storage requirement data, the Android system startup stage storage requirement data and the preset storage period data into the preset partition storage space evaluation model for processing, and obtain the log partition space data; The log partition storage position data is determined according to the log partition space data, including the log partition storage start position data and the log partition storage end position data.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a bricking self-rescue method program based on the Android system. When the bricking self-rescue method program based on the Android system is executed by the processor, the steps of the bricking self-rescue method based on the Android system as described in any one of claims 1 to 7 are implemented.