Data storage method, device and electronic device

By detecting abnormal events in the smart device and storing log data in the target storage area that is not easy to clear, the problem that data cannot be saved after the smart device is restored to factory settings is solved, and the ability to analyze abnormal events is improved.

CN114356067BActive Publication Date: 2025-01-10DOUYIN VISION CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111680491.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2025-01-10
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

When the smart device is restored to factory settings, the log data of the abnormal situation cannot be saved, resulting in the inability to analyze the occurrence of abnormal situations.

Method used

By detecting exception events, the log data of the exception event is stored in the target storage area. The data in this area will not be cleared when performing preset operations (such as factory reset), and the data will be uploaded to the server for normal operation after the device is turned on normally. analyze.

Benefits of technology

It ensures that the log data of exception events will not be cleared when factory settings are restored, and the ability to analyze exception events is improved, and the problem of data being unable to be saved is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114356067B_ABST
    Figure CN114356067B_ABST
Patent Text Reader

Abstract

The disclosed embodiments disclose a data storage method, device, and electronic device. A specific implementation of the method includes: in response to detecting an abnormal event, storing target data in a target storage area, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when performing a preset operation, and the operation includes restoring factory settings; in response to detecting that the operation is completed and the computer is turned on normally, uploading the target data stored in the target storage area to a target server, so that the target server can analyze the target data. This implementation avoids the problem that data cannot be saved under operations such as restoring factory settings, and improves the ability to analyze abnormal events.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present disclosure relate to the field of computer technology, and in particular to a data storage method, device, and electronic device. Background Art

[0002] When an existing smart device encounters an abnormal situation, it usually stores the relevant log data in the corresponding data storage area. For example, when an Android smart device encounters an abnormal situation, it usually stores the relevant log data in the data partition. However, when the smart device is restored to factory settings, the data in these data storage areas will also be cleared, which will cause the system to be unable to analyze the abnormal situation based on the log data when the abnormal situation occurred, and it will also be unable to solve the abnormal situation well. Summary of the invention

[0003] This disclosure section is provided to introduce concepts in a brief form, which will be described in detail in the detailed description section below. This disclosure section is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] The embodiments of the present disclosure provide a data storage method, device and electronic device, thereby avoiding the problem of data being unable to be saved during operations such as restoring factory settings, and improving the ability to analyze abnormal events.

[0005] In a first aspect, an embodiment of the present disclosure provides a data storage method, comprising: in response to detecting an abnormal event, storing target data in a target storage area, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when a preset operation is performed, and the operation includes restoring factory settings; in response to detecting that the computer is turned on normally after the operation is completed, uploading the target data stored in the target storage area to a target server for the target server to analyze the target data.

[0006] In a second aspect, an embodiment of the present disclosure provides a data storage device, comprising: a storage unit, for storing target data in a target storage area in response to detecting an abnormal event, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when a preset operation is performed, and the operation includes restoring factory settings; an uploading unit, for uploading the target data stored in the target storage area to a target server in response to detecting that the computer is turned on normally after the operation is completed, so that the target server can analyze the target data.

[0007] In a third aspect, an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the data storage method as described in the first aspect.

[0008] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the data storage method as described in the first aspect.

[0009] The data storage method, device and electronic device provided by the embodiments of the present disclosure store target data in a target storage area in response to detecting an abnormal event, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when performing a preset operation, wherein the operation includes restoring factory settings; detecting whether the computer is turned on normally after the above operation is performed; if the computer is turned on normally after the above operation is performed, uploading the target data stored in the target storage area to the target server for the target server to analyze the target data. In this way, the log data of the abnormal event can be stored, and the stored data will not be cleared during operations such as restoring factory settings, so that the abnormal event can be analyzed using the stored data, thereby avoiding the problem that the data cannot be saved during operations such as restoring factory settings, and improving the ability to analyze abnormal events. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.

[0011] Figure 1 is an exemplary system architecture diagram in which various embodiments of the present disclosure may be applied;

[0012] Figure 2 is a flow chart of an embodiment of a data storage method according to the present disclosure;

[0013] Figure 3 is a flow chart of another embodiment of a data storage method according to the present disclosure;

[0014] Figure 4 is a schematic structural diagram of an embodiment of a data storage device according to the present disclosure;

[0015] Figure 5 It is a schematic diagram of the structure of a computer system suitable for implementing the electronic device of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0016] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0017] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0018] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0019] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0020] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0021] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0022] Figure 1 An exemplary system architecture 100 is shown to which embodiments of the data storage method of the present disclosure may be applied.

[0023] like Figure 1 As shown, the system architecture 100 may include terminal devices 1011, 1012, 1013, a network 102, and a server 103. The network 102 is used to provide a medium for communication links between the terminal devices 1011, 1012, 1013 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0024] The user can use the terminal devices 1011, 1012, 1013 to interact with the server 103 through the network 102 to send or receive messages, etc. For example, the terminal devices 1011, 1012, 1013 can upload the target data stored in the target storage area to the server 103. Various communication client applications, such as shopping applications, instant messaging software, etc., can be installed on the terminal devices 1011, 1012, 1013.

[0025] Terminal devices 1011, 1012, and 1013 can determine whether an abnormal event is detected; if an abnormal event is detected, the target data can be stored in the target storage area, wherein the above-mentioned target data includes log data of the abnormal event, and the data in the above-mentioned target storage area will not be cleared when performing preset operations, and the above-mentioned operations include restoring factory settings; thereafter, it can be detected whether the computer starts normally after the above-mentioned operations are completed; if it is detected that the computer starts normally after the above-mentioned operations are completed, the above-mentioned target data stored in the above-mentioned target storage area can be uploaded to the target server for the above-mentioned target server to analyze the above-mentioned target data.

[0026] Terminal devices 1011, 1012, 1013 can be hardware or software. When terminal devices 1011, 1012, 1013 are hardware, they can be various electronic devices with display screens and supporting information interaction, including but not limited to smart phones, tablet computers, laptop portable computers, etc. When terminal devices 1011, 1012, 1013 are software, they can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0027] The server 103 may be a server that provides various services, for example, it may be a background server that analyzes target data uploaded by the terminal devices 1011 , 1012 , and 1013 .

[0028] It should be noted that the server 103 can be hardware or software. When the server 103 is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or it can be implemented as a single server. When the server 103 is software, it can be implemented as multiple software or software modules (for example, for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.

[0029] It should also be noted that the data storage method provided in the embodiments of the present disclosure is usually executed by the terminal devices 1011 , 1012 , and 1013 , and the data storage device is usually arranged in the terminal devices 1011 , 1012 , and 1013 .

[0030] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0031] Continue to refer Figure 2 , shows a process 200 of an embodiment of a data storage method according to the present disclosure. The data storage method comprises the following steps:

[0032] Step 201, determining whether an abnormal event is detected.

[0033] In this embodiment, the execution subject of the data storage method (for example Figure 1 The terminal device shown in the figure) can determine whether an abnormal event is detected. An abnormal event generally refers to an event that causes the above-mentioned execution subject (for example, an operating system) to fail to operate normally. As an example, an abnormal event may be an event in which the system cannot enter the startup homepage during the boot phase. An abnormal event may also be an event in which the current page is stuck and cannot enter the preloaded page.

[0034] If an abnormal event is detected, the execution entity may execute step 202 .

[0035] Step 202: If an abnormal event is detected, the target data is stored in a target storage area.

[0036] In this embodiment, if an abnormal event is detected in step 201, the execution subject may store the target data in the target storage area. The target data may include log data of the abnormal event, and may also include a configuration file used when the abnormal event occurs. The data in the target storage area will not be cleared when the preset operation is performed. The operation may include restoring factory settings, or may include flashing or abnormal power failure.

[0037] Step 203, detecting whether the computer is turned on normally after the operation is completed.

[0038] In this embodiment, the execution subject can detect whether a preset operation is executed, for example, restoring factory settings. If the execution of the above operation is detected, the execution subject can detect whether the current boot is normal.

[0039] If normal startup is detected, the execution subject may execute step 204 .

[0040] Step 204: if it is detected that the computer is turned on normally after the operation is completed, the target data stored in the target storage area is uploaded to the target server so that the target server can analyze the target data.

[0041] In this embodiment, if it is detected in step 203 that the computer is turned on normally after the above operation is executed, the above execution subject can upload the target data stored in the above target storage area to the target server, so that the above target server can analyze the above target data. The above target server can be a server for analyzing abnormal events in the above execution subject. After analyzing the above target data, the above target server can send the analysis results to the terminal device of the R&D personnel, and the R&D personnel can solve the problems that arise.

[0042] Here, after the above-mentioned execution subject is started, the above-mentioned execution subject can load the rescue mode (RescueParty). The rescue mode can monitor the operation status of the above-mentioned execution subject. The above-mentioned execution subject can perform a series of operations according to different rescue levels to see whether the device can be restored. In the most serious case, it is solved by restoring the factory settings. If an abnormal event occurs in the above-mentioned execution subject, the rescue level of the current abnormal event can be determined according to the category to which the abnormal event belongs. Here, the rescue levels can include level one, level two and level three. Among them, level one may refer to repairing the configuration file to restore the device, level two may refer to deleting the current configuration file, and restoring the device after regenerating the configuration file, and level three may refer to the need to restore the device to factory settings.

[0043] The method provided by the above-mentioned embodiment of the present disclosure determines whether an abnormal event is detected; if an abnormal event is detected, the target data is stored in the target storage area, the target data includes the log data of the abnormal event, and the data in the target storage area will not be cleared when performing a preset operation, and the operation includes restoring the factory settings; detects whether the computer is turned on normally after the above operation is completed; if the computer is turned on normally after the above operation is completed, the target data stored in the target storage area is uploaded to the target server for the target server to analyze the target data. In this way, the log data of the abnormal event can be stored, and the stored data will not be cleared during operations such as restoring the factory settings, so that the abnormal event that occurs can be analyzed using the stored data, thereby avoiding the problem that the data cannot be saved under operations such as restoring the factory settings, and improving the ability to analyze abnormal events.

[0044] In some optional implementations, in response to detecting that the computer is turned on normally after the above-mentioned operation is executed, before uploading the above-mentioned target data stored in the above-mentioned target storage area to the target server, the above-mentioned execution subject may determine whether to present the target page based on the above-mentioned abnormal event, and the above-mentioned target page may be used to request whether to restore the factory settings. If so, the above-mentioned execution subject may present the above-mentioned target page. Specifically, the above-mentioned execution subject may store a correspondence table of the correspondence between abnormal events and rescue levels, and the above-mentioned execution subject may search the above-mentioned correspondence table for the rescue level corresponding to the currently occurring abnormal event. If the rescue level corresponding to the currently occurring abnormal event is level three, the above-mentioned execution subject may determine that the device needs to be restored to factory settings. At this time, the above-mentioned execution subject may present the target page.

[0045] In some optional implementations, after uploading the target data stored in the target storage area to the target server, the execution entity may delete the uploaded target data from the target storage area, thereby freeing up effective space in the target storage area in a timely manner.

[0046] In some optional implementations, the above operation may include powering off the device. After the device is powered off and then restarted normally, the above execution subject can still obtain the log data of the abnormal event in the above target storage area and upload the log data of the abnormal event to the above target server, thereby realizing that the log data of the abnormal event can also be stored when the device is powered off.

[0047] Further references Figure 3 , which shows a process 300 of another embodiment of a data storage method. The process 300 of the data storage method includes the following steps:

[0048] Step 301, determining whether an abnormal event is detected.

[0049] In this embodiment, step 301 may be performed in a manner similar to step 201 , and will not be described in detail herein.

[0050] Step 302: If an abnormal event is detected, obtain the remaining storage space of the target storage area.

[0051] In this embodiment, if an abnormal event is detected in step 301, the execution subject may obtain the remaining storage space of the target storage area. The data in the target storage area will not be cleared when the preset operation is performed. The operation may include restoring factory settings, flashing the device or abnormal power failure.

[0052] Step 303, determining whether the storage space occupied by the target data is larger than the remaining storage space.

[0053] In this embodiment, the execution subject may determine whether the storage space occupied by the target data is greater than the remaining storage space. The target data may include log data of the abnormal event, or may include a configuration file used when the abnormal event occurs.

[0054] If the storage space occupied by the target data is larger than the remaining storage space, the execution entity may execute step 304 .

[0055] Step 304: If the storage space occupied by the target data is larger than the remaining storage space, the data in the target storage area is deleted.

[0056] In this embodiment, if it is determined in step 303 that the storage space occupied by the target data is greater than the remaining storage space, the execution subject may delete the data in the target storage area. As an example, the execution subject may delete all the data in the target storage area, or the execution subject may randomly delete the data in the target storage area.

[0057] It should be noted that the above-mentioned remaining storage space can be expressed in terms of the number of log copies, that is, the above-mentioned execution entity can obtain the remaining number of storable log copies in the above-mentioned target storage area. If the number of log copies of the abnormal event is greater than the above-mentioned remaining number of storable log copies, the above-mentioned execution entity can delete the data in the above-mentioned target storage area so that the remaining number of storable log copies in the above-mentioned target storage area is greater than or equal to the number of log copies to be stored.

[0058] Step 305: Store the target data in the target storage area.

[0059] In this embodiment, the execution entity may store the target data in the target storage area.

[0060] Step 306, detecting whether the computer is turned on normally after the operation is completed.

[0061] Step 307: if it is detected that the computer is turned on normally after the above operations are completed, the target data stored in the target storage area is uploaded to the target server so that the target server can analyze the target data.

[0062] In this embodiment, steps 306-307 may be performed in a manner similar to steps 203-204, and will not be described in detail herein.

[0063] from Figure 3 It can be seen that Figure 2Compared with the corresponding embodiment, the process 300 of the data storage method in this embodiment embodies the step of comparing the storage space occupied by the target data with the remaining storage space of the target storage area. Therefore, the solution described in this embodiment can avoid the situation where the target data storage is missing due to insufficient remaining storage space.

[0064] In some optional implementations, the above-mentioned execution entity can delete the data in the above-mentioned target storage area in the following manner: the above-mentioned execution entity can delete the data in the above-mentioned target storage area in the order of storage time from earliest to latest, so that the remaining storage space in the above-mentioned target storage area is greater than or equal to the storage space occupied by the above-mentioned target data.

[0065] Further references Figure 4 As an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a data storage device. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0066] like Figure 4 As shown, the data storage device 400 of this embodiment includes: a storage unit 401 and an upload unit 402. The storage unit 401 is used to store target data in a target storage area in response to detecting an abnormal event, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when performing a preset operation, and the operation includes restoring the factory settings; the upload unit 402 is used to upload the target data stored in the target storage area to a target server in response to detecting that the computer is turned on normally after the operation is completed, so that the target server can analyze the target data.

[0067] In this embodiment, the specific processing of the storage unit 401 of the data storage device 400 can refer to Figure 2 Corresponding to step 201 and step 202 in the embodiment, the specific processing of the uploading unit 402 can refer to Figure 2 This corresponds to step 203 and step 204 in the embodiment.

[0068] In some optional implementations, the data storage device 400 may include: a first determination unit (not shown in the figure) and a first deletion unit (not shown in the figure). The first determination unit may be used to obtain the remaining storage space of the target storage area and determine whether the storage space occupied by the target data is larger than the remaining storage space; the first deletion unit may be used to delete the data in the target storage area if the storage space occupied by the target data is larger than the remaining storage space.

[0069] In some optional implementations, the first deleting unit may be further configured to delete the data in the target storage area in the following manner: the first deleting unit may delete the data in the target storage area in the order of storage time from earliest to latest.

[0070] In some optional implementations, the data storage device 400 may include: a second determination unit (not shown in the figure) and a presentation unit (not shown in the figure). The second determination unit may be used to determine whether to present a target page based on the abnormal event, wherein the target page is used to request whether to restore the factory settings; the presentation unit may be used to present the target page if it is determined to present the target page.

[0071] In some optional implementations, the data storage device 400 may further include: a second deleting unit (not shown in the figure). The second deleting unit may be used to delete the uploaded target data from the target storage area.

[0072] In some optional implementations, the above operations may include powering off the device.

[0073] Reference below Figure 5 , which shows an electronic device (eg, Figure 1 The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0074] like Figure 5 As shown, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage device 508 into a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.

[0075] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; and a communication device 509. The communication device 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. Figure 5 The electronic device 500 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 5 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0076] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through a communication device 509, or installed from a storage device 508, or installed from a ROM 502. When the computer program is executed by the processing device 501, the above functions defined in the method of the embodiment of the present disclosure are executed. It should be noted that the computer-readable medium described in the embodiment of the present disclosure can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection with one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, an apparatus, or a device. In an embodiment of the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in combination with an instruction execution system, an apparatus, or a device. The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wire, optical cable, RF (radio frequency), etc., or any suitable combination of the foregoing.

[0077] The computer-readable medium may be included in the electronic device; or it may exist independently without being assembled into the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: in response to detecting an abnormal event, stores target data in a target storage area, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when performing a preset operation, and the operation includes restoring the factory settings; in response to detecting that the operation is completed and the device is turned on normally, the target data stored in the target storage area is uploaded to the target server for the target server to analyze the target data.

[0078] Computer program code for performing the operations of embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as a separate software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0079] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0080] According to one or more embodiments of the present disclosure, a data storage method is provided, comprising: in response to detecting an abnormal event, storing target data in a target storage area, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when a preset operation is performed, and the operation includes restoring factory settings; in response to detecting that the computer is turned on normally after the operation is completed, uploading the target data stored in the target storage area to a target server for the target server to analyze the target data.

[0081] According to one or more embodiments of the present disclosure, before storing target data in a target storage area, the method includes: obtaining the remaining storage space of the target storage area, determining whether the storage space occupied by the target data is greater than the remaining storage space; if so, deleting the data in the target storage area.

[0082] According to one or more embodiments of the present disclosure, deleting data in the target storage area includes: deleting the data in the target storage area in order of storage time.

