CN109445991B - Data storage method and system, intelligent wearable device and storage medium - Google Patents

Data storage method and system, intelligent wearable device and storage medium Download PDF

Info

Publication number
CN109445991B
CN109445991B CN201811277378.0A CN201811277378A CN109445991B CN 109445991 B CN109445991 B CN 109445991B CN 201811277378 A CN201811277378 A CN 201811277378A CN 109445991 B CN109445991 B CN 109445991B
Authority
CN
China
Prior art keywords
memory space
data
restart
initialized
target
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.)
Active
Application number
CN201811277378.0A
Other languages
Chinese (zh)
Other versions
CN109445991A (en
Inventor
王君伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Goertek Techology Co Ltd
Original Assignee
Goertek Techology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Goertek Techology Co Ltd filed Critical Goertek Techology Co Ltd
Priority to CN201811277378.0A priority Critical patent/CN109445991B/en
Publication of CN109445991A publication Critical patent/CN109445991A/en
Application granted granted Critical
Publication of CN109445991B publication Critical patent/CN109445991B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1438Restarting or rejuvenating
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/16Constructional details or arrangements
    • G06F1/1613Constructional details or arrangements for portable computers
    • G06F1/163Wearable computers, e.g. on a belt

Abstract

The application discloses a data storage method, which divides a non-initialized memory space which does not execute initialization operation when restarting from the original complete memory space, and simultaneously keeps the non-initialized memory space and the initialized memory space which stores the latest data consistent on the data. Therefore, even if the device is abnormally restarted without power failure, the initialization operation is only executed in the initialized memory space and does not include the non-initialized memory space, so that the latest data and some abnormal data of the abnormal restart are still stored in the non-initialized memory space. The application also discloses a data storage system, intelligent wearable equipment applying the data storage system and a computer readable storage medium, and the data storage system and the intelligent wearable equipment have the beneficial effects.

Description

Data storage method and system, intelligent wearable device and storage medium
Technical Field
The present application relates to the field of data loss prevention technologies, and in particular, to a data storage method, a data storage system, an intelligent wearable device, and a computer-readable storage medium.
Background
Along with the popularization of intelligent wearable equipment, intelligent bracelet and intelligent wrist-watch become common equipment in people's life, and intelligent wearable equipment also can inevitable appear the unusual phenomenon of restarting of not falling the electricity because of reasons such as unusual collapse of procedure, inside watchdog resets, hardware reset in the use.
It should be appreciated that the memory of such an intelligent wearable device includes a memory and a hard disk, for example, an intelligent bracelet is taken as an example, the step counting function will cause frequent data update, the latest data will be stored in the memory before normal power down shutdown, and when a normal power down shutdown instruction is received, the data in the memory will be flushed down to the hard disk for persistent storage, because the memory has the characteristic of power down volatility, while the hard disk is not power down volatility, and the number of data erasing times of the hard disk can be reduced by a small number of flushing down times, so as to prolong the service life of the hard disk. When the intelligent wearable device is normally restarted, the intelligent wearable device can execute initialization operation: and rewriting the data in the hard disk into the memory so as to update the data based on the last recorded data.
Once the intelligent wearable device is abnormally restarted without power failure, the latest data in the memory cannot be timely stored to the hard disk according to a normal flow, but the initialization process can still be executed after each restart, so that the latest data stored in the memory is covered by the old data which is not updated in the hard disk, the latest data is lost, and the reason of the abnormal restart cannot be analyzed according to some abnormal data recorded before the abnormal restart.
Therefore, how to overcome the technical defect of the prior art that the latest data is lost when the abnormal restart occurs is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The present application aims to provide a data storage method, which divides a non-initialized memory space that does not execute initialization operation when restarting from an original complete memory space, and simultaneously keeps the non-initialized memory space consistent with an initialized memory space storing latest data in terms of data. Therefore, even if the device is abnormally restarted without power failure, the initialization operation is only executed in the initialized memory space and does not include the non-initialized memory space, so that the latest data and some abnormal data of the abnormal restart are still stored in the non-initialized memory space.
Another object of the present application is to provide a data storage method, system, apparatus, and computer-readable storage medium.
In order to achieve the above object, the present application further provides a data storage method, including:
dividing the memory space of the target device into an initialized memory space and a non-initialized memory space; the initialization memory space is used for storing the latest data acquired by the target equipment;
synchronizing the latest data to the non-initialized memory space;
when the target device is restarted, extracting target data from the hard disk space of the target device, and updating the data in the initialized memory space into the target data.
Optionally, dividing the memory space of the target device into an initialized memory space and a non-initialized memory space, includes:
dividing a memory space block with a preset size from the memory space;
configuring the attribute of the memory space block into non-initialization to obtain a non-initialization memory space;
naming the memory space except the non-initialized memory space in the memory space as the initialized memory space; wherein the attribute of the memory space is initialization.
Optionally, when the target device is restarted, extracting target data from a hard disk space of the target device, and updating only data in the initialized memory space to the target data includes:
when the target equipment is restarted, judging whether the current starting mode of the target equipment is abnormal restarting without power failure;
and if the current starting mode of the target equipment is abnormal restarting without power failure, extracting target data from a hard disk space of the target equipment, and updating the data in the initialized memory space into the target data.
Optionally, the determining whether the current starting mode of the target device is an abnormal restart without power loss includes:
reading from the non-initialized memory space to obtain a restart identifier; the restarting mark comprises a normal power failure restarting mark, an abnormal power failure restarting mark and an abnormal non-power-off restarting mark;
and judging whether the current starting mode of the target equipment is the abnormal restarting without power failure according to whether the restarting mark is the abnormal power failure-free restarting mark.
Optionally, before reading the restart identifier from the non-initialized memory space, the method further includes:
setting a restart identification field in the non-initialized memory space;
writing the type of each restart of the target equipment into the restart identification field in the form of corresponding identification;
correspondingly, reading a restart identifier from the non-initialized memory space, including:
and reading the restart identification from the restart identification field.
Optionally, setting a restart identifier field in the non-initialized memory space includes:
acquiring a first address of the non-initialized memory space;
setting the initial address as a starting address of the restart identification field, and calculating to obtain an ending address according to a preset field size and the starting address to obtain the restart identification field with an address range from the starting address to the ending address;
correspondingly, reading the restart identifier from the restart identifier field, including:
and determining the restart identification field according to the address range, and reading the restart identification from the restart identification field.
Optionally, before extracting the target data from the hard disk space of the target device, the method further includes:
and updating the target data in the hard disk space by using the data in the non-initialized memory space.
To achieve the above object, the present application also provides a data storage system, including:
the memory space dividing unit is used for dividing the memory space of the target equipment into an initialized memory space and a non-initialized memory space; the initialization memory space is used for storing the latest data acquired by the target equipment;
a data synchronization unit, configured to synchronize the latest data to the non-initialized memory space;
and the restart initialization execution unit is used for extracting target data from the hard disk space of the target device and updating the data in the initialization memory space into the target data only when the target device is restarted.
In order to achieve the above object, the present application further provides a wearable device of intelligence, including:
a memory for storing a computer program;
a processor for implementing the steps of the data storage method as described above when executing said computer program.
To achieve the above object, the present application also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the data storage method as described above.
Obviously, according to the data storage method provided by the present application, a non-initialized memory space in which initialization operation is not performed during restart is partitioned from an original complete memory space, and meanwhile, the non-initialized memory space and the initialized memory space in which the latest data is stored are kept consistent in data. Therefore, even if the device is abnormally restarted without power failure, the initialization operation is only executed in the initialized memory space and does not include the non-initialized memory space, so that the latest data and some abnormal data of the abnormal restart are still stored in the non-initialized memory space. The application also provides a data storage system, intelligent wearable equipment and a computer readable storage medium, and the beneficial effects are achieved, and are not repeated herein.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a data storage method according to an embodiment of the present application;
FIG. 2 is a flow chart of another data storage method provided by an embodiment of the present application;
fig. 3 is a flowchart of a method for determining whether a current starting manner of a target device is an abnormal restart without power loss in a data storage method according to an embodiment of the present application;
fig. 4 is a flowchart of a method for determining a current boot mode by storing different boot identifiers corresponding to different boot modes in a preset boot identifier field in a data storage method according to an embodiment of the present disclosure;
fig. 5 is a block diagram of a data storage system according to an embodiment of the present application.
Detailed Description
The core of the application is to provide a data storage method, a system, an intelligent wearable device and a computer readable storage medium, to divide a non-initialized memory space which does not execute initialization operation when restarting from an original complete memory space, and to keep the non-initialized memory space and the initialized memory space storing the latest data consistent on data. Therefore, even if the device is abnormally restarted without power failure, the initialization operation is only executed in the initialized memory space and does not include the non-initialized memory space, so that the latest data and some abnormal data of the abnormal restart are still stored in the non-initialized memory space.
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Example one
Referring to fig. 1, fig. 1 is a flowchart of a data storage method according to an embodiment of the present application, which specifically includes the following steps:
s101: dividing the memory space of the target device into an initialized memory space and a non-initialized memory space;
this step is intended to split the originally complete memory space of the target device into two parts, one part being the initialized memory space and the other part being the non-initialized memory space. The initialization operation is an operation of, when the target device is restarted, re-reading the latest data stored in the hard disk when the target device was last closed into the memory space. The initialization memory space is a memory space in which the initialization operation is performed on the data stored in the target device when the target device is restarted, and the non-initialization memory space is a memory space in which the initialization operation is not performed on the data stored in the target device when the target device is restarted, so that when the target device is abnormally restarted without power failure, the latest data which is not stored and the recorded abnormal data related to the abnormal restart can be found in the non-initialization memory space. It should be noted that the attribute of the complete memory space before being split is default to perform initialization, that is, the property of the complete memory space before being split is equivalent to the initialized memory space, and this step may also be equivalent to dividing a part of space from the complete initialized memory space and configuring the attribute as non-initialization.
Specifically, how to obtain an initialized memory space and a non-initialized memory space from the complete memory space division is various, and the memory space with a preset size can be divided in a space redistribution mode on the basis that the original memory space is the initialized memory space, and becomes the non-initialized memory space through corresponding configuration; or splitting the complete memory space which is not configured to execute the initialization operation according to a preset size to obtain a first memory space and a second memory space, and naming, attribute configuration and other operations are respectively performed on the first memory space and the second memory space; even if there are two or even multiple different memory spaces originally, the configuration of the memory spaces may be modified to change the two memory spaces into an initialized memory space and a non-initialized memory space, and the like, which is not specifically limited herein, and the purpose of this step may be achieved by flexibly selecting a suitable manner according to different application scenarios.
S102: synchronizing the latest data to the non-initialized memory space;
on the basis of S101, this step is intended to control the data stored in the initialization memory space to be consistent with the data stored in the initialization memory space. It should be noted that, in the present application, the initialized memory space inherits the function of storing the latest data acquired by the target device in the original complete memory space, so that the latest data acquired and calculated in real time by the intelligent wearable devices such as the smart band and the smart watch will be directly stored in the initialized memory space. In order to prevent the latest data from being lost when the abnormal restart without power failure occurs, the latest data is stored in the non-initialized memory space through a data synchronization mechanism between the non-initialized memory space and the initialized memory space.
The specific setting of data synchronization is not specifically limited here, and in order to make the lost data as small as possible, the data synchronization may be set as real-time synchronization; or directly writing the latest data acquired and calculated into the non-initialized memory space and the initialized memory space (data double writing) at the same time after the first data synchronization is finished. If the requirement is not high, the data stored in the non-initialized memory space and the data stored in the initialized memory space can be consistent by adopting a mode of periodically executing data synchronization operation.
It should be further noted that the uninitialized memory space and the initialized memory space are often identified by different variable names, and specific variable names can be customized.
S103: when the target device is restarted, the target data is extracted from the hard disk space of the target device, and only the data in the initialized memory space is updated to the target data.
On the basis of S102, this step is intended to perform an initialization operation only on the data in the initialization memory space when the target device is restarted, that is, extract the target data from the hard disk space of the target device, and update only the data in the initialization memory space to the target data. And the target data is the latest data stored to the hard disk space according to the flow work flow when the target equipment is powered off last time.
It should be further noted that, according to the reason for restarting the device, the device can be divided into three categories, namely normal power-down restart, abnormal power-down restart, and abnormal power-off restart, where the normal power-down restart refers to device shutdown and subsequent restart executed according to a normal shutdown instruction, and during the restart, the latest data stored in the memory space is saved in the hard disk space before the final power-down, so that the latest data can be restored from the hard disk space to the memory space again when the device is started next time; in this case, the data stored in the memory space cannot be stored in the hard disk space, and all the data stored in the memory space is lost after the power failure, which is not addressed in the present application; the abnormal non-power-down restart is that the device is restarted in a soft manner due to software, program crash and crash, and the memory space still stores the latest data due to non-power-down, but the initialization operation is executed by default when the device is restarted next time, so that the latest data is lost due to the fact that the latest data is covered by the old data in the hard disk space. The present application addresses this situation by partitioning a non-initialization memory space in which initialization operations are not performed at the time of reboot, so as to sufficiently reserve the latest data stored therein and in the initialization memory space in which initialization operations are performed.
Furthermore, after the target device is restarted every time and before the initialization operation is executed, whether the current starting mode of the device is abnormal restart without power loss is judged, if yes, the target data to be used for executing the initialization operation in the hard disk space is updated by using the data stored in the non-initialization memory space before the initialization operation is executed, and therefore the target data can be used when the initialization operation is executed instead of old data and latest data. Furthermore, when the abnormal restart without disconnection is judged, the device can directly use the latest data stored in the non-initialized memory space for displaying.
Furthermore, the reason why the latest data is lost when the abnormal restart without power failure occurs to the device is that the device does not selectively execute different operations according to the current restart mode every time the device is restarted, that is, the initialization operation is executed according to the default normal restart mode without power failure, that is, the data stored in the hard disk space is reloaded into the memory space, regardless of whether the abnormal restart without power failure occurs. Under the mechanism, if the current restart mode is an abnormal restart mode without disconnection, the initialization operation will cause the latest data still existing in the memory space to be covered by the old data in the hard disk space and lost. Therefore, under the condition that the situation allows, the current restarting mode can be checked at each restarting of the equipment, and the initialization operation is selectively executed or not executed according to the current starting mode, namely when the abnormal restarting without power failure is found by checking, the purpose consistent with the application can be realized by selecting the mode without executing the initialization operation.
Based on the above technical solution, in the data storage method provided in the embodiments of the present application, a non-initialized memory space in which an initialization operation is not performed during a restart is partitioned from an original complete memory space, and meanwhile, the non-initialized memory space and the initialized memory space in which the latest data is stored are kept consistent in data. Therefore, even if the device is abnormally restarted without power failure, the initialization operation is only executed in the initialized memory space and does not include the non-initialized memory space, so that the latest data and some abnormal data of the abnormal restart are still stored in the non-initialized memory space.
Example two
Referring to fig. 2, fig. 2 is a flowchart of another data storage method according to an embodiment of the present application, where in the embodiment, on the basis of the first embodiment, a method for specifically dividing to obtain a non-initialized memory space and an initialized memory space is provided for S101 through S201, S202, and S203; for S103, a method for how to perform data operation to achieve the purpose of not losing the latest data when the target device is abnormally restarted without power failure is given through S205 and S206, and the remaining steps are not changed, it should be noted that the lower level schemes given for S101 and S103 in this embodiment may also form corresponding lower level embodiments on the basis of the first embodiment alone, and this embodiment exists only as an embodiment that includes two preferred solutions at the same time, and the specific implementation steps are as follows:
s201: dividing a memory space block with a preset size from a memory space;
firstly, a memory space block is divided according to a preset size.
S202: configuring the attribute of the memory space block into non-initialization to obtain a non-initialization memory space;
the attribute of the memory space block is configured as non-initialized, that is, when the target device is restarted, the execution range of the initialization operation does not include the memory space with the attribute of non-initialized.
S203: naming the memory space except the initialized memory space in the memory space as the initialized memory space; the attribute of the memory space is initialized;
it should be noted that, in this embodiment, the attribute established in the initial and complete memory space is initialization, that is, the initialization operation is executed on the target device by default when the target device is restarted, so that the attribute of the initialization memory space inherits the initialized attribute without modifying the attribute configuration.
S204: synchronizing the latest data to the non-initialized memory space;
s205: when the target equipment is restarted, judging whether the current starting mode of the target equipment is abnormal restarting without power failure;
the present embodiment mainly addresses a situation that a current starting mode of the device is an abnormal restart without power failure, and therefore it is necessary to determine whether the current starting mode is the abnormal restart without power failure.
The key point of the abnormal restart without power failure is that the restart occurs and the restart is not disconnected, so that the judgment of the abnormal restart can be realized according to the two characteristics. Specifically, since power failure does not occur, under the condition that power supply is not stopped at pins of some components of the device, a corresponding identifier can be generated according to the restart occurrence information, so that the current starting mode of the target device is judged to be abnormal restart without power failure when the identifier is detected to exist.
S206: when the current starting mode of the target equipment is abnormal restarting without power failure, target data is extracted from the hard disk space of the target equipment, and only the data in the initialized memory space is updated to the target data.
EXAMPLE III
With reference to fig. 3, fig. 3 is a flowchart of a method for determining whether a current starting manner of a target device is an abnormal restart without power loss in a data storage method provided in an embodiment of the present application, where in this embodiment, on the basis of the second embodiment, for S2054, a method for determining whether the current starting manner of the target device is an abnormal restart without power loss through S301 and S302 is provided, and specific implementation steps are as follows:
s301: reading a restart identifier from a non-initialized memory space;
the restart identifier here includes three types, namely a normal power-down restart identifier, an abnormal power-down restart identifier and an abnormal non-power-down restart identifier, which are similar to the three types mentioned above.
S302: and judging whether the current starting mode of the target equipment is the abnormal restarting without power failure according to whether the restarting mark is the abnormal power failure-free restarting mark.
On the basis of S301, if the restart identifier is an abnormal non-power-off restart identifier, it may be determined that the current start mode of the target device is an abnormal restart without power-off.
In order to obtain a restart identifier by reading from the non-initialized memory space according to the scheme provided in the third embodiment, and determine whether the current start mode of the target device is an abnormal restart without power failure according to whether the read specific restart identifier and the abnormal non-power-failure restart identifier are obtained, the following settings need to be made in advance, please refer to fig. 4:
s401: setting a restart identification field in a non-initialized memory space;
s402: writing the type of each restart of the target equipment into a restart identification field in a corresponding identification form;
s403: and reading the restart identifier from the restart identifier field.
For the technical solution shown in fig. 4, the present application further provides an implementation method for setting a restart identifier field according to a first address, which includes the following implementation steps:
acquiring a first address of a non-initialized memory space;
and setting the initial address as the starting address of the restart identification field, and calculating to obtain an ending address according to the preset field size and the starting address to obtain the restart identification field with the address range from the starting address to the ending address.
On the basis, the reading of the restart identifier from the restart identifier field becomes: and determining a restart identification field according to the address range, and reading from the restart identification field to obtain a restart identification.
Example four
In order to deepen understanding of the invention of the present application, the present application provides a specific implementation manner based on the above scheme and in combination with a specific application scenario, where the application scenario of this embodiment is an intelligent wearable device such as an intelligent watch, an intelligent bracelet, and the like, and provides an implementation scheme capable of preventing latest data from being lost when the device is abnormally restarted without power failure, in a targeted manner:
firstly: dividing a part of the memory space (namely initialized memory space) with the original attribute for executing initialization operation, and configuring the attribute into non-initialization to obtain the non-initialized memory space;
secondly, the method comprises the following steps: and controlling the non-initialized memory space to be consistent with the data stored in the initialized memory space, so that the latest data in the non-initialized memory space is not lost due to the execution of initialization operation when the target device is abnormally restarted without power failure.
Firstly, an implementation manner of how to divide and obtain a non-initialized memory space is provided:
the DATATYPE value __ attribute __ command is used to create a memory space that does not perform initialization operations, i.e., a non-initialization memory space.
The command will define a DATATYPE variable ValueName and set the attributes of this variable to ((section ("NO initram"), zero INIT)) via __ attribute __, which indicates that a memory region named "NO initram" will exist in memory under this variable (i.e., non-initialized memory space), zero INIT represents that the attributes of this memory region are non-initialized (i.e., NO initialization operation is performed), under which data stored in non-initialized memory space will not be initialized if the target device is not powered down. The size and starting address of the non-initialized memory space may also be set by the following commands:
Figure BDA0001847301970000111
the command indicates that the start address of the memory area named "NO _ INIT _ RAM" is 0x10000000 and 2 × 1024 bytes in size.
On the basis of obtaining the non-initialized memory space through division, it is necessary to determine whether the current starting mode of the target device is the abnormal restart without power loss, in this embodiment, a custom field is set at a certain position of the non-initialized memory space to store a restart identifier, and the restart identifier can be used to determine whether the current restarting mode is the abnormal restart without power loss:
a restart identification field with a preset length is customized at the beginning address of the non-initialized memory space, and the restart identification is stored in the restart identification field by a string variable (string), so that the restart identification stored in the restart identification field can be read from the beginning address when the target device is restarted every time. Assuming that the normal restart of the power failure, the abnormal restart of the power failure and the abnormal restart of the power failure do not correspond to different character string variables respectively, and the character string variable corresponding to the abnormal restart of the power failure is poweron, judging whether the current restart mode is the abnormal restart of the power failure actually changes into judging whether the actual character string variable taken out from the restart identification field is poweron, if so, representing that the current restart mode of the target equipment is the abnormal restart of the power failure, and simultaneously, meaning that the latest data is still stored in the non-initialized memory space and can be directly used.
Referring to fig. 5, fig. 5 is a block diagram of a data storage system according to an embodiment of the present application, where the data storage system may include:
a memory space dividing unit 100, configured to divide a memory space of a target device into an initialized memory space and a non-initialized memory space; the initialization memory space is used for storing the latest data acquired by the target equipment;
a data synchronization unit 200, configured to synchronize the latest data into a non-initialized memory space;
the reboot initialization execution unit 300 is configured to, when the target device is rebooted, extract target data from the hard disk space of the target device, and update only data in the initialization memory space to the target data.
Based on the foregoing embodiments, the present application further provides a smart wearable device, which may include a memory and a processor, where the memory stores a computer program, and the processor may implement the steps provided by the foregoing embodiments when calling the computer program in the memory. Of course, the smart wearable device may also include various necessary network interfaces, power supplies, other components, and the like.
The present application also provides a computer-readable storage medium, on which a computer program is stored, which, when executed by an execution terminal or processor, can implement the steps provided by the above-mentioned embodiments. The storage medium may include: a U disk, a removable hard disk, a volatile memory (including a normal memory bank which is volatile when power is turned off), a non-volatile random access memory (including a memory bank which is nonvolatile when power is turned off, a mechanical hard disk, a solid state hard disk, a flash memory), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The principle and the implementation of the present application are described herein by applying specific examples, and in order to make the various embodiments have a progressive relationship, each embodiment focuses on the differences from the other embodiments, and the same and similar parts among the various embodiments may be referred to each other. For the apparatus disclosed in the embodiments, reference is made to the corresponding method section. The above description of the embodiments is only intended to help understand the method of the present application and its core ideas. It will be apparent to those skilled in the art that various changes and modifications can be made in the present invention without departing from the principles of the invention, and these changes and modifications also fall within the scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A data storage method, characterized in that the data storage method comprises:
dividing the memory space of the target device into an initialized memory space and a non-initialized memory space; the initialization memory space is used for storing the latest data acquired by the target equipment;
synchronizing the latest data to the non-initialized memory space;
when the target device is restarted, extracting target data from the hard disk space of the target device, and updating the data in the initialized memory space into the target data.
2. The data storage method of claim 1, wherein dividing the memory space of the target device into an initialized memory space and a non-initialized memory space comprises:
dividing a memory space block with a preset size from the memory space;
configuring the attribute of the memory space block into non-initialization to obtain a non-initialization memory space;
naming the memory space except the non-initialized memory space in the memory space as the initialized memory space; wherein the attribute of the initialized memory space is initialization.
3. The data storage method according to claim 2, wherein when the target device is restarted, extracting target data from a hard disk space of the target device, and updating only data in the initialization memory space to the target data comprises:
when the target equipment is restarted, judging whether the current starting mode of the target equipment is abnormal restarting without power failure;
and if the current starting mode of the target equipment is abnormal restarting without power failure, extracting target data from a hard disk space of the target equipment, and updating the data in the initialized memory space into the target data.
4. The data storage method of claim 3, wherein determining whether the current boot mode of the target device is an abnormal restart without power loss comprises:
reading from the non-initialized memory space to obtain a restart identifier; the restarting mark comprises a normal power failure restarting mark, an abnormal power failure restarting mark and an abnormal non-power-off restarting mark;
and judging whether the current starting mode of the target equipment is the abnormal restarting without power failure according to whether the restarting mark is the abnormal power failure-free restarting mark.
5. The data storage method of claim 4, wherein before reading the reboot flag from the non-initialized memory space, further comprising:
setting a restart identification field in the non-initialized memory space;
writing the type of each restart of the target equipment into the restart identification field in the form of corresponding identification;
correspondingly, reading a restart identifier from the non-initialized memory space, including:
and reading the restart identification from the restart identification field.
6. The data storage method of claim 5, wherein setting a reboot flag field in the non-initialized memory space comprises:
acquiring a first address of the non-initialized memory space;
setting the initial address as a starting address of the restart identification field, and calculating to obtain an ending address according to a preset field size and the starting address to obtain the restart identification field with an address range from the starting address to the ending address;
correspondingly, reading the restart identifier from the restart identifier field, including:
and determining the restart identification field according to the address range, and reading the restart identification from the restart identification field.
7. The data storage method of any one of claims 1 to 6, further comprising, before extracting the target data from the hard disk space of the target device:
and updating the target data in the hard disk space by using the data in the non-initialized memory space.
8. A data storage system, the data storage system comprising:
the memory space dividing unit is used for dividing the memory space of the target equipment into an initialized memory space and a non-initialized memory space; the initialization memory space is used for storing the latest data acquired by the target equipment;
a data synchronization unit, configured to synchronize the latest data to the non-initialized memory space;
and the restart initialization execution unit is used for extracting target data from the hard disk space of the target device and updating the data in the initialization memory space into the target data only when the target device is restarted.
9. A smart wearable device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the data storage method of any one of claims 1 to 7 when executing said computer program.
10. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the data storage method according to any one of claims 1 to 7.
CN201811277378.0A 2018-10-30 2018-10-30 Data storage method and system, intelligent wearable device and storage medium Active CN109445991B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811277378.0A CN109445991B (en) 2018-10-30 2018-10-30 Data storage method and system, intelligent wearable device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811277378.0A CN109445991B (en) 2018-10-30 2018-10-30 Data storage method and system, intelligent wearable device and storage medium

Publications (2)

Publication Number Publication Date
CN109445991A CN109445991A (en) 2019-03-08
CN109445991B true CN109445991B (en) 2020-06-30

Family

ID=65549325

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811277378.0A Active CN109445991B (en) 2018-10-30 2018-10-30 Data storage method and system, intelligent wearable device and storage medium

Country Status (1)

Country Link
CN (1) CN109445991B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581018B (en) * 2020-04-20 2023-08-01 深圳震有科技股份有限公司 Data recovery method, intelligent terminal and storage medium
CN111596863B (en) * 2020-05-20 2023-04-07 歌尔科技有限公司 Data reading method, device and equipment and readable storage medium
CN113641307A (en) * 2021-08-12 2021-11-12 浙江华云信息科技有限公司 Remote electric energy data terminal capable of storing message in power failure mode and message storage method thereof

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508717A (en) * 2011-11-17 2012-06-20 大唐移动通信设备有限公司 Memory scheduling method and memory scheduling device for multi-core processor
CN103309767A (en) * 2012-03-08 2013-09-18 阿里巴巴集团控股有限公司 Method and device for processing client log
CN103729300A (en) * 2013-12-25 2014-04-16 华为技术有限公司 Method and related device for managing non-volatile memories
CN103888510A (en) * 2014-01-14 2014-06-25 无锡城市云计算中心有限公司 Service high availability method of cloud computing data center
CN108334413A (en) * 2017-12-22 2018-07-27 天津麒麟信息技术有限公司 Information transmitting methods between a kind of firmware and operating system based on platform of soaring
CN108595123A (en) * 2018-04-26 2018-09-28 青岛海信移动通信技术股份有限公司 The date storage method and device of mobile terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102508717A (en) * 2011-11-17 2012-06-20 大唐移动通信设备有限公司 Memory scheduling method and memory scheduling device for multi-core processor
CN103309767A (en) * 2012-03-08 2013-09-18 阿里巴巴集团控股有限公司 Method and device for processing client log
CN103729300A (en) * 2013-12-25 2014-04-16 华为技术有限公司 Method and related device for managing non-volatile memories
CN103888510A (en) * 2014-01-14 2014-06-25 无锡城市云计算中心有限公司 Service high availability method of cloud computing data center
CN108334413A (en) * 2017-12-22 2018-07-27 天津麒麟信息技术有限公司 Information transmitting methods between a kind of firmware and operating system based on platform of soaring
CN108595123A (en) * 2018-04-26 2018-09-28 青岛海信移动通信技术股份有限公司 The date storage method and device of mobile terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄晨 等.基于国产CPU的并行冗余计算机系统研究.《计算机测量与控制》.2017,第25卷(第7期),全文. *

Also Published As

Publication number Publication date
CN109445991A (en) 2019-03-08

Similar Documents

Publication Publication Date Title
US6845434B2 (en) Method for updating parametric data for use in data management system
US10114655B2 (en) Rapid start up method for electronic equipment
CN109445991B (en) Data storage method and system, intelligent wearable device and storage medium
CN102033790B (en) Method and device for upgrading embedded-type system BOOTROM
CN108170495B (en) BIOS upgrading method, system, equipment and computer readable storage medium
US8726262B2 (en) Firmware update system and information apparatus, and program
US9274788B2 (en) Information processing apparatus, method for controlling the same, and storage medium
EP2998861B1 (en) Implementing and deleting method and device for intelligent terminal multi-operation system
WO2013103023A1 (en) Information processing device, information processing method, and computer program
CN109086078B (en) Android system upgrading method and device, server and mobile terminal
WO2019062770A1 (en) System version upgrading method and apparatus
CN102024502A (en) Flash device testing method and device as well as board and network equipment
CN102141921A (en) Method for upgrading system of terminal equipment and terminal equipment
US11640288B2 (en) System version upgrading method and apparatus
CN104866388B (en) Data processing method and device
CN111885420B (en) Standby protection method and device, smart television and readable storage medium
CN111324366A (en) BMC (baseboard management controller) starting firmware rollback method and device, BMC and storage medium
CN110597532A (en) Data acquisition module, firmware upgrading method thereof and storage medium
CN110688141B (en) Firmware updating method
CN108170456B (en) Firmware upgrading method and device for electronic equipment
CN111651304B (en) Software recovery method and device based on double-core intelligent ammeter and computer equipment
CN113220319A (en) Data updating method and device and vehicle
CN111124294B (en) Sector mapping information management method and device, storage medium and equipment
CN110609692A (en) Data acquisition module, firmware upgrading method thereof and storage medium
CN109558274B (en) Information processing method, device and computer readable storage medium

Legal Events

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