CN114356067A - Data storage method and device and electronic equipment - Google Patents
Data storage method and device and electronic equipment Download PDFInfo
- Publication number
- CN114356067A CN114356067A CN202111680491.5A CN202111680491A CN114356067A CN 114356067 A CN114356067 A CN 114356067A CN 202111680491 A CN202111680491 A CN 202111680491A CN 114356067 A CN114356067 A CN 114356067A
- Authority
- CN
- China
- Prior art keywords
- target
- data
- storage area
- abnormal event
- target data
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 49
- 238000013500 data storage Methods 0.000 title claims abstract description 38
- 230000002159 abnormal effect Effects 0.000 claims abstract description 71
- 230000004044 response Effects 0.000 claims abstract description 10
- 238000001514 detection method Methods 0.000 claims abstract description 9
- 238000004590 computer program Methods 0.000 claims description 9
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 6
- 238000012545 processing Methods 0.000 description 6
- 238000012217 deletion Methods 0.000 description 5
- 230000037430 deletion Effects 0.000 description 5
- 230000003287 optical effect Effects 0.000 description 4
- 238000011084 recovery Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 3
- 230000000644 propagated effect Effects 0.000 description 2
- 238000012827 research and development Methods 0.000 description 2
- 239000003795 chemical substances by application Substances 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0652—Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/062—Securing storage systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0644—Management of space entities, e.g. partitions, extents, pools
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Retry When Errors Occur (AREA)
Abstract
The embodiment of the disclosure discloses a data storage method and device and electronic equipment. One embodiment of the method comprises: in response to the detection of an abnormal event, storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when a preset operation is executed, and the operation comprises the restoration of factory settings; and responding to normal startup after the operation execution is detected to be 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. The implementation method avoids the problem that data cannot be stored under the operations of factory setting restoration and the like, and improves the analysis capability of abnormal events.
Description
Technical Field
The embodiment of the disclosure relates to the technical field of computers, in particular to a data storage method and device and electronic equipment.
Background
When an abnormal condition is met, the existing intelligent device usually stores related log data into a corresponding data storage area, for example, when an abnormal condition is met, the Android (Android) intelligent device usually stores related log data into a data partition. However, when the factory settings of the intelligent device are restored, the data in the data storage areas are also cleared, which may cause the system to fail to analyze the abnormal situation according to the log data when the abnormal situation occurs, and thus the abnormal situation may not be solved well.
Disclosure of Invention
This disclosure is provided to introduce concepts in a simplified form that are further described below in the detailed description. This disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
The embodiment of the disclosure provides a data storage method and device and electronic equipment, so that the problem that data cannot be stored under the operations of factory setting restoration and the like is solved, and the analysis capability of abnormal events is improved.
In a first aspect, an embodiment of the present disclosure provides a data storage method, including: in response to the detection of an abnormal event, storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when a preset operation is executed, and the operation comprises the restoration of factory settings; and responding to normal startup after the operation execution is detected to be 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.
In a second aspect, embodiments of the present disclosure provide a data storage device, including: the storage unit is used for responding to the detection of the abnormal event and storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when preset operation is executed, and the operation comprises the restoration of factory settings; and the uploading unit is used for responding to normal startup after the completion of the operation execution and uploading the target data stored in the target storage area to the target server so that the target server can analyze the target data.
In a third aspect, an embodiment of the present disclosure provides an electronic device, including: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the data storage method of the first aspect.
In a fourth aspect, the disclosed embodiments provide a computer readable medium, on which a computer program is stored, which when executed by a processor, implements the steps of the data storage method according to the first aspect.
According to the data storage method, the data storage device and the electronic equipment, target data are stored in a target storage area in response to the detection of an abnormal event, the target data comprise log data of the abnormal event, the data in the target storage area cannot be cleared when preset operation is executed, and the operation comprises the restoration of factory settings; detecting whether the computer is normally started after the operation is finished; and if the computer is normally started after the operation is finished, uploading the target data stored in the target storage area to a target server so that the target server can analyze the target data. By the method, the log data of the abnormal event can be stored, and the stored data cannot be cleared when the operations such as factory setting recovery and the like are performed, so that the abnormal event is analyzed by using the stored data, the problem that the data cannot be stored when the operations such as factory setting recovery and the like are performed is solved, and the analysis capability of the abnormal event is improved.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale.
FIG. 1 is an exemplary system architecture diagram in which various embodiments of the present disclosure may be applied;
FIG. 2 is a flow diagram for one embodiment of a data storage method according to the present disclosure;
FIG. 3 is a flow diagram of yet another embodiment of a data storage method according to the present disclosure;
FIG. 4 is a schematic structural diagram of one embodiment of a data storage device according to the present disclosure;
FIG. 5 is a schematic block diagram of a computer system suitable for use in implementing an electronic device of an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "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". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
FIG. 1 illustrates an exemplary system architecture 100 to which embodiments of the data storage methods of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 1011, 1012, 1013, a network 102, and a server 103. Network 102 is the medium used to provide communication links between terminal devices 1011, 1012, 1013 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may interact with the server 103 via the network 102 using the terminal devices 1011, 1012, 1013 to send or receive messages or the like, e.g., the terminal devices 1011, 1012, 1013 may upload target data stored in the target storage areas to the server 103. Various communication client applications, such as shopping applications, instant messaging software, etc., may be installed on the terminal devices 1011, 1012, 1013.
The terminal device 1011, 1012, 1013 may determine whether an abnormal event is detected; if an abnormal event is detected, storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when a preset operation is executed, and the operation comprises factory setting restoration; then, whether the computer is normally started after the operation is executed can be detected; if normal startup is performed after the operation is detected to be completed, the target data stored in the target storage area can be uploaded to a target server so that the target server can analyze the target data.
The terminal devices 1011, 1012, 1013 may be hardware or software. When the terminal devices 1011, 1012, 1013 are hardware, they may be various electronic devices having a display screen and supporting information interaction, including but not limited to smart phones, tablet computers, laptop computers, and the like. When the terminal devices 1011, 1012, 1013 are software, they may be installed in the electronic devices listed above. It may be implemented as multiple pieces of software or software modules (e.g., multiple pieces of software or software modules to provide distributed services) or as a single piece of software or software module. And is not particularly limited herein.
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, 1013.
The server 103 may be hardware or software. When the server 103 is hardware, it may be implemented as a distributed server cluster composed of a plurality of servers, or may be implemented as a single server. When the server 103 is software, it may be implemented as multiple pieces of software or software modules (e.g., to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be noted that the data storage method provided by the embodiment of the present disclosure is generally executed by the terminal equipment 1011, 1012, 1013, and the data storage device is generally disposed in the terminal equipment 1011, 1012, 1013.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, a flow 200 of one embodiment of a data storage method according to the present disclosure is shown. The data storage method comprises the following steps:
In the present embodiment, the execution subject of the data storage method (e.g., the terminal device shown in fig. 1) may determine whether an abnormal event is detected. An exception event generally refers to an event that causes the execution agent (e.g., operating system) to not function properly. As an example, the exception event may be an event that the system cannot enter the boot top page during the boot phase. The abnormal event can also be an event that the current page is stuck and cannot enter the preloaded page.
If an abnormal event is detected, the execution subject may execute step 202.
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 is not cleared when a preset operation is performed. The operation may include restoring factory settings, or may include a power-on-demand or abnormal power failure.
In this embodiment, the execution body may detect whether to execute a preset operation, for example, restore a factory setting. If the execution of the operation is detected, the execution main body can detect whether the computer is normally started at present.
If normal booting is detected, the execution body may execute step 204.
And step 204, if normal startup is carried out after the operation execution is detected, uploading the target data stored in the target storage area to a target server for the target server to analyze the target data.
In this embodiment, if the execution main body normally boots up after detecting that the operation is executed in step 203, the execution main body may upload the target data stored in the target storage area to a target server, so that the target server may analyze the target data. The target server may be a server for analyzing an abnormal event in the execution subject. After analyzing the target data, the target server can send the analysis result to the terminal device of the research and development personnel, and the research and development personnel can solve the problems.
Here, the execution body may load a Rescue mode (Rescue Party) after the execution body is started. The rescue mode can monitor the operation condition of the execution main body. The execution main body can perform a series of operations according to different rescue levels, and whether the equipment can be recovered or not is judged, and the problem is solved by recovering factory settings in the worst case. If the execution main body is monitored to have the abnormal event, the rescue level of the current abnormal event can be determined according to the type of the abnormal event. Here, the rescue level may include one level, two levels, and three levels. The first level may refer to repairing the configuration file to restore the device, the second level may refer to deleting the current configuration file, and restoring the device after the configuration file is regenerated, and the third level may refer to restoring factory settings of the device.
The method provided by the above embodiment of the present disclosure is implemented by determining whether an abnormal event is detected; if an abnormal event is detected, storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when a preset operation is executed, and the operation comprises the restoration of factory settings; detecting whether the operation is started normally after the operation is executed; and if the operation is normally started after the execution is finished, uploading the target data stored in the target storage area to a target server so that the target server can analyze the target data. By the method, the log data of the abnormal event can be stored, and the stored data cannot be cleared when the operations such as factory setting recovery and the like are performed, so that the stored data is used for analyzing the abnormal event, the problem that the data cannot be stored when the operations such as factory setting recovery and the like are performed is avoided, and the analysis capability of the abnormal event is improved.
In some optional implementations, before the system is normally powered on after the operation is executed and the target data stored in the target storage area is uploaded to a target server in response to detection of completion of execution of the operation, the execution main body may determine whether to present a target page based on the abnormal event, where the target page may be used to request whether to restore factory settings. If so, the execution main body can present the target page. Specifically, the execution main body may store a corresponding relationship table of a corresponding relationship between an abnormal event and a rescue level, the execution main body may search the rescue level corresponding to the currently-occurring abnormal event in the corresponding relationship table, and if the rescue level corresponding to the currently-occurring abnormal event is three levels, the execution main body may determine that factory setting needs to be restored on the device, and at this time, the execution main body may present a target page.
In some optional implementations, after uploading the target data stored in the target storage area to a target server, the execution subject may delete the uploaded target data from the target storage area, so that an effective space of the target storage area may be made available in time.
In some alternative implementations, the operation may include powering down the device. And normally starting the device after the power failure, wherein the execution main body still can acquire the log data of the abnormal event in the target storage area and upload the log data of the abnormal event to the target server, so that the log data of the abnormal event can be stored when the device is powered off.
With further reference to FIG. 3, a flow 300 of yet another embodiment of a data storage method is illustrated. The process 300 of the data storage method includes the following steps:
In this embodiment, step 301 may be performed in a similar manner to step 201, and will not be described herein again.
In this embodiment, if an abnormal event is detected in step 301, the execution main body may acquire the remaining storage space of the target storage area. The data in the target storage area is not cleared when a preset operation is performed. The operation may include restoring factory settings, or may include a power-on-demand or abnormal power failure.
In this embodiment, the execution main body may determine whether the storage space occupied by the target data is larger than the remaining storage space. The target data may include log data of the abnormal event, and may also include a configuration file used when the abnormal event occurs.
If the storage space occupied by the target data is larger than the remaining storage space, the execution main body may execute step 304.
In 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.
In this embodiment, if it is determined in step 303 that the storage space occupied by the target data is larger than the remaining storage space, the execution main body may delete the data in the target storage area. As an example, the execution main body may delete all data in the target storage area, and the execution main body may randomly delete data in the target storage area.
It should be noted that the remaining storage space may be represented by the number of log copies, that is, the execution main body may obtain the number of remaining storable log copies of the target storage area, and if the number of log copies of the abnormal event is greater than the number of remaining storable log copies, the execution main body may delete the data in the target storage area, so that the number of remaining storable log copies in the target storage area is greater than or equal to the number of log copies of the log to be stored.
In this embodiment, the execution subject may store the target data in the target storage area.
In the present embodiment, the steps 306-307 can be performed in a similar manner to the steps 203-204, and will not be described herein again.
As can be seen from fig. 3, compared with the embodiment corresponding to fig. 2, the flow 300 of the data storage method in this embodiment represents a step of comparing the storage space occupied by the target data with the remaining storage space of the target storage area. Therefore, the scheme described in the embodiment can avoid the condition of target data storage missing caused by insufficient residual storage space.
In some optional implementations, the execution subject may delete the data in the target storage area by: the execution main body may delete the data in the target storage area in the order of the storage time from the beginning to the end so that the remaining storage space in the target storage area is greater than or equal to the storage space occupied by the target data.
With further reference to fig. 4, as an implementation of the methods shown in the above figures, the present disclosure provides an embodiment of a data storage device, which corresponds to the method embodiment shown in fig. 2, and which is particularly applicable in various electronic devices.
As shown in fig. 4, the data storage device 400 of the present embodiment includes: a storage unit 401 and an upload unit 402. The storage unit 401 is configured to, in response to detecting an abnormal event, store target data in a target storage area, where the target data includes log data of the abnormal event, and data in the target storage area is not cleared when a preset operation is performed, where the operation includes restoring factory settings; the uploading unit 402 is configured to, in response to normal startup after the operation is detected to be completed, upload the target data stored in the target storage area to a target server, so that the target server analyzes the target data.
In this embodiment, the specific processing of the storage unit 401 of the data storage device 400 may refer to step 201 and step 202 in the corresponding embodiment of fig. 2, and the specific processing of the uploading unit 402 may refer to step 203 and step 204 in the corresponding embodiment of fig. 2.
In some alternative 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 determining unit may be configured to obtain a 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 deleting unit may be configured 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.
In some optional implementations, the first deleting unit may be further configured to delete the data in the target storage area by: the first deletion unit may delete the data in the target storage area in order of storage time from first to last.
In some alternative 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 determining unit may be configured to determine whether to present a target page based on the abnormal event, where the target page is used to request whether to restore factory settings; the presenting unit may be configured to present the target page if it is determined that the target page is presented.
In some optional implementations, the data storage apparatus 400 may further include: a second deletion unit (not shown in the figure). The second deletion unit may be configured to delete the uploaded target data from the target storage area.
In some alternative implementations, the operation may include powering down the device.
Referring now to fig. 5, a block diagram of an electronic device (e.g., the terminal device of fig. 1) 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 5, electronic device 500 may include a processing means (e.g., central processing unit, graphics processor, etc.) 501 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM503 are connected to each other through a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
Generally, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 507 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; and a communication device 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 5 illustrates an electronic device 500 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided. Each block shown in fig. 5 may represent one device or may represent multiple devices as desired.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or installed from the storage means 508, or installed from the ROM 502. The computer program, when executed by the processing device 501, performs the above-described functions defined in the methods of embodiments of the present disclosure. It should be noted that the computer readable medium described in the embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In embodiments of the disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In embodiments of the present disclosure, however, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: in response to the detection of an abnormal event, storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when a preset operation is executed, and the operation comprises the restoration of factory settings; and responding to normal startup after the operation execution is detected to be 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.
Computer program code for carrying out operations for embodiments of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
According to one or more embodiments of the present disclosure, there is provided a data storage method including: in response to the detection of an abnormal event, storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when a preset operation is executed, and the operation comprises the restoration of factory settings; and responding to normal startup after the operation execution is detected to be 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.
According to one or more embodiments of the present disclosure, prior to storing target data in a target storage area, a method includes: acquiring the residual storage space of the target storage area, and determining whether the storage space occupied by the target data is larger than the residual storage space; and if so, deleting the data in the target storage area.
According to one or more embodiments of the present disclosure, deleting data in a target storage area includes: and deleting the data in the target storage area according to the sequence of the storage time from the first to the last.
According to one or more embodiments of the present disclosure, before normally booting after detecting that the operation is completed, uploading target data stored in a target storage area to a target server, the method includes: determining whether a target page is presented or not based on the abnormal event, wherein the target page is used for requesting whether factory settings are restored or not; and if so, presenting the target page.
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: and deleting the uploaded target data from the target storage area.
According to one or more embodiments of the present disclosure, the operation includes powering down the device.
According to one or more embodiments of the present disclosure, there is provided a data storage device including: the storage unit is used for responding to the detection of the abnormal event and storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when preset operation is executed, and the operation comprises the restoration of factory settings; and the uploading unit is used for responding to normal startup after the completion of the operation execution and uploading the target data stored in the target storage area to the target server so that the target server can analyze the target data.
According to one or more embodiments of the present disclosure, the data storage device further includes: the first determining unit is used for acquiring the residual storage space of the target storage area and determining whether the storage space occupied by the target data is larger than the residual storage space; and the first deleting unit is used for deleting the data in the target storage area if the storage space occupied by the target data is larger than the residual storage space.
According to one or more embodiments of the present disclosure, the first deletion unit is further configured to delete the data in the target storage area by: and deleting the data in the target storage area according to the sequence of the storage time from the first to the last.
According to one or more embodiments of the present disclosure, the data storage device further includes: the second determining unit is used for determining whether a target page is presented or not based on the abnormal event, wherein the target page is used for requesting whether factory settings are restored or not; and the presentation unit is used for presenting the target page if the presentation target page is determined.
According to one or more embodiments of the present disclosure, the data storage device further includes: and the second deleting unit is used for deleting the uploaded target data from the target storage area.
According to one or more embodiments of the present disclosure, the operation includes powering down the device.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a storage unit and an upload unit. Where the names of the units do not in some cases constitute a limitation on the units themselves, for example, a storage unit may also be described as a "unit that stores target data to a target storage area in response to detecting an abnormal event".
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above-mentioned features, but also encompasses other embodiments in which any combination of the above-mentioned features or their equivalents is made without departing from the inventive concept as defined above. For example, the above features and (but not limited to) technical features with similar functions disclosed in the embodiments of the present disclosure are mutually replaced to form the technical solution.
Claims (9)
1. A method of storing data, comprising:
in response to detecting an abnormal event, storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when a preset operation is executed, and the operation comprises factory setting restoration;
and responding to normal startup after the operation execution is detected to be 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.
2. The method of claim 1, wherein prior to said storing the target data in the target storage area, the method comprises:
acquiring the residual storage space of the target storage area, and determining whether the storage space occupied by the target data is larger than the residual storage space;
and if so, deleting the data in the target storage area.
3. The method of claim 2, wherein the deleting data in the target storage area comprises:
and deleting the data in the target storage area according to the storage time from first to last.
4. The method according to claim 1, wherein before the normal power-on after the operation is detected to be executed, the target data stored in the target storage area is uploaded to a target server, the method comprises:
determining whether a target page is presented or not based on the abnormal event, wherein the target page is used for requesting whether factory settings are restored or not;
and if so, presenting the target page.
5. The method of claim 1, wherein after the uploading the target data stored in the target storage area to a target server, the method further comprises:
and deleting the uploaded target data from the target storage area.
6. The method of any of claims 1-5, wherein the operation comprises powering down a device.
7. A data storage device, comprising:
the storage unit is used for responding to the detection of an abnormal event and storing target data into a target storage area, wherein the target data comprises log data of the abnormal event, the data in the target storage area cannot be cleared when a preset operation is executed, and the operation comprises the restoration of factory settings;
and the uploading unit is used for responding to normal startup after the operation execution is detected to be 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.
8. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-6.
9. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111680491.5A CN114356067A (en) | 2021-12-30 | 2021-12-30 | Data storage method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111680491.5A CN114356067A (en) | 2021-12-30 | 2021-12-30 | Data storage method and device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114356067A true CN114356067A (en) | 2022-04-15 |
Family
ID=81104644
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111680491.5A Pending CN114356067A (en) | 2021-12-30 | 2021-12-30 | Data storage method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114356067A (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060229896A1 (en) * | 2005-04-11 | 2006-10-12 | Howard Rosen | Match-based employment system and method |
CN108124252A (en) * | 2017-12-29 | 2018-06-05 | 深圳市金立通信设备有限公司 | A kind of method, terminal and computer readable storage medium for obtaining information |
CN109189612A (en) * | 2018-09-04 | 2019-01-11 | 广东小天才科技有限公司 | Log processing method and electronic device during Linux kernel exception |
CN111581021A (en) * | 2020-04-29 | 2020-08-25 | 北京字节跳动网络技术有限公司 | Method, device and equipment for repairing application program starting abnormity and storage medium |
-
2021
- 2021-12-30 CN CN202111680491.5A patent/CN114356067A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060229896A1 (en) * | 2005-04-11 | 2006-10-12 | Howard Rosen | Match-based employment system and method |
CN108124252A (en) * | 2017-12-29 | 2018-06-05 | 深圳市金立通信设备有限公司 | A kind of method, terminal and computer readable storage medium for obtaining information |
CN109189612A (en) * | 2018-09-04 | 2019-01-11 | 广东小天才科技有限公司 | Log processing method and electronic device during Linux kernel exception |
CN111581021A (en) * | 2020-04-29 | 2020-08-25 | 北京字节跳动网络技术有限公司 | Method, device and equipment for repairing application program starting abnormity and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106897095B (en) | Method and device for hot repairing application program, readable storage medium and computing equipment | |
CN111597065B (en) | Method and device for collecting equipment information | |
CN111274503B (en) | Data processing method, device, electronic equipment and computer readable medium | |
CN111367698B (en) | Application program flash back detection and processing method and device and electronic equipment | |
CN111198859A (en) | Data processing method and device, electronic equipment and computer readable storage medium | |
CN112016284B (en) | Electronic form processing method and device | |
CN111338834B (en) | Data storage method and device | |
CN109634702B (en) | Information prompting method and device, electronic equipment and readable medium | |
CN110221857A (en) | The problem of application program restorative procedure, device, electronic equipment and storage medium | |
CN111198853B (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
CN111274104B (en) | Data processing method, device, electronic equipment and computer readable storage medium | |
CN111367720A (en) | Data protection method and device, electronic equipment and computer readable storage medium | |
CN106933449B (en) | Icon processing method and device | |
CN114356067A (en) | Data storage method and device and electronic equipment | |
CN111324386B (en) | Method and device for starting split application program, electronic equipment and storage medium | |
CN114968644A (en) | System software dump method and device, electronic equipment and readable storage medium | |
CN114385096B (en) | Display control method, device, terminal and storage medium | |
CN111290873B (en) | Fault processing method and device | |
CN112882921B (en) | Fault simulation method and device | |
CN113760631A (en) | Page loading duration determination method, device, equipment and storage medium | |
CN113094211B (en) | Backup data processing method and device | |
CN110471714B (en) | Method, device, terminal and storage medium for controlling application starting | |
CN113419992B (en) | File clearing configuration page display method and device, electronic equipment and medium | |
CN111324888B (en) | Verification method and device for application program starting, electronic equipment and storage medium | |
CN112052128B (en) | Disaster recovery method and device and electronic equipment |
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 |