[0083] According to one or more embodiments of the present disclosure, in response to detecting that the computer is turned on normally after an operation is completed, before uploading the target data stored in the target storage area to the target server, the method includes: based on the abnormal event, determining whether to present a target page, wherein the target page is used to request whether to restore factory settings; if so, presenting the target page.

[0084] According to one or more embodiments of the present disclosure, after uploading the target data stored in the target storage area to the target server, the method further includes: deleting the uploaded target data from the target storage area.

[0085] According to one or more embodiments of the present disclosure, the operation includes powering off the device.

[0086] According to one or more embodiments of the present disclosure, there is provided a data storage device, comprising: a storage unit, for storing target data in a target storage area in response to detecting an abnormal event, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when a preset operation is performed, and the operation includes restoring factory settings; an uploading unit, for uploading the target data stored in the target storage area to a target server in response to detecting a normal startup after the operation is performed, so that the target server can analyze the target data.

[0087] According to one or more embodiments of the present disclosure, the data storage device also includes: a first determination unit, used to obtain the remaining storage space of the target storage area, and determine whether the storage space occupied by the target data is larger than the remaining storage space; a first deletion unit, used to delete the data in the target storage area if the storage space occupied by the target data is larger than the remaining storage space.

[0088] According to one or more embodiments of the present disclosure, the first deleting unit is further configured to delete the data in the target storage area in the following manner: deleting the data in the target storage area in order of storage time.

[0089] According to one or more embodiments of the present disclosure, the data storage device also includes: a second determination unit, used to determine whether to present a target page based on an abnormal event, wherein the target page is used to request whether to restore factory settings; and a presentation unit, used to present the target page if it is determined to present the target page.

[0090] According to one or more embodiments of the present disclosure, the data storage device further includes: a second deleting unit, configured to delete the uploaded target data from the target storage area.

[0091] According to one or more embodiments of the present disclosure, the operation includes powering off the device.

[0092] The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. The described units may also be provided in a processor, for example, may be described as: a processor including a storage unit and an upload unit. The names of these units do not constitute a limitation on the units themselves in certain circumstances, for example, a storage unit may also be described as "a unit for storing target data in a target storage area in response to detecting an abnormal event".

[0093] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) to form a technical solution.

Claims

1. A data storage method, characterized in that: include: In response to detecting an abnormal event, storing target data in a target storage area, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when a preset operation is performed, and the operation includes restoring factory settings; In response to detecting that the computer is turned on normally after the operation is completed, uploading the target data stored in the target storage area to a target server so that the target server can analyze the target data; and The method further comprises: Loading the rescue mode, monitoring the operation status, and if an abnormal event is detected, determining whether to perform a factory reset operation according to the rescue level of the abnormal event; and If the rescue level indicates that the device needs to be restored to factory settings, a target page is presented, wherein the target page is used to request whether to restore the factory settings.

2. The method according to claim 1, characterized in that Before storing the target data in the target storage area, the method includes: Acquire the remaining storage space of the target storage area, and determine whether the storage space occupied by the target data is greater than the remaining storage space; If so, the data in the target storage area is deleted.

3. The method according to claim 2, characterized in that The deleting the data in the target storage area includes: The data in the target storage area is deleted in the order of storage time.

4. The method according to claim 1, characterized in that: In response to detecting that the operation is completed and then starting up normally, before uploading the target data stored in the target storage area to the target server, the method includes: Based on the abnormal event, determining whether to present a target page, wherein the target page is used to request whether to restore factory settings; If so, the target page is presented.

5. The method according to claim 1, characterized in that After uploading the target data stored in the target storage area to the target server, the method further includes: The uploaded target data is deleted from the target storage area.

6. The method according to any one of claims 1 to 5, characterized in that: The operation includes powering off the device.

7. A data storage device, characterized in that: include: a storage unit, configured to store target data in a target storage area in response to detecting an abnormal event, wherein the target data includes log data of the abnormal event, and the data in the target storage area will not be cleared when a preset operation is performed, and the operation includes restoring factory settings; an uploading unit, configured to, in response to detecting that the computer is normally powered on after the operation is completed, upload the target data stored in the target storage area to a target server so that the target server can analyze the target data; and The storage unit is further used to: load the rescue mode, monitor the operation status, and if an abnormal event is monitored, determine whether to perform the factory settings restoration operation based on the rescue level of the abnormal event; if the rescue level indicates that the device needs to be restored to factory settings, present a target page, wherein the target page is used to request whether to restore the factory settings.

8. An electronic device, characterized in that: include: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method for obtaining information, terminal and computer readable storage medium

    CN108124252A

  • A log processing method for abnormality of a Linux kernel and an electronic device

    CN109189612A