CN117290164A - Information recording method at restarting, electronic device and readable storage medium - Google Patents

Information recording method at restarting, electronic device and readable storage medium Download PDF

Info

Publication number
CN117290164A
CN117290164A CN202311561498.4A CN202311561498A CN117290164A CN 117290164 A CN117290164 A CN 117290164A CN 202311561498 A CN202311561498 A CN 202311561498A CN 117290164 A CN117290164 A CN 117290164A
Authority
CN
China
Prior art keywords
restart
target
target information
information
record identifier
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311561498.4A
Other languages
Chinese (zh)
Other versions
CN117290164B (en
Inventor
刘彦平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202311561498.4A priority Critical patent/CN117290164B/en
Publication of CN117290164A publication Critical patent/CN117290164A/en
Application granted granted Critical
Publication of CN117290164B publication Critical patent/CN117290164B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3438Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment monitoring of user actions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3466Performance evaluation by tracing or monitoring
    • G06F11/3476Data logging

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Retry When Errors Occur (AREA)

Abstract

The application discloses an information recording method, electronic equipment and a readable storage medium during restarting. The method comprises the following steps: before a restart event occurs to a restart target, under the condition that the restart target is detected to generate first target information, starting a recording operation of the first target information; the restart event includes a closing operation on the restart target, and a starting operation on the restart target performed after the closing operation; updating a first record identifier according to the completion condition of the record operation of the first target information; after detecting that the restart target executes the closing operation in the restart event, updating a second record identifier according to the updated first record identifier; and finishing the recording operation of the first target information according to the updated second record identifier. The embodiment of the application can improve the success rate of information recording during restarting.

Description

Information recording method at restarting, electronic device and readable storage medium
Technical Field
The present invention relates to the field of terminal technologies, and in particular, to an information recording method, an electronic device, and a readable storage medium during restarting.
Background
During operation, an electronic device such as a computer or other device may restart (i.e., reboot) due to a failure or receipt of an instruction or the like. Meanwhile, the software module running on the electronic device may be restarted due to failure, response to a user instruction, and the like. When the electronic device is restarted, the memory is cleared and the operating system and other software programs are reloaded. When the software module is restarted, the running process or thread of the software module is also closed, and the currently running task is stopped. Thus, when a restart event occurs in a restart target such as an electronic device or a software module, there may be some related information, such as a restart reason, failure information when restarting due to failure, etc., and effective records may not be obtained due to the restart.
Disclosure of Invention
The application provides an information recording method, electronic equipment and a readable storage medium during restarting. The technical proposal is as follows:
in a first aspect, an information recording method during restarting is provided, including: before a restart event occurs to a restart target, under the condition that the restart target is detected to generate first target information, starting a recording operation of the first target information; the restart event includes a shutdown operation of the restart target, and a startup operation of the restart target performed after the shutdown operation; since the first target information may not be recorded until the closing operation of the restart event is completed, or the recording in a single recording operation fails, after the recording operation of the first target information is triggered, the first recording identifier is updated according to the completion of the recording operation of the first target information; the updated first record identifier may indicate that the first target information has been successfully recorded or has not been successfully recorded; the restarting event of the restarting target is not stopped due to the recording operation of the first target and the updating operation of the first record identifier, and after the restarting target is detected to execute the closing operation in the restarting event, the second record identifier is updated according to the updated first record identifier; and after the closing operation of the restart event, using the updated second record identifier to represent the record condition of the first target information, and then completing the record operation of the first target information according to the updated second record identifier in the remaining time of the restart event of the restart target and in the running time after the completion of the starting operation of the restart event of the restart target.
In general, the restart event includes a closing operation of the restart target and a starting operation of the restart target, where the closing operation of the restart event and the starting operation of the restart event are both advanced layer by layer. For example, in the case where the restart target is an electronic device running an operating system and a program, the shutdown operation includes a layer-by-layer shutdown operation from an application layer to a hardware layer; the start-up operation includes a layer-by-layer start-up operation from the hardware layer to the application layer.
In the embodiment of the application, at least two sets of record identifiers, namely a first record identifier and a second record identifier, are set. The first record indicates a record condition of first target information generated before the restart event occurs, and the updated second record identifier is used for indicating the record condition of the first target information after the shutdown operation of the restart event. Therefore, after the closing operation of the restarting event of the restarting target occurs, the recording condition of the first target information generated before the closing operation of the restarting event occurs can be checked, and according to the updated second record identifier, after the closing operation of the restarting event occurs, the recording operation is continuously performed on the first target information, and finally the recording operation on the first target information is completed. Furthermore, the first target information generated by the restart target before the closing operation of the restart event can not be effectively recorded due to the occurrence of the restart event, and the success rate of recording the first target information is improved.
In this embodiment of the present application, according to a completion of a recording operation on first target information, updating a first record identifier includes: in the case that the restart target does not generate the first target information, updating the first record identification to represent: a state in which the restart target does not generate the first target information and the recording operation on the first target information is not completed; in the case that the restart target generates the first target information and the recording operation on the first target information is not completed, the first record identification is updated to represent: restarting the target generates first target information, and recording operation of the first target information is not completed; in the case that the restart target generates the first target information and the recording operation of the first target information is completed, the first record identification is updated to represent: restarting the target generates first target information, and a recording operation of the first target information is completed.
In the embodiment of the present application, the completion of the recording operation of the first target information may include a plurality of types, one of which is: indicating that the restart target did not generate the first target information prior to the shutdown operation of the restart event. For example, the first target information is failure information, but the restart target simply generates a restart event due to the user's mistaken touch of the restart button, so that the restart target does not generate failure information before restarting, and the first target information (i.e. failure information) does not need to be recorded. In this case, the first record identification may be made to indicate that the restart target did not generate the first target information before the restart event. Because the restart target does not generate the first target information before the restart event, the recording operation of the first target information does not occur, and the recording operation of the first target information is not necessarily completed, so that the updated first record identifier may also indicate that the recording operation of the first target information is not completed. After the second record identifier is updated according to the updated first record identifier, by reading the updated second record identifier, it can be determined that the first target information is not generated before the restart, and the recording operation of the first target information is not completed, so that after the closing operation of the restart event, unnecessary recording operation of the first target information is not executed.
If the target information is generated by the restart target before the shutdown operation of the restart event, the target information of the restart target is saved and recorded before the shutdown operation of the restart event, wherein the target information comprises the first target information and the second target information. The first target information may or may not be successfully recorded prior to the shutdown operation of the restart event. Thus, two other possible states of the first target information include: indicating that the restart target generates the first target information, but the recording operation of the first target information is not completed; alternatively, it is indicated that the restart target generates the first target information, but the recording operation of the first target information is completed. If the first record identifier indicates that the restart target generates the first target information before the closing operation of the restart event, but the recording operation on the first target information is not completed, after updating the second record identifier according to the first record identifier, it can be known from the updated second record identifier that the recording operation on the first target information still needs to be continuously performed after the closing operation of the restart event, and possibly even in the restart target operation stage after the restart event. If the first record identifier indicates that the restart target generates the first target information before the closing operation of the restart event, but the recording operation on the first target information is completed, after the second record identifier is updated according to the updated first record identifier, the first target information is known to have been successfully recorded according to the updated second record identifier, and then the first target information does not need to be recorded again after the closing operation of the restart event, so that the first target information is not repeatedly recorded.
In the restarting target starting or running process after the closing operation of the restarting event, the embodiment of the application reads the updated second record identifier, and completes the recording operation on the first target information system according to the updated second record identifier. In one embodiment, the recording operation of the first target information is completed according to the updated second record identifier, including: acquiring an proceeding stage of a restarting event, wherein the proceeding stage is one of a plurality of stages formed by dividing the restarting process in advance; reading the updated second record identifier according to the current progress stage of the restarting event; and restarting the recording operation of the first target information under the condition that the updated second record identification indicates that the first target information is not recorded.
In general, the recording operation of the first target information includes transferring the first target information from a first storage location of the restart target to a second storage location of the restart target, where the first storage location is typically a temporary storage location and the second storage location is typically a persistent storage location. If the first target information is generated before the restart event and the recording is not completed before the closing operation of the restart event occurs, then when the recording operation of the first target information is continued to be performed according to the updated second record identifier after the closing operation of the restart event occurs, the recording operation of the first target information may still be unsuccessful for some reasons. Therefore, in the embodiment of the present application, for the same target information, the completion of the recording operation of the target information may be detected at the start operation of the restart event and at different subsequent stages. If the recording of the previous proceeding stage fails, the recording can still be performed in the next proceeding stage until the (first) target information is successfully recorded, thereby greatly improving the accuracy and success probability of the recording operation of the target information.
For the case that the first target information is successfully recorded after the closing operation of the restart event, the information recording method at the restart time provided by the embodiment of the application further includes: in the case that the restarted recording operation for the first target information is completed, the updated second record identification is updated again to indicate that the recording operation for the first target information is completed.
If the recording operation of the first target information needs to be restarted according to the updated second record identifier, the recording operation of the first target information transferred from the first designated position to the second designated position before the closing operation of the restarting event of the restarting target is failed, the second designated position is not recorded at the second designated position when the starting operation of the restarting event occurs, and the updated second record identifier should indicate that the restarting target generates the first target information and the first target information is not successfully recorded.
Therefore, after the closing operation of the restarting event, if the recording operation of the first target information is completed, the second record identifier is correspondingly changed, so that the second record identifier can dynamically represent the recording condition of the first target information, and the second record identifier is changed according to the completion condition of the recording operation of the first target information.
In one implementation, the information recording method at the time of restarting further includes: in the event that the restarted recording operation of the first target information is not complete, the second record identification is maintained as representing: the state of the incomplete record of the first target information, namely, the state that the second record mark after the update is maintained as updated according to the first record mark after the update; and returning to the step of reading the updated second record identifier according to the proceeding stage.
In this embodiment of the present invention, if after the closing operation at the time of restarting, the first target information still has no one-time successful record, then the second record identifier is kept unchanged after being updated according to the first record identifier, so that the current second record identifier still indicates that the first target information is generated, the recording operation on the first target information is not completed, and the second record identifier is dynamically changed according to the recording condition of the first target information, so that in a plurality of proceeding stages of the starting operation of the restarting event, the recording condition of the first target information can be detected multiple times according to the read second record identifier, and the recording operation on the first target information is repeated until the first target information is successfully recorded under the condition that the first target information is not successfully recorded.
In one embodiment, according to the proceeding stage, reading the updated second record identifier includes: and when the stage is changed, reading the updated second record identifier. Meanwhile, in other possible implementations, the second record identifier updated according to the updated first record identifier may also be read at a specific one or more proceeding stages.
After the closing operation of the restart event of the restart target is completed, since the first target information may still not be successfully recorded in one recording operation, repeated recording of the first target information may be required to ensure that the first target information is saved, and thus, repeated checking is required as to whether the recording operation of the first target information is successfully performed. Since the record state of the first target information has a direct association relationship with the updated second record identifier after the closing operation of the restart event, in the embodiment of the present application, a plurality of time nodes for reading the updated second record identifier are set, and when the set time node is reached, the updated second record identifier is read for a plurality of times, so as to confirm the record condition of the first target information.
In one embodiment, in the case where the restart target is an electronic device, the performing stage includes: a first stage of starting loading, a second stage of starting loading, a kernel layer starting stage, an application framework layer starting stage and an application layer starting stage; updating the second record identifier according to the first record identifier, including: in the first stage of starting loading, the second record identifier is updated according to the first record identifier.
In this embodiment of the present application, the restart target may be a computer or an electronic device with an operation function, and the restart event is a restart of an operating system of the electronic device for the electronic device with the operation function. During the restart of the operating system, the startup process proceeds layer by layer from the hardware layer of the electronic device to the application layer at the top layer. Thus, the progress phase may be determined according to the characteristic that the start-up operation of the operating system of the electronic device is performed layer by layer.
In one embodiment, after updating the second record identifier according to the first record identifier, the method further comprises: resetting the first record identifier; before the restart target generates a restart event again, under the condition that the restart target generates second target information, starting a recording operation of the second target information; and updating the reset first record identification according to the completion condition of the record operation of the second target information.
In this embodiment of the present application, after updating the second record identifier according to the updated first record identifier, the updated first record identifier may be cleared, so that the first record identifier is reset to the original content, and is restored to the state before the first target information is generated. Then, after the restart target performs the shutdown operation of the restart event, in the process of restarting the operation, the first record identifier after the reset may be used to record other similar target information (such as the second target information) generated in the process of restarting the restart target.
In one embodiment, the first target information is failure information of the restart target.
Because the method for recording the target information in multiple stages is used in the embodiment of the application, the success rate of target information recording can be improved, and therefore, important information, such as fault information, possibly generated in the running process of the target can be recorded through the method provided by the embodiment of the application.
In one embodiment, the restart target is a target electronic device, and may be a software module or application.
The electronic device may be a computer, or a special device with a computer function, such as an auxiliary device such as an intelligent home appliance, an intelligent production device, an electronic book, or a server.
In a second aspect, a computer readable storage medium is provided, in which instructions are stored which, when executed on a computer, enable the computer to perform the method of determining location information of the first aspect described above.
In a third aspect, there is provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of determining location information of the first aspect described above.
The technical effects obtained by the second and third aspects are similar to the technical effects obtained by the corresponding technical means in the first aspect, and are not described in detail herein.
Drawings
Fig. 1 is a schematic view of an application scenario in an embodiment of the present application;
fig. 2 is a schematic diagram of another application scenario in an embodiment of the present application;
fig. 3 is a schematic view of another application scenario according to an embodiment of the present application;
fig. 4 is a schematic software structure of an electronic device according to an embodiment of the present application;
fig. 5 is a schematic flow chart of an information recording method during restarting according to an embodiment of the present application;
FIG. 6 is a schematic diagram showing correspondence between a progress stage and an information recording operation in an example of the present application;
FIG. 7 is a schematic diagram of a synchronization flow of a first record identifier and a second record identifier in an example of the present application;
FIG. 8 is a schematic flow chart of an implementation of the operation exception handling step in one example of the present application;
FIG. 9 is a schematic flow chart of an implementation of the restart anomaly detection step in an example of the present application;
FIG. 10 is a schematic diagram of an information recording method at restarting in an example of the present application;
FIG. 11 is a schematic diagram of an information recording method at restarting in another example of the present application;
FIG. 12 is a schematic view showing the structure of an information recording apparatus at the time of restarting in one example of the present application;
fig. 13 is a schematic diagram showing a structure of an electronic device according to an exemplary embodiment.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that reference herein to "a plurality" means two or more. In the description of the present application, "/" means or, unless otherwise indicated, for example, a/B may represent a or B; "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In addition, for the purpose of facilitating the clear description of the technical solutions of the present application, the words "first", "second", etc. are used to distinguish between the same item or similar items having substantially the same function and effect. It will be appreciated by those of skill in the art that the words "first," "second," and the like do not limit the amount and order of execution, and that the words "first," "second," and the like do not necessarily differ.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
With the rapid development of computer technology, electronic devices can be applied to aspects of people's work and life. For example, terminal electronic devices, including mobile phones, notebook computers, tablet computers, desktop computers, intelligent wearable devices, palm computers and the like, are tightly combined with daily life of people, and greatly facilitate clothing and eating of people. For another example, electronic devices of non-terminal type such as routers, servers, switches, databases, modems, etc. can assist users in the use of terminals and the behavior of people using terminals and networks is inseparable. For another example, with the continuous development of technology, not only production equipment has an automatic computing capability, but also household appliances such as refrigerators, air conditioners, washing machines, televisions and the like can store data and execute computer program instructions.
During startup or operation of an electronic device, a reboot may be required for some reason. For example, when the system is upgraded, the electronic device needs to be restarted to enable the updated system files and settings to be effective, and temporary files and caches in the memory can be cleared at the same time, so that the stability and the safety of the system are ensured. For another example, it is often necessary to restart the system after a software update to validate the updated software.
In addition, during the operation of the electronic device, software and hardware faults may occur, and when a fault occurs, the electronic device may be restarted automatically or according to a user instruction. In general, when an electronic device is restarted due to a failure, it is necessary to record the failure of the electronic device. In the restarting process, the system of the electronic device needs to shut down the currently running program, record the related data, and shut down the system service. During the restart process, the computer may shut down all running programs and services, restart the operating system and hardware devices, and because some forced shutdown operations of the restart target may occur in a short time during the restart, these forced shutdown operations may also cause failure information or other important information of the electronic device that occurs before the restart (i.e., the restart) event to be not recorded correctly, for example, failure information or abnormal information generated by the electronic device before the restart is not recorded completely, or failure information or abnormal information generated by the electronic device before the restart is not recorded but is recorded repeatedly, or the like.
When the electronic device is restarted for reasons other than a malfunction, it is also necessary to save the current state of the electronic device, the saved content including the program and data currently running, so that the state before the restart can be restored according to the saved content after the restart. However, since the process of restarting is short, and many programs and processes may be forced to stop and shut down during the restarting process, the information and data before restarting may not be saved effectively or correctly. It is therefore desirable to save information before the electronic device is restarted in an efficient manner.
Meanwhile, when the software or the application is restarted, a forced closing operation is also performed, which may cause data loss of the software or the application.
Fig. 1 is a schematic diagram of an application scenario of an information recording method at restart according to an embodiment of the present application. As shown in a of fig. 1, a user performs a network-related activity using a mobile phone, and in the process of using the network, the user needs to log in a user account, and after inputting the account name and the password of the user, face authentication is also required, and face recognition is performed using a camera of the mobile phone. Meanwhile, if a new account is registered or a password is forgotten, face verification is required, so that a camera is required to be started from an application interface of a mobile phone of a user to perform face recognition. Referring to b in fig. 1, in the face recognition scenario, the mobile phone automatically invokes the camera to start the face image acquisition function. In the process of calling the mobile phone camera, a camera calling failure occurs, so that the camera calling failure occurs, and therefore, the mobile phone of the user automatically restarts the system, enters a restarting interface shown as c in fig. 1, and restarts the camera through restarting, so that the normal use of the camera function is ensured.
Meanwhile, the mobile phone shown in fig. 1 processes a large amount of data or information at one time, so that the memory space of the mobile phone is insufficient, and then the mobile phone can enter an interface shown in c in fig. 1 for automatic restarting possibly due to the failure of an application program in the data processing process.
In addition, after the mobile phone shown in fig. 1 performs a system update and a software update, the mobile phone may restart according to a user instruction or automatically restart during the update process.
Fig. 2 is a schematic diagram of another application scenario of the information recording method at restarting according to the embodiment of the present application. The electronic device with internet function connects to the network server through the router 21 to perform network activity, such as the mobile phone 22 and the desktop computer 23 shown in fig. 2 to perform network information transceiving activity. When there is a problem in the communication link in which the user's electronic device is connected to the network through the router 21, the user's mobile phone 22 and desktop computer 23 may not be connected to the network, and thus a prompt interface that cannot be connected to the network may be displayed. The user may restart the router by closing the switch of the router 21 and then restarting the router 21. The user may also restart the router by unplugging the router 21 and then connecting the router 21 to the power supply. By restarting the router 21, the function of the router 21 for network connection can be restarted, and network connection dysfunction can be eliminated.
Fig. 3 is a schematic diagram of another scenario involved in the information recording method at the time of restarting according to the embodiment of the present application. In the scenario shown in fig. 3, the user uses the target application 31 on the terminal 32. When the target application 31 fails, the restart of the application will be automatically performed, and if the terminal 32 fails or other restart trigger events occur during the operation of the target application 31, the target application 31 will be forcibly closed and restarted. If a restart event occurs to the target application 31, the data and information related to the target application 31 may be saved less quickly due to the short duration of the restart event.
It should be noted that the foregoing several possible application scenarios are only exemplary, and other possible similar application scenarios may be included in the application, for example, an application scenario including a restart of an intelligent home appliance, a restart of a production device, a restart of a scientific research device, a restart of a printer, a restart of a server and a database, etc., where, in these similar scenarios, the method provided by the embodiments of the present application may be used to store the target information, and a specific implementation flow of the method may refer to the following embodiments.
Before describing the information recording method flow at the time of restarting provided in the embodiment of the present application in detail, a software architecture of the electronic device related to the embodiment of the present application is first described briefly, fig. 4 is a schematic diagram of a software architecture of an electronic device according to an exemplary embodiment, and the electronic device shown in fig. 4 is operated with an Android (Android) system.
Fig. 4 is a block diagram of a software system of an electronic device to which the method provided in the embodiment of the present application is applied. Referring to fig. 4, the layered architecture divides the software into several layers, each with a clear role and division of work. The layers communicate with each other through a software interface. In some embodiments, the Android system includes multiple layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system layers, and a kernel layer, respectively. When the restart event occurs, the shutdown operation and the startup operation of the restart event are performed layer by layer.
The application layer may include a series of application packages. As shown in fig. 4, the application packages may include desktop applications, cameras, gallery, phone calls, maps, navigation, bluetooth, music, video, etc. applications.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions. As shown in fig. 4, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like. The window manager is used for managing window programs. The content provider is used to store and retrieve data, which may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc., and make such data accessible to the application. The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build a display interface for an application. The telephony manager is used to provide communication functions of the electronic device, such as management of call status (including on, off, etc.). The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like. The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. When the method provided by the embodiment of the application is applied to the application, the restart event of the application can be divided into stages according to the sequence from the application framework layer to the application layer.
In this embodiment, when the application program is restarted, the current application program is closed, the thread of the application program running on the application program framework layer is terminated, the application layer recalls the program package and the function related to the application program, and the thread of the application program is restarted.
The system layer includes Android Runtime (Android run time). Android run time includes a core library and virtual machines. Android run is responsible for scheduling and management of the Android system. The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android. The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The kernel layer is a layer between hardware and software. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver. When the electronic equipment is restarted, the state of the kernel layer is monitored, so that the abnormality can be perceived and a restart event can occur. When the electronic device is restarted, a Bootloader firmware program below the kernel layer is started, and then the starting process sequentially goes from the kernel layer, the system library and the application framework layer to the application layer.
Based on the embodiment shown in fig. 4, a specific implementation of the information recording method at the time of restarting provided in the embodiment of the present application will be described next. The method provided in fig. 5 may also be applied to systems having other different layer structures. Fig. 5 is a flowchart illustrating a method for recording information at restart, which may be implemented by the above-described electronic device through interaction of a plurality of modules as shown in fig. 4, according to an exemplary embodiment. The method may include at least a portion or all of the following steps S51-S54.
Step S51, under the condition that the restart target is detected to generate first target information before the closing operation of the restart event of the restart target, starting the recording operation of the first target information; the restart event includes a shutdown operation for the restart target, and a startup operation for the restart target performed after the shutdown operation.
In this embodiment, the restart event may be caused by a certain restart trigger event, and the target information may be information of the restart trigger event. The restart trigger event may be an event that causes a restart of the restart target, also referred to as a restart trigger event. Such as software updates, system updates, computer downtime, software failures, hardware failures, etc. Similarly, the restart event in the embodiments of the present application is also referred to as a restart event.
The restart target may be an electronic device with a program running function, such as a terminal used by a user in daily life, including a mobile phone, a desktop computer, an intelligent wearable device, a vehicle-mounted computer, a notebook computer, a palm computer, and the like. The electronic device may also be a specialized device that incorporates an operational control function, such as an intelligent lock, an intelligent printing cabinet, an intelligent express delivery machine, an electronic album, an intelligent entertainment device, an audio-video player, an electronic book, a bluetooth headset, an intelligent sound box, an air cleaner, an intelligent air conditioner, an intelligent washing machine, an intelligent refrigerator, an intelligent light, an intelligent camera, and the like.
The restart target may also be a software module running on an electronic device with program running functionality. Such as video playback applications running on a cell phone, web browsing applications, map applications, shopping applications, social applications, payment applications, electronic banking applications, etc. For another example, the restart target may be a document editing software module, a graphics processing software module, a web page software module, a file downloading software module, a mailing software module, an audio video processing software module, or the like that runs on a notebook or desktop computer.
In this embodiment of the present application, the restart is performed when a restart trigger event of the restart target is detected, that is, the restart target is monitored, and the restart target is restarted due to the occurrence of a restart cause, such as a fault, an instruction, a conflict, or the like.
When the restart target is the electronic equipment, after the electronic equipment is provided with new software or is subjected to system upgrading, restarting is performed according to the instruction of the user, and then the user sends a software update event or a system upgrading event before the restart instruction to the electronic equipment.
Or if the restart target is the electronic device, after the electronic device performs the system upgrade, in order to validate the newly upgraded system, performing automatic restart, and then causing an event of completing the system upgrade of the electronic device to be automatically restarted to be a restart trigger event.
Or under the condition that the restarting target is the electronic equipment, sometimes the system of the electronic equipment may have a fault or error, and in order to clear the error information in the memory and repair the problem, the electronic equipment performs automatic restarting, so that the fault or error of the system of the electronic equipment is a restarting trigger event.
Or under the condition that the restarting target is a computer, the running performance of the computer is reduced because more temporary files are stored in the cache space, so that a user sends a restarting instruction to the electronic equipment, and before the user sends the restarting instruction, the cache space with the reduced running performance of the computer occupies too many events, and the restarting triggering event is caused.
Or, in the case that the restart target is graphics processing software, since the graphics processing software performs a large amount of graphics processing operations, the memory space or the buffer space is excessively occupied, and the graphics processing software may perform automatic restart, so as to clear unnecessary data in the memory space or the buffer space. Then the event that graphics processing software processes a number of graphics processing operations is a restart trigger event.
Or in the case that the restart target is a target application running on the mobile phone, the target application collides with other applications of the mobile phone, and then the target application may restart due to the collision between the applications when running. Or the target application may be subject to malicious attacks, which in turn may cause the target application to restart. Then, the conflict information or the malicious attack event may be a restart trigger event in the embodiment of the present application.
In this embodiment, the first target information generated by restarting the target may also include information related to the restart event. For example, the first target information may include: restarting the running state information of the target within a set short time when the restarting event occurs; or, cause of restart. The running state of the restart target may include an update state of the restart target, a processing progress of the file, a running application, and the like.
In the case that the restart target is a software module or an application, the first target information generated by the restart target before the shutdown operation of the restart event may include information recorded by the user using the restart target, or running progress information of the user using the restart target to run a file. For example, document information recorded by a user using document editing software, and the like.
In the case where the restart target is an electronic device, the restart trigger event may include a failure, an upgrade, a mere user instruction, or the like.
The restart event is an event of a restart of the restart target, and each restart event of the restart target may include a shutdown operation for the restart target and a startup operation for the restart target. The closing operation and the starting operation for the restarting object can be executed layer by layer according to the software hierarchical structure of the restarting object, and can be realized by module according to the preset running sequence of the modules. In the case where the restart target is a software module or an application, the restart event also includes a shutdown operation performed in blocks or layers on the software module or the application, and a startup operation performed in blocks or layers on the software module or the application. In the event of a restart, the shutdown operation typically occurs immediately prior to the startup operation, i.e., after at least one software or hardware component of the restart target has been shutdown, and is restarted.
In this embodiment, starting the recording operation of the first target information, that is, starting the recording process of the first target information, may include triggering the recording operation of the first target information of the restart target, so that the recording of the first target information of the restart target starts.
Step S52, the first record identification is updated according to the completion condition of the record operation of the first target information.
In general, before the electronic device is restarted, it may record some specific kinds of information (first target information) generated during the current running process of the restart target.
Under the condition that the first target information is the information of the restart trigger event, after the restart trigger event occurs to the restart target, the related information is automatically stored in a designated storage position. Or if the target information comprises a plurality of different types, the different types of target information which occur in the operation process of the restarting target before restarting are correspondingly stored in the designated storage positions. For another example, during the running process of the restart target such as an application or software, the information about the occurrence of the running process is also recorded in the designated storage location correspondingly. The designated storage location may be a temporary storage space, which may be a local storage space or a cloud storage space. When the target is restarted, if the target information is not transferred from the designated storage location to the persistent storage location, it may result in the target information stored in the designated storage location being deleted, or being covered by other information after the next restart event occurs, or being lost for other reasons.
In the present embodiment, the first target information recording operation includes an operation of acquiring first target information from a first designated position where information of a restart event is stored, and storing the first target information in a second designated position.
In one possible implementation, the first designated location may be a temporary storage space and the second designated location may be a persistent storage space.
In this embodiment of the present application, the updated first record identifier may be used to indicate, in addition to the completion of the first target information recording operation, whether the first target information is generated during the operation before the restart of the target, or whether the first target information exists at the first designated location when the restart event occurs. As an implementation manner, the first designated location may be monitored, and when it is monitored that the first target information is generated in the first designated location, the recording operation of the first target information may be triggered. Thus, the first record identity may have at least three different types of content, corresponding to three different situations of the restart event and the first target information record.
In the first case, the first target information is not generated, and although the restart target performs the restart operation, the first target information is not generated in the operation process before the restart target is restarted; accordingly, the updated first record identifier indicates that the first target information is not generated, the first target information is not required to be recorded, and meanwhile, the recording operation of the first target information is not completed.
In the second case, first target information is generated, that is, the restart target performs a restart operation, and the first target information is generated before the restart target is restarted, the first target information recording operation needs to be executed, but the first target information recording operation is not completed; correspondingly, the updated first record identifier indicates that the first target information is generated before restarting the restarting target, and further the first target information needs to be recorded, but the recording operation of the first target information is not completed.
In the third case, the first target information is generated before restarting the target, the first target information needs to be recorded, and the recording operation of the first target information is completed; correspondingly, the updated first record identifier indicates that the recording operation on the first target information is completed.
In the case that the restart target is an electronic device, the first target information may be failure information that causes a restart event to occur in the restart target, and further includes information of a restart trigger event of a failure type. When a restart event caused by a failure occurs, failure information needs to be recorded as first target information. When the restart target generates a restart event due to software update or system upgrade, the first target information is not generated and the first target information is not required to be recorded, in which case the updated first record identifier indicates that the first target information is not generated and the first target information is not required to be recorded.
When the first target information is fault information and the restart target is in a restart event caused by a fault and the fault information is not recorded, the updated first record identifier indicates that the first target information is generated before the restart target is restarted, and further the first target information needs to be recorded, but the recording operation of the first target information is not completed.
When a restart event occurs in the restart target due to a failure and failure information is recorded, the updated first record identifier indicates that the recording operation on the first target information is completed.
As one example, if the first target information is document editing information, the restart target is a document editing application. Then, if the document editing application is restarted without producing the editing content, it is the restart target that performs the restart operation, but there is no first target information, and the updated first record identification indicates that the first target information is not produced, without recording the first target information. If the document editing application restarts under the condition of generating the editing content and the editing content is not recorded, the updated first record identifier indicates that the first target information is generated before the restart target restarts, and further the first target information needs to be recorded, but the recording operation of the first target information is not completed. If the document editing application is restarted in the case of generating the editing content and the editing content is recorded, the updated first record identification indicates that the recording operation for the first target information is completed.
Step S53, after detecting that the restart target executes the closing operation in the restart event, updating the second record identifier according to the updated first record identifier.
In this embodiment, after the restart trigger event occurs in the restart target, the restart trigger event initiates the restart operation. Step S52 may be performed sequentially in any order with the closing operation in step S53, or may be performed simultaneously.
When the restarting target is the electronic equipment, in the restarting process, the restarting target firstly generates a restarting instruction by itself or receives the restarting instruction actively sent by a user, then closes the running data and simultaneously stores the related data; and then closing the system service and clearing the cached data. The operating system then restarts the hardware of the electronic device, such as the CPU (Central Processing Unit ), memory, hard disk, etc. After the hardware is restarted, the target loading operating system is restarted, the system environment is initialized, then necessary system services are started to be ready to accept user input and requests, then user configuration is loaded, the loaded user configuration comprises personal configuration files and settings of the user, and the working environment of the user is restored through loading the user configuration.
In the embodiment of the present application, when the restart target is an electronic device, the operation of recording the first target information or the operation of updating the first record identifier may be performed before or simultaneously with the shutdown operation in the restart event.
In the case where the restart target is a software module or an application, the restart target performing a shutdown operation in a restart event may include the software module or the application performing the shutdown operation.
In this embodiment, after detecting that the restart target executes the shutdown operation in the restart event, updating the second record identifier according to the updated first record identifier may include: after the restart target executes the closing operation of the restart event, when starting to execute the starting operation in the restart event, updating the second record identifier according to the updated first record identifier.
Therefore, in the restart event, the restart target needs to perform a closing operation, at least one module is closed, and after the closing operation, a starting operation needs to be performed to implement the restart, and the restart event includes the closing operation and the starting operation which are performed in sequence. After the restart target performs a shutdown operation between restarts, the second record identification is updated so that the second record identification is not lost due to the shutdown operation in the restart event.
In one possible implementation, updating the second record identifier according to the updated first record identifier includes: the first record identifier is used as a second record identifier. Or, the content of the second record identifier may be calculated according to the content of the first record identifier, where the content of the first record identifier is different from the content of the second record identifier.
Step S54: and finishing the recording operation of the first target information according to the updated second record identifier.
In this embodiment, it is possible to set: when the restart trigger event does not occur, the first record identifier is default content no matter whether the first target information is generated or not.
In another possible implementation, the default content of the first record identification indicates that the first target information was not generated and that the first target information recording operation was not completed.
In another possible implementation, the default content of the second record identification is the same as the default content of the first record identification prior to the update. The second record identifier is used for representing the completion of the record operation of the first target information generated before the closing operation of the restart target current restart event after the closing operation of each restart event.
If the updated second record identifier is still the default content of the second record identifier, it may be determined that the first target information is not generated before the closing operation of the restart event, so that the first target information is not required to be recorded, and it may be directly determined that the first target information recording operation is not required to be continuously completed. If the updated second record identifier is not the default content of the second record identifier, it may be determined that the target information is generated before the closing operation of the restart event, and then the recording of the target information may be continued or it may be determined that the recording operation of the target information has been completed according to the specific content of the second record identifier.
In one implementation, completing the target information recording operation according to the updated second record identifier includes: and under the condition that the updated second record mark indicates that the first target information is generated before the restart event and the first target information is not recorded completely, completing the recording operation of the first target information.
In another implementation manner, completing the target information recording operation according to the updated second record identifier, including: when the updated second record identifier indicates that the restart target generates first target information before the closing operation of the restart event and the first target information is not recorded, completing the recording operation of the first target information; and in the case that the updated second record identifier indicates that the first target information is not generated before the closing operation of the restart event and the first target information does not complete the record, confirming that the recording operation of the first target information is completed currently.
In the embodiment of the application, the second record identifier is set, and after the closing operation in the restarting event occurs, the second record identifier is updated according to the first record identifier, so that the updated second record identifier can represent the recording operation completion condition of the first target information before the closing operation in the restarting event occurs. Meanwhile, after the restart target is restarted, the first target information generated before the restart event is closed according to the updated second record identification, so that the situation that the first target information generated before the restart can not be correctly recorded due to the restart of the restart target is avoided.
In general, the recording operation of the first target information includes transferring the first target information from a first storage location of the restart target to a second storage location of the restart target, where the first storage location is typically a temporary storage location and the second storage location is typically a persistent storage location. However, if the first target information is generated before the closing operation of the restart event and the recording is not completed before the closing operation of the restart event occurs, there is still a possibility that the recording operation of the first target information is not completed for some reason when the recording operation of the first target information is continued according to the updated second record mark after the closing operation of the restart event occurs. Therefore, in order to ensure that the first target information is recorded, it may be necessary to monitor the completion of the recording operation of the first target information a plurality of times after the shutdown operation of the restart event occurs.
Accordingly, in one embodiment of the present application, according to the updated second record identifier, the recording operation of the first target information is completed, including: obtaining the proceeding stage of the restarting event; the proceeding stage is one of a plurality of stages formed by dividing the restarting process in advance; reading the updated second record identifier according to the proceeding stage; and restarting the recording operation of the first target information in the case that the updated second record identifier indicates that the first target information is not recorded.
The embodiment of the application provides a method for recording first target information in a plurality of proceeding stages in the starting operation process of a restarting event of a restarting target, aiming at the same target information, the completion condition of the recording operation can be detected in different proceeding stages of the starting operation of the restarting event. If the recording of the previous proceeding stage fails, the recording of the next proceeding stage can still be performed until the target information is successfully recorded, so that the accuracy and the success probability of the target information recording are greatly improved.
The completion of the recording operation of the first target information will be recorded by the updated second record identifier after the execution of the closing operation of the restart event of the restart target, in order to ensure that the recording of the first target information is correctly recorded, if the first target information is still not recorded for a long time after the execution of the closing operation of the restart event of the restart target, the updated second record identifier needs to be still maintained as a state indicating that the first target information is generated but the first target information is not recorded. Meanwhile, if the first target information completes recording after updating the second record identifier according to the first record identifier, namely the first target information is successfully transferred from the first appointed position to the second appointed position, the second record identifier is correspondingly updated and modified again, and repeated recording of the first target information is avoided.
Accordingly, in one embodiment of the present application, the method for recording information during restarting further includes: and under the condition that the restarted recording operation of the first target information is completed, updating the updated second record identifier again as follows: indicating a state in which the recording operation of the first target information has been completed.
If the recording operation of the first target information needs to be restarted, the recording operation of the first target information transferred from the first designated position to the second designated position before the closing operation of the restarting event of the restarting target is failed, and the second designated position is not recorded at the second designated position when the starting operation of the restarting event occurs.
Therefore, after the closing operation of the restarting event, if the recording operation of the first target information is completed, the updated second record identifier is updated and changed again, so that the second record identifier dynamically represents the recording condition of the first target information, and the recording operation of the first target information is correctly executed according to the updated second record identifier.
In the restart event of the restart target, if the recording operation of the first target information is not completed after the execution of the shutdown operation of the restart target, the recording operation of the first target information may still fail at a stage after the shutdown operation of the restart target, resulting in that the recording of the first target information still cannot be completed. Therefore, in some embodiments of the present application, in a start operation stage after a shutdown operation of a restart target, detecting completion of a recording operation of first target information in accordance with a plurality of stages divided in advance, and continuing to perform the recording operation of the first target information when it is determined that the recording operation of the first target information is not completed at any one detection; or by restarting the recording operation of the first target information, continuing to perform the recording operation of the first target information.
Correspondingly, in one implementation manner, the information recording method during restarting further includes: in the case that the restarted recording operation of the first target information is not completed, keeping the updated second record mark as a state representing that the first target information is not completed; and returning to the step of reading the updated second record identifier according to the proceeding stage.
If the first target information is still not successfully recorded once after the closing operation at the time of restarting, keeping the second record identifier unchanged according to the updated state of the first record identifier, so that the updated second record identifier still indicates that the recording operation on the first target information is not completed, dynamically changing the second record identifier according to the recording condition of the first target information is realized, and the recording condition of the first target information can be detected according to the read updated second record identifier for a plurality of times at a plurality of stages of starting operation of a restarting event until the first target information is successfully recorded.
After the closing operation of the restart event of the restart target is completed, since the first target information may still not be successfully recorded in one recording operation, repeated recording of the first target information may be required to ensure that the first target information is saved, and thus, repeated checking is required as to whether the recording operation of the first target information is successfully performed. After the closing operation of the restarting event, the recording state of the first target information and the updated second record identifier have a direct association relationship, so that a plurality of time nodes for reading the updated second record identifier need to be set, and when the set time node is reached, the updated second record identifier is read for a plurality of times, so that the recording condition of the first target information is confirmed.
Correspondingly, in one implementation, according to the proceeding stage, reading the updated second record identifier includes: and when the stage is changed, reading the updated second record identifier. In the starting operation of the restarting event, the change of the stage involves the transmission of the restarting-related information or instructions in the restarting target, so that under the condition of the stage change, the updated second record identifier is read, and the node for the stage change is set as the node for reading the updated second record identifier, so that the repeated triggering of the reading operation of the updated second record identifier is conveniently realized.
In this embodiment of the present application, the restart target may be a computer or an electronic device with an operation function, and the restart event is a restart of an operating system of the electronic device for the electronic device with the operation function. During the restart of the operating system, the startup process proceeds layer by layer from the hardware layer of the electronic device to the application layer at the top layer. Thus, the progress phase may be determined according to the characteristic that the start-up operation of the operating system of the electronic device is performed layer by layer.
In the case where the restart target is an electronic device, as shown in fig. 6, the progress phase includes: a first Stage (Stage 1) of boot loader (Bootloader), a second Stage (Stage 2) of boot loader, a Kernel layer (Kernel) boot Stage, an Application Framework layer (Framework) boot Stage, and an Application layer (Application) boot Stage; updating the second record identifier according to the first record identifier, including: in the first stage of starting loading, the second record identifier is updated according to the first record identifier. In other implementations, if the electronic device, application, or software module is abstracted into more layer structures, the stage of the initiation operation of the restart event may be determined according to the specific layer structure of the electronic device, application, or software module.
Thus, in this embodiment, after the electronic device completes the shutdown operation in the restart event, the startup operation is divided into: a first stage of boot loading, a second stage of boot loading, a kernel layer boot stage, an application framework layer boot stage, an application layer boot stage, and a post-boot run stage. In the first stage of starting loading, the second record identifier is initialized to update the second record identifier, that is, the second record identifier is updated according to the first record identifier, so that the second record identifier is identical to the first record identifier. Thus, after initializing the second record identifier, the step of completing the recording operation of the first target information according to the updated second record identifier may be performed at each stage of the electronic device start-up operation according to the updated second record identifier.
Bootloader is the first code segment that the embedded system of the electronic device executes after power-up, and runs before the kernel layer of the embedded operating system of the electronic device runs. After the initialization of the CPU and related hardware devices of the electronic device is completed by the Bootloader, the embedded operating system of the electronic device is built into a space mapping diagram, or a solidified embedded application program of the operating system is loaded into a memory when the electronic device is embedded, and then the space where the embedded operating system of the electronic device is located is jumped, so that the software and hardware environment of the operating system of the electronic device is brought into a proper state, a correct environment is prepared for finally calling the kernel of the operating system, and the operation of the embedded operating system of the electronic device is started in the correct environment. In an embedded system of the electronic equipment, the loading and starting task of the whole system is completely completed by a Bootloader.
Bootloader launching is mostly divided into two phases, including a first phase of Bootloader and a second phase of Bootloader. The first stage of Bootloader mainly contains code that depends on the initialization of the architecture hardware of the CPU, which is usually implemented in assembly language. In the first stage of Bootloader, the startup operations that can be performed include: basic hardware device initialization, such as masking all interrupts, shutting down the processor internal instruction/data Cache (Cache) to improve system performance, etc.; preparing RAM (Random Access Memory ) space for the second phase; setting a stack; jump to the C language program entry point of the second stage, etc.
The second stage of Bootloader is usually implemented by a C language program, so as to implement more complex functions, and also make the program have better readability and portability. The boot operation performed by the Bootloader in the second stage includes: initializing hardware equipment to be used in the second stage of Bootloader; detecting a system memory map; reading the kernel image and the root file system image from Flash (Flash memory) to RAM; setting starting parameters for the kernel; call kernel, etc.
Bootloader may have other stages of progress in addition to the first stage and the second stage. If the Bootloader comprises the third stage and other proceeding stages, the steps of judging whether the recording operation of the first target information is finished or not according to the updated second record identification and continuing to execute the recording operation of the first target information under the condition that the Bootloader is not finished are executed in other stages of the Bootloader.
In other possible implementations, the process of the electronic device or the target module and the target application after the closing operation of the restart event may be divided into a plurality of stages according to a set time interval, and when the set time interval is reached, the second record identifier is read and queried to determine whether the recording operation of the first target information needs to be continuously performed.
However, if the updated second record flag is triggered to be read at a set time interval and it is determined whether or not to continue the recording operation of the first target information based on the read result, a timer needs to be set. And when the restart target is the electronic equipment, dividing a plurality of progress stages according to the progress sequence of the system start operation among the layers of the electronic equipment, and triggering the operation of reading the second record identifier according to specific information generated when the start operation of the restart event is performed among the layers without setting an additional timer.
In this embodiment of the present application, the step of initializing the second target record information may be performed at the first stage of Bootloader, and the step of completing the recording operation of the first target information according to the updated second record identifier may be repeatedly performed in all the processes from the first stage of Bootloader to the application layer start-up stage until the subsequent operation stage.
In the embodiment of the present application, the first target information may include a plurality of states, one of which is: indicating that the restart target did not generate the first target information prior to the shutdown operation of the restart event. For example, the first target information is failure information, but the restart target simply generates a restart event due to the user's mistaken touch of the restart button, so that the restart target does not generate failure information before restarting, and the first target information (i.e. failure information) does not need to be recorded. In this case, the updated first record identification may be made to indicate that the restart target did not generate the first target information before the restart event. Because the restart target does not generate the first target information before the restart event, the recording operation of the first target information does not occur, and the recording operation of the first target information is not necessarily completed, so that the updated first record identifier may also indicate that the recording operation of the first target information is not completed. After the second record identifier is updated according to the updated first record identifier, by reading the second record identifier, it can be determined that the first target information is not generated before the restart, so that unnecessary recording operation on the first target information is not performed after the closing operation of the restart event.
If the restart target generates first target information before the shutdown operation of the restart event. Then, before the closing operation, the target information and the state of the restart target are saved and recorded, where the target information includes the first target information and the second target information in the foregoing embodiments. The first target information may or may not be successfully recorded. Thus, two other possible states of the first target information include: indicating that the first target information is generated, but that the recording operation of the first target information is not completed; alternatively, it is indicated that the first target information is generated, but the recording operation of the first target information is completed. If the first record identifier indicates that the restart target generates the first target information before the closing operation of the restart event, but the recording operation on the first target information is not completed, after the second record identifier is updated according to the updated first record identifier, it can be known from the updated second record identifier that the recording operation on the first target information still needs to be continuously performed after the closing operation of the restart event, even in the restart target operation stage after the restart event. If the first record identifier indicates that the restart target generates the first target information before the closing operation of the restart event, but the recording operation on the first target information is completed, after the second record identifier is updated according to the updated first record identifier, the first target information is known to have been successfully recorded according to the updated second record identifier, and then the first target information does not need to be recorded again after the closing operation of the restart event, so that the first target information is not repeatedly recorded.
Accordingly, in one embodiment of the present application, updating the first record identifier according to the completion of the recording operation on the first target information includes: in the case where the first target information is not generated, the first record identification is updated to represent: restarting the target, wherein the first target information is not generated, and the recording operation of the first target information is not completed; in the case where the first target information is generated and the recording operation for the first target information is not completed, the first record identification is updated to represent: restarting the target generates first target information, and recording operation on the first target information is not completed; in the case where the first target information is generated and the recording operation for the first target information is completed, the first record identification is updated to represent: restarting the target generates the first target information, and the recording operation of the first target information is completed.
The first record identification may be default content without generating the first target information before the restart event occurs to the restart target. The default content may indicate that the restart target does not generate the first target information and that the recording operation of the first target information is not completed. Thus, in a case where the first target information is not generated before the restart target generates the restart event, updating the first record identifier according to the recording operation for the first target information may include: the first record identification is retained as default content.
In the embodiment of the application, the first record identifier may have at least three different contents according to the completion of the recording operation of the first target information. According to different contents of the first record identifier, whether the restart target generates the first target information before the restart event occurs or not can be accurately expressed, and the recording condition of the first target information can be accurately expressed, so that the first target information can be accurately recorded under the condition that the restart target generates the restart event. Furthermore, if the first target information is information representing some important performance of the restart target, such as information of some major faults of the restart target or information of general faults of the restart target, according to the correctly recorded first target information, accurate judgment can be performed on the performance status of the restart target, for example, the number of times that the restart target fails can be accurately judged, so that the method has greater reference value for improving the performance of the restart target and repairing hidden danger or vulnerability possibly existing in the restart target.
In this embodiment of the present application, after updating the second record identifier according to the updated first record identifier, the updated first record identifier may be cleared, so that the first record identifier is reset and restored to a state before updating according to the recording operation of the first target information. Then, after the restart target performs the closing operation of the restart event, in the process of restarting the operation, the reset first record identifier may be used to record other similar target information (such as the second target information) generated in the process of restarting the restart target after the closing operation of the restart event.
Accordingly, in one embodiment of the present application, after updating the second record identifier according to the updated first record identifier, the method further includes: resetting the first record identifier; before the closing operation of a restarting event of the restarting object, under the condition that the restarting object is detected to generate second object information, starting the recording operation of the second object information; and updating the reset first record identification according to the completion condition of the record operation of the second target information.
Before the restart event occurs to the restart target, if the first target information is not generated, the first record identifier is a default content, and the default content may indicate that the first target information is not generated, or the first record identifier indicates that the first target information is not generated and the recording operation of the first target information is not completed before the restart event occurs to the restart target. If the restart target has multiple restart events, different target information generated at different time can be recorded for the multiple restart events, and different record identifiers are adopted to represent the corresponding record operation completion condition.
In the embodiment of the present application, after the restart event occurs, similar target information generated by the restart target may still be recorded. In connection with the embodiment shown in fig. 6, if after the shutdown operation in the restart event of the target, the updated second record identifier is repeatedly detected according to the proceeding stage, and the reset first record identifier is used to record the second target information of the same type as the first target information generated after the shutdown operation in the restart event, the complete recording can be performed on the target information before and after the restart event occurs, and the time period for generating the target information before or after the restart event occurs can be distinguished.
The first target information and the second target information are fault information. The fault information comprises all abnormal information of the restarting target during the starting operation and the closing operation. In the case that the restart target is an electronic device, the information recording method after the shutdown operation of the restart event includes three parts of an initialization step, an operation abnormality processing step, and a restart abnormality detecting step. The initialization part synchronizes the updated first record identifier to the second record identifier, and the initialization step only exists in Stage 1 of the electronic equipment for starting operation Bootloader; while the run exception handling step and the restart exception detection step may cover Bootloader, kernel and frame phases of the electronic device start-up operation.
As shown in fig. 7, during a startup operation after a shutdown operation of a restart event of the electronic device, initialization of recording mark information (i.e., a first recording mark and a second recording mark) is performed in Stage 1 of the Bootloader. The target information is recorded by storing two sets of recording marks, namely a first recording mark and a second recording mark. The first record identity is denoted by CurFlag and the second record identity is denoted by ExpFlag. The content of the first record identification may be one of no_error, error_not_save, error_has_save according to the completion of the recording operation of the first target information. Where no_error indicates NO fault information is generated, error_not_save indicates that fault information HAS occurred but that fault information HAS NOT yet been recorded, error_has_save indicates that fault information HAS occurred and that fault information HAS been recorded.
In the initialization flow, the content of CurFlag is synchronously assigned to the content of ExpF lag to save the completion condition of the recording operation of fault information before restarting. And then resetting the CurFlag mark to be NO_ERROR for detecting and recording fault information generated in the starting operation process of the restarting event until the operation process.
In connection with the operation exception handling step shown in fig. 8, a mechanism of the operation exception handling step is triggered when an abnormality occurs during the next start-up or operation. In the execution flow of the operation exception handling step, if an exception occurs after the shutdown step of the restart event, that is, fault information is generated, the CurFlag is first set as ERROR_NOT_SAVED, and the system occurrence exception problem is marked, and the fault information is generated. And then, performing first recording operation processing on fault information generated after the restart event closing operation. Then judging whether the recording operation is successful: if the fault information is transferred from the first storage position to the second storage position, the fault information generated after the closing operation of the restarting event is successfully recorded into the abnormal record data, and the CurFlag is set as ERROR_HAS_SAVED; if the failure information generated after the shutdown operation at the restart time is NOT successfully recorded into the abnormal record data for some reason, the CurFlag state is maintained as ERROR_NOT_SAVED.
As shown in fig. 9, in the flow of the startup operation of each startup stage (including each stage of BootLoader, kernel, frame, and the like) in the system startup process of the electronic device, the abnormality detection processing in the restart event is performed. As shown, at the beginning of the detection process, it is first detected whether ExpF lag is in ERROR_NOT_SAVED state. If ExpFlag is error_not_protected, the fault information generated before the shutdown operation of the restart event is NOT successfully recorded in the abnormal recording data, the initialization step shown in fig. 7 is followed by repeatedly performing the recording operation of the fault information. After the shutdown operation of the restart event, the ExpFlag will maintain the error_not_safe state unchanged if the failure information is NOT successfully transferred from the first storage location to the second storage location, i.e., before the failure information is NOT successfully recorded into the exception record data.
Likewise, if the fault information is successfully SAVED in the abnormal record data, the content of ExpFlag is set to error_has_save state, otherwise, the step of performing the record operation of the fault information is returned. Thus, the same fault information is not recorded again in the restarting abnormality detection step of the next starting stage, and the same fault information is prevented from being repeatedly recorded for a plurality of times.
Referring to fig. 10, in conjunction with fig. 7, 8 and 9, during the operation process after the electronic device is powered on, two sets of record identifiers are saved to record fault information, which are respectively represented by ExpFlag and CurFlag. The content of the record identity may be one of NO ERROR, ERROR, SAVED. Wherein no_error indicates NO fault information is generated, ERROR indicates that fault information has occurred but fault information has not been recorded, and SAVED indicates that fault information has occurred and fault information has been recorded.
Still referring to fig. 10, after the electronic device with the android system is powered on, a boot instruction directs the chip to load Bootloader into the memory, and start pulling up Linux Kernel. After the Linux kernel layer is started, a process in the first user space is started, and the process is an init process. At the beginning of the Bootloader phase, a BootROM (Boot Read-Only Memory) program is executed, which is a Memory for storing a router startup program. The BootROM program is the first code that the processor executes at power up or reset. BootROM may decide where to load the next portion of code to be executed from and how or if it verifies its correctness or validity. Sometimes the BootROM program may contain other functions, possibly used by the user code during or after the boot chip is started. After executing the BootROM program, the first phase of Bootloader is executed. In the first stage of Bootloader, the first record identifier and the second record identifier are initialized. If the electronic equipment is not restarted, the first record identifier and the second record identifier are default contents, namely are NO_ERROR.
Still referring to fig. 10, in case of a restart event occurring in the electronic device, after a shutdown operation of the restart event, the system RESET is RESET, and then, in a first stage of Bootloader, the contents of CurFlag are synchronized into ExpFlag first, while CurFlag is set to no_error to cope with an abnormality that may occur during operation after the shutdown operation of the restart event. From the second stage of Bootloader, it is determined whether the content of the second record identifier ExpFlag is ERROR. If ExpF lag is ERROR, the recording operation of the fault information is restarted. Then, in a plurality of starting stages of starting, the ExpF lag is detected, and whether fault information is recorded or not is judged. If ExpF lag is ERROR, namely fault information is not recorded or is not recorded successfully, the fault is kept until the fault is recorded successfully, and then ExpF lag is set as SAVED. Meanwhile, if the recording operation of the fault information is completed, the fault information is successfully SAVED, the ExpF lag is set as the SAVED, the recording operation of the fault information is continuously executed, the repeated recording is prevented, and the starting operation in the restarting event is continuously executed. Otherwise, the recording operation of the fault information may be repeatedly performed a plurality of times.
Still referring to fig. 10, the EXP instruction is executed during the operation of the electronic device after the shutdown operation of each restart event. If the system of the electronic equipment fails, the content of CurFlag is set as ERROR first, and the system of the electronic equipment is marked to fail. And after that, until the restart event occurs again, the fault information can be tried to be recorded according to the system state of the electronic equipment, if the recording is successful, the CurFlag is set as the SAVED, otherwise, the state that the content of the CurFlag is ERROR is kept until the restart event occurs to the electronic equipment, and the reset operation is carried out.
Because the method for recording the target information in multiple stages is used in the embodiment of the application, the success rate of target information recording can be improved, and therefore, aiming at some important information possibly generated in the process of restarting the target operation, the method provided by the embodiment of the application can be used for recording. For example, in one embodiment of the present application, the first target information is failure information of the restart target. The electronic device can be restarted automatically to recover when the electronic device fails and cannot continue to work in the starting/running process, and the maintenance of the electronic device is required to record the failure, and in general, the maintenance record is recorded after the electronic device is started to a specific mode. This approach requires a high level of reliability for this particular mode, and if the process of starting up to the particular mode is abnormal, this may lead to problems with missing or erroneous records. When the method provided by the embodiment of the application is applied to fault recording, the fault information recording operation can be executed in a plurality of proceeding stages, the reliability of a specific mode is not depended, and the success rate of fault information recording is improved.
According to the method provided by the embodiment of the application, in the operation process after the restart event occurs to the restart target, the recording of the second target information of the same type as the first target information can be continued, and the second target information can also be the fault information of the restart target. Aiming at electronic equipment, a software module or an application which is restarted, different information record identifiers are used for recording the same kind of target information, so that the target information is prevented from being lost due to restarting of the electronic equipment, the software module or the application, and the success rate of saving the target information is improved. Whether the electronic equipment product, the software module product or the application product, fault information generated in the running process has important significance for improving the performance of the product and solving the potential hazards possibly existing in the product. Therefore, the embodiment of the application can be applied to the record of the fault information of the restarting object, and the recorded fault information can comprise the fault information generated in the normal operation process or the fault information generated in the restarting and closing processes.
Taking the fault information of the terminal application as an example, when the user uses the terminal application to perform network activity, the terminal application may be blocked due to a certain fault, so that the user has to forcibly close the terminal application and restart the terminal application, thereby enabling the terminal application to recover to a normal running state. By the method provided by the embodiment of the invention, the fault information of the terminal application can be used as target information, the fault information causing the terminal application to be stuck is recorded, the subsequent improvement of the performance of the terminal application according to the fault information of the terminal application is facilitated, and the stuck in the running process of the terminal application is reduced or avoided.
In one embodiment of the present application, the restart target is a target electronic device. The electronic device may be a computer, or a special device with a computer function, such as an auxiliary device such as an intelligent home appliance, an intelligent production device, an electronic book, or a server, etc.
When the restart target is a software module or an application, a different progress stage may be set for the software module or the application, for example, a starting process of the software module or the application may be divided into a plurality of progress stages according to a set time interval. The trigger node for repeatedly checking the updated second record identifier to confirm whether the recording operation of the first target information is completed or not may be set according to the running characteristics of the software module or the application.
Fig. 11 is a schematic signaling interaction diagram between a system of the electronic device and the target information recording module in the case that the restart target is the electronic device, and includes steps S111-S119.
Step S111: after the system of the electronic device is started, the target information recording module detects that the system of the electronic device generates target information. In this embodiment, the target information may be information of a set type, for example, abnormal information or fault information when the electronic device is abnormal in operation. The target information recording module may monitor that the electronic device generates the target information by actively monitoring a first storage location, which may be a temporary storage location of the electronic device. If the target information includes different kinds of information, the first storage location may include different storage locations corresponding to the different kinds of information.
Step S112: the target information recording module changes the first record identification to indicate that the target information is not recorded, and performs a recording operation on the target information.
Step S113: the target information recording module changes the first record identification into a record indicating the target information under the condition that the recording operation of the target information is successfully executed; in the case where the recording operation of the target information is not successfully performed, the first record identification is changed to indicate that the target information is not recorded.
Step S114: the electronic device generates a restart event.
Step S115: the target information recording module detects a restarting event generated by the electronic equipment, assigns the updated first record identifier to the second record identifier, and resets the updated first record identifier.
Step S116: and the target information recording module repeatedly executes the recording operation of the target information generated before the restart event occurs according to the updated second record identifier.
Step S117: after the target information recording module detects that the restart event occurs, the system of the electronic equipment generates target information, and the first record identification is changed into the record indicating that the target information is not recorded. If another target information is generated again by the electronic device after the restart event, the completion of the recording operation of the newly generated another target information may be indicated by using the reset first recording flag.
Step S118: the target information recording module records target information generated after the restart event occurs. The target information recording module may record the target information after the restart event occurs by transferring the target information from the first designated location to the second designated location.
Step S119: under the condition that the target information is successfully recorded after the restart event occurs, changing the first record identifier into a record identifier for indicating that the target information is recorded; otherwise, the first record is kept as representing that the target information is not recorded.
In other embodiments of the present application, a third record identifier, a fourth record identifier, etc. may also be set, so as to correspond to the completion situation of the recording operation of the target information before the restart event occurs when the restart target multiple times of restart events occur.
Fig. 12 is a schematic structural diagram of an information recording apparatus at restarting according to an embodiment of the present application, including: a recording operation start module 1201, a first content update module 1202, a second content update module 1203, and a recording operation completion module 1204.
The recording operation starting module 1201 is configured to start a recording operation for the first target information when it is detected that the restart target generates the first target information before the restart event occurs in the restart target; the restart event includes a shutdown operation for the restart target, and a startup operation for the restart target performed after the shutdown operation.
The first content updating module 1202 is configured to update the first record identifier according to a completion of a recording operation on the first target information.
The second content updating module 1203 is configured to update the second record identifier according to the updated first record identifier after detecting that the restart target performs the closing operation in the restart event.
And a recording operation completing module 1204, configured to complete the recording operation of the first target information according to the updated second record identifier.
It should be noted that: the information recording device at restarting provided in the above embodiment is only exemplified by the division of the above functional modules when recording information, and in practical application, the above functional allocation may be performed by different functional modules according to needs, i.e., the internal structure of the device is divided into different functional modules to perform all or part of the functions described above.
Meanwhile, the information recording device during restarting according to the embodiment of the application may further include other functional modules, so as to implement any step and function in the information recording method during restarting according to any embodiment of the application.
The functional units and modules in the above embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiments of the present application.
The device for determining the location information provided in the foregoing embodiment and the method embodiment for determining the location information belong to the same concept, and specific working processes and technical effects brought by the units and the modules in the foregoing embodiment may be referred to a method embodiment part, which is not repeated herein.
As an example of the present application, the electronic device can access a base station and also have the capability of accessing a wireless local area network, such as a mobile phone, a tablet, a smart watch, a portable notebook, etc. Referring to fig. 13, fig. 13 is a schematic structural diagram of an electronic device according to an embodiment of the present application. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (universal serial bus, USB) interface 130, a charge management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like. The hardware structure shown in fig. 13 may be powered on before the Bootloader phase when the start operation of the restart event is performed.
It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, electronic device 100 may include more or fewer components than shown, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (graphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), and/or a neural-network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors. In the embodiment of the application, the different processors may be used as separate restart targets, i.e. if the graphics processor is restarted during the process of invoking the camera, the camera application is restarted accordingly, in which case the restart target may be considered as the graphics processor itself, instead of the camera application.
The controller may be a neural hub and a command center of the electronic device 100, among others. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution. For example, the controller may generate a control signal for turning off the electronic device 100, and a control signal for restarting the electronic device 100 for a short time after turning off the electronic device 100, according to the instruction operation code.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled, such as to perform a recording operation of the target information in a loop. If the processor 110 is operable to monitor the second storage location, it is determined whether the first target information or the second target information exists in the second storage location, and thereby whether the recording operation of the first target information or the recording operation of the second target information is successful.
In some embodiments, the processor 110 may include one or more interfaces, such as may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The wireless communication function of the electronic device 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (WiFi network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field wireless communication technology (near field communication, NFC), infrared technology (IR), etc. applied to the electronic device 100.
In some embodiments, antenna 1 and mobile communication module 150 of electronic device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that electronic device 100 may communicate with a network and other devices via wireless communication technology, obtaining target information from other devices, such as temporarily stored target information from the cloud.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. In some embodiments, the electronic device 100 may include 1 or N display screens 194, N being an integer greater than 1. In the restarting event, at least one display screen in the N display screens displays restarting prompt information.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to enable expansion of the memory capabilities of the electronic device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. Such as persisting the first target information that was transferred.
The internal memory 121 may be used to store computer-executable program code that includes instructions. The processor 110 executes various functional applications of the electronic device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data (e.g., audio data, phonebook, etc.) created by the electronic device 100 during use, and so forth. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like. The internal memory may also be used to store target information. Under the condition that the method provided by the embodiment of the application is suitable for different kinds of target information, the different kinds of target information can be correspondingly stored in different storage positions, and after the target information is transferred, the target information can be stored in the different storage positions to realize the relative persistence storage of the target information.
The touch sensor 180K, also referred to as a "touch panel". The touch sensor 180K may be disposed on the display screen 194, and the touch sensor 180K and the display screen 194 form a touch screen, which is also called a "touch screen". The touch sensor 180K is for detecting a touch operation acting thereon or thereabout. The touch sensor 180K may communicate the detected touch operation to the application processor to determine the touch event type. Visual output related to touch operations may be provided through the display 194. In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 at a different location than the display 194. The touch sensor 180K may receive a restart instruction sent by the user through a touch manner in the case where the user decides to restart the electronic device.
The keys 190 include a power-on key, a volume key, etc. The keys 190 may be mechanical keys or touch keys. The electronic device 100 may receive key inputs, generating key signal inputs related to user settings and function controls of the electronic device 100. A restart trigger event may also be generated by key 190. For example, a forced shutdown command is generated by pressing the key 190 for a long time, and then a startup command is generated by pressing the key 190, so that if the preset determination condition is met, the forced shutdown process and the startup process can be simulated as a restarting process of the electronic device 100.
The indicator 192 may be an indicator light, may be used to indicate a state of charge, a change in charge, a message indicating a missed call, a notification, etc.
The SIM card interface 195 is used to connect a SIM card. The SIM card may be inserted into the SIM card interface 195, or removed from the SIM card interface 195 to enable contact and separation with the electronic device 100. The electronic device 100 may support 1 or N SIM card interfaces, N being an integer greater than 1. The SIM card interface 195 may also be compatible with external memory cards. The electronic device 100 may also implement a mobile communication function through a SIM card, and further may obtain target information from other communication terminals through the mobile communication function, or store the target information in a designated location of the other communication terminals to implement relative persistent storage.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on a computer, the processes or functions in accordance with embodiments of the present application are produced in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another, such as from one website, computer, server, or data center by wired (e.g., coaxial cable, fiber optic, data subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. Computer readable storage media can be any available media that can be accessed by a computer or data storage devices, such as servers, data centers, etc., that contain an integration of one or more of the available media. Usable media may be magnetic media such as floppy disks, hard disks, magnetic tapes, optical media such as digital versatile discs (Digital Versatile Disc, DVDs), or semiconductor media such as Solid State Disks (SSDs), etc.
The above embodiments are not intended to limit the present application, and any modifications, equivalent substitutions, improvements, etc. within the technical scope of the present disclosure should be included in the protection scope of the present application.

Claims (12)

1. An information recording method at the time of restarting, characterized by comprising:
before a restart event occurs to a restart target, under the condition that the restart target is detected to generate first target information, starting a recording operation of the first target information; the restart event includes a closing operation on the restart target, and a starting operation on the restart target performed after the closing operation;
updating a first record identifier according to the completion condition of the record operation of the first target information;
after detecting that the restart target executes the closing operation in the restart event, updating a second record identifier according to the updated first record identifier;
and finishing the recording operation of the first target information according to the updated second record identifier.
2. The method of claim 1, wherein updating the first record identifier based on the completion of the recording of the first target information comprises:
Updating the first record identification to represent, in the event that the restart target does not generate the first target information: a state in which the restart target does not generate the first target information and a recording operation for the first target information is not completed;
in the case that the restart target generates the first target information and a recording operation on the first target information is not completed, updating the first record identification to represent: the restart target generates the first target information and is in a state of incomplete recording operation of the first target information;
in the case that the restart target generates the first target information and completes the recording operation of the first target information, updating the first record identification to represent: the restart target generates the first target information, and a recording operation of the first target information is completed.
3. The method according to claim 1 or 2, wherein the completing the recording operation of the first target information according to the updated second record identifier includes:
acquiring the progress stage of the restart event; the proceeding stage is one of a plurality of stages formed by dividing the restarting process in advance;
Reading the updated second record identifier according to the proceeding stage;
restarting the recording operation of the first target information in the case that the updated second record identification indicates that the recording operation of the first target information is not completed.
4. A method according to claim 3, wherein after said restarting said recording of the first target information, the method further comprises:
judging whether the restarted recording operation of the first target information is completed or not;
and under the condition that the restarted recording operation of the first target information is completed, the updated second record identifier is updated again, so that the updated second record identifier indicates that the recording operation of the first target information is completed.
5. A method according to claim 3, wherein after said determining whether the recommenced recording operation of the first target information is completed, the method further comprises:
in the case that the restarted recording operation of the first target information is not completed, reserving the updated second record mark as representing: the restart target generates the first target information, and the first target information is not recorded;
And returning to the step of reading the updated second record identifier according to the proceeding stage.
6. A method according to claim 3, wherein said reading said updated second record identification according to said progress phase comprises:
and under the condition that the progress stage is changed, reading the updated second record identification.
7. A method according to claim 3, wherein, in case the restart target is an electronic device, the proceeding phase comprises: a first stage of starting loading, a second stage of starting loading, a kernel layer starting stage, an application framework layer starting stage and an application layer starting stage; and updating a second record identifier according to the updated first record identifier, including:
and in the first stage of starting loading, updating the second record identifier according to the updated first record identifier.
8. The method of claim 1, wherein after said updating the second record identifier based on said updated first record identifier, the method further comprises:
resetting the first record identifier;
before the restart target generates a restart event again, under the condition that the restart target generates second target information, starting a recording operation of the second target information;
And updating the reset first record identifier according to the completion condition of the record operation of the second target information.
9. The method of claim 1, wherein the first target information is failure information of the restart target.
10. The method of claim 1, wherein the restart target is a target electronic device, software module, or application.
11. An electronic device, the electronic device comprising: a processor and a memory;
the memory is used for storing a program for the electronic device to execute the method according to any one of claims 1-10 and storing data related to the implementation of the method according to any one of claims 1-10;
the processor is configured to execute a program stored in the memory.
12. A computer readable storage medium having instructions stored therein which, when run on a computer, cause the computer to perform the method of any of claims 1-10.
CN202311561498.4A 2023-11-22 2023-11-22 Information recording method at restarting, electronic device and readable storage medium Active CN117290164B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311561498.4A CN117290164B (en) 2023-11-22 2023-11-22 Information recording method at restarting, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311561498.4A CN117290164B (en) 2023-11-22 2023-11-22 Information recording method at restarting, electronic device and readable storage medium

Publications (2)

Publication Number Publication Date
CN117290164A true CN117290164A (en) 2023-12-26
CN117290164B CN117290164B (en) 2024-05-10

Family

ID=89258903

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311561498.4A Active CN117290164B (en) 2023-11-22 2023-11-22 Information recording method at restarting, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN117290164B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108038030A (en) * 2017-11-30 2018-05-15 努比亚技术有限公司 Mobile terminal restarts localization method, mobile terminal and computer-readable recording medium
WO2020173377A1 (en) * 2019-02-28 2020-09-03 华为技术有限公司 Log information generating method and apparatus, and electronic device
CN115658113A (en) * 2022-11-07 2023-01-31 苏州浪潮智能科技有限公司 Server self-starting method and device, readable storage medium and electronic equipment
CN115757042A (en) * 2022-11-29 2023-03-07 宁畅信息产业(北京)有限公司 Fault positioning method and device for abnormal restart of BMC (baseboard management controller), electronic equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108038030A (en) * 2017-11-30 2018-05-15 努比亚技术有限公司 Mobile terminal restarts localization method, mobile terminal and computer-readable recording medium
WO2020173377A1 (en) * 2019-02-28 2020-09-03 华为技术有限公司 Log information generating method and apparatus, and electronic device
CN115658113A (en) * 2022-11-07 2023-01-31 苏州浪潮智能科技有限公司 Server self-starting method and device, readable storage medium and electronic equipment
CN115757042A (en) * 2022-11-29 2023-03-07 宁畅信息产业(北京)有限公司 Fault positioning method and device for abnormal restart of BMC (baseboard management controller), electronic equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王晨光等: ""基于Linux的嵌入式设备多状态重启记录系统设计与实现"", 《软件导刊》, no. 05, 4 January 2019 (2019-01-04), pages 131 - 135 *

Also Published As

Publication number Publication date
CN117290164B (en) 2024-05-10

Similar Documents

Publication Publication Date Title
CN109964227B (en) Method and terminal for updating SELinux security policy
CN110825563B (en) System recovery method and device and electronic equipment
CN109753297A (en) Method for upgrading software, device and readable storage medium storing program for executing when terminal standby
CN115328563B (en) System starting method and electronic equipment
CN112162795B (en) Plug-in starting method and device, computer equipment and storage medium
CN116719670B (en) Data processing method, electronic device and readable storage medium
CN117290164B (en) Information recording method at restarting, electronic device and readable storage medium
CN116400938B (en) Operating system upgrading method, device and storage medium
CN116700768B (en) Application processing method and related device
CN109634782B (en) Method and device for detecting system robustness, storage medium and terminal
CN115357295B (en) System rollback method, device and storage medium
CN110018918B (en) Method and device for repairing terminal abnormity, mobile terminal and storage medium
CN112463199A (en) System upgrading method and terminal
CN115951920A (en) Mobile equipment upgrading method and device, storage unit and mobile equipment
CN113656063A (en) System version replacing method, device, equipment and computer readable medium
CN114138343A (en) Terminal and terminal starting method
CN113190244A (en) Method and device for upgrading wireless module, computer equipment and storage medium
CN112559131A (en) Method, device and equipment for updating container mirror image and computer readable storage medium
CN112181467A (en) Method and device for upgrading memory firmware of terminal, terminal and storage medium
CN117130627B (en) Fitting upgrading method and electronic equipment
CN116302454B (en) Method for applying network resources and electronic equipment
CN117707629A (en) System startup method, readable storage medium, and electronic device
CN117435092A (en) Click operation information processing method, electronic device and readable storage medium
CN116069370A (en) Method, apparatus, storage medium and computer program product for upgrading a cold patch
CN116909477A (en) Storage partition updating method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant