CN111026676B - Storage method and storage system for carrying time information by using storage unit address - Google Patents
Storage method and storage system for carrying time information by using storage unit address Download PDFInfo
- Publication number
- CN111026676B CN111026676B CN201911381074.3A CN201911381074A CN111026676B CN 111026676 B CN111026676 B CN 111026676B CN 201911381074 A CN201911381074 A CN 201911381074A CN 111026676 B CN111026676 B CN 111026676B
- Authority
- CN
- China
- Prior art keywords
- time information
- address
- time
- memory
- information
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 22
- 238000006243 chemical reaction Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 claims description 5
- 238000010586 diagram Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
- G06F12/0238—Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/04—Generating or distributing clock signals or signals derived directly therefrom
- G06F1/14—Time supervision arrangements, e.g. real time clock
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1032—Reliability improvement, data loss prevention, degraded operation etc
- G06F2212/1036—Life time enhancement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2212/00—Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
- G06F2212/10—Providing a specific technical effect
- G06F2212/1041—Resource optimization
- G06F2212/1044—Space efficiency improvement
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Electric Clocks (AREA)
Abstract
The invention discloses a method for carrying time information by using a memory cell addressThe storage method and the storage system comprise the following steps: s1: determining the number of bytes of the single time record according to the power-off duration information requirement and the capacity of the nonvolatile memory; decomposing the single time record byte into memory unit address carrying time information T a Write time information T for a plurality of memory cells c And single memory cell write time information T d The method comprises the steps of carrying out a first treatment on the surface of the S2: storing time information T in a memory cell with a fixed starting address d Taking the next adjacent address of the memory unit with the fixed initial address as the memory unit to carry time information T a And only carries time information T a Sequentially and alternately storing corresponding time information T in the storage units of the memory c The method comprises the steps of carrying out a first treatment on the surface of the S3: periodically storing time information T according to step S2 c And time information T d 。
Description
Technical Field
The invention relates to a storage method and a storage system for carrying time information by using a storage unit address.
Background
Currently, a wide variety of electronic devices, such as electronic balances, electronic scales, digital sensors, etc., and automatic control devices, are widely used in various industries. In the use of these electronic devices, it is necessary to know the duration of the device power down when the power is turned on, for initial state diagnostics and error compensation when the device is powered up. Particularly in the case of more frequent power-down and power-up, it is more important to record the duration of the power-down of the electronic device.
The conventional method for recording the power-off duration uses an RTC (real time clock circuit) to record the power-off period, and needs to continuously write time point data into a nonvolatile memory, which has a great influence on the space size and the read-write life of the nonvolatile memory, and once the nonvolatile memory is damaged, the RTC loses the timing function.
Disclosure of Invention
The invention aims to provide a storage method and a storage system for carrying time information by using a storage unit address, so as to solve the problem that the traditional method for recording the power-off duration time has great influence on the space size and the read-write life of a nonvolatile memory.
In order to solve the technical problems, the present invention provides a storage method for carrying time information by using a storage unit address, comprising the following steps:
s1: determining the number of bytes of the single time record according to the power-off duration information requirement and the capacity of the nonvolatile memory; decomposing the single time record byte into memory unit address carrying time information T a Write time information T for a plurality of memory cells c And single memory cell write time information T d ;
S2: storing time information T in a memory cell with a fixed starting address d Taking the next adjacent address of the memory unit with the fixed initial address as the memory unit to carry time information T a And only carries time information T a Sequentially and alternately storing corresponding time information T in the storage units of the memory c ;
S3: periodically storing time information T according to step S2 c And time information T d 。
Further, when the memory cell address carries second information, the T a For time information seconds, T c For time information, T d The time information is year, month, day and time;
at this time, the step S2 specifically includes:
s21: storing time information of year, month, day and time in storage units of fixed initial address respectively, and requiring 4 storage units in total;
s22: taking the next adjacent address of the storage unit with the fixed initial address as an initial address addr_base of time information seconds;
s23: corresponding time information is sequentially and alternately stored in 60 memory cells addr_base+second which only carry time information seconds, and the writing frequency of each memory cell is 1 time per minute.
Further, when the memory cell address carries minute and second information, the T a For time information minutes and seconds, T c In the case of time information, T d Years, months and days are time information;
at this time, the step S2 specifically includes:
s21: storing time information of year, month and day in a storage unit with a fixed initial address respectively, wherein the total number of the storage units is 3;
s22: taking the next adjacent address of the storage unit with the fixed initial address as an initial address addr_base of time information minutes and seconds;
s23: when corresponding time information is sequentially and alternately stored in 3600 memory cells addr_base+second carrying only time information seconds, the writing frequency of each memory cell is 1 time per hour.
Further, after the next power-on restart, the current RTC time value is read as the power-off ending time information T off2 Nonvolatile memoryReading time information T d Time information T c And storing address translation time information T b As power-off start time information T off1 The power-off time length T can be obtained off The method comprises the following steps:
T off =T off2 -T off1
wherein T is b Taking the last time value which is written into the content of the storage unit for multiple times as the conversion time of the storage address, and the only last time value T c Corresponding memory address is converted into time information T b The method comprises the steps of carrying out a first treatment on the surface of the Or take the same stored value T c Conversion of the corresponding maximum memory address into time information T b 。
In addition, the invention also provides a storage system for carrying time information by using the address of the storage unit, which comprises a microprocessor, a nonvolatile memory and a real-time clock circuit, wherein the nonvolatile memory and the real-time clock circuit are respectively connected with the microprocessor, and a computer program is stored in the microprocessor, and the computer program can realize the steps of the method in any one of claims 1-4 when being executed by the microprocessor.
The beneficial effects of the invention are as follows: the invention adopts a plurality of address spaces to record and reduce the read-write times of each address in turn, and prolongs the read-write life of the nonvolatile memory; the number of storage bytes is reduced by carrying time information by using the storage address, more time recording times are stored in a certain address space, the interval between recording time points is shortened, and the accuracy of power-off time recording is improved.
Drawings
The accompanying drawings, where like reference numerals refer to identical or similar parts throughout the several views and which are included to provide a further understanding of the present application, are included to illustrate and explain illustrative examples of the present application and do not constitute a limitation on the present application. In the drawings:
FIG. 1 is a schematic diagram of a memory used when an address carries second information;
FIG. 2 is a schematic diagram of a memory used when an address carries minute and second information;
FIG. 3 is a schematic diagram of a memory system according to one embodiment of the invention.
Detailed Description
A storage method for carrying time information by using a storage unit address comprises the following steps:
s1: determining the number of bytes of the single time record according to the power-off duration information requirement and the capacity of the nonvolatile memory; decomposing the single time record byte into memory unit address carrying time information T a Write time information T for a plurality of memory cells c And single memory cell write time information T d ;
S2: storing time information T in a memory cell with a fixed starting address d Taking the next adjacent address of the memory unit with the fixed initial address as the memory unit to carry time information T a And only carries time information T a Sequentially and alternately storing corresponding time information T in the storage units of the memory c ;
S3: the time information Tc and the time information Td are periodically stored according to step S2.
According to the invention, the year, month, day, time, minute and second corresponding to each piece of time point information are changed from a fixed storage position to a plurality of positions to be stored in turn one by one, so that the read-write service life of the nonvolatile memory is prolonged; the storage address is used for carrying time minutes and seconds in time information, the address content stores the remaining information such as year, month, day and the like, the byte number of each piece of information is greatly reduced, and the space of the nonvolatile memory is compressed.
According to one embodiment of the present application, as shown in FIG. 1, when the memory cell address carries second information, the T a For time information seconds, T c For time information, T d The time information is year, month, day and time;
at this time, the step S2 specifically includes:
s21: storing time information of year, month, day and time in storage units of fixed initial address respectively, and requiring 4 storage units in total;
s22: taking the next adjacent address of the storage unit with the fixed initial address as an initial address addr_base of time information seconds;
s23: corresponding time information is sequentially and alternately stored in 60 memory cells addr_base+second which only carry time information seconds, and the writing frequency of each memory cell is 1 time per minute.
According to one embodiment of the present application, as shown in FIG. 2, when the memory cell address carries minute and second information, the T a For time information minutes and seconds, T c In the case of time information, T d Years, months and days are time information;
at this time, the step S2 specifically includes:
s21: storing time information of year, month and day in a storage unit with a fixed initial address respectively, wherein the total number of the storage units is 3;
s22: taking the next adjacent address of the storage unit with the fixed initial address as an initial address addr_base of time information minutes and seconds;
s23: when corresponding time information is sequentially and alternately stored in 3600 memory cells addr_base+second carrying only time information seconds, the writing frequency of each memory cell is 1 time per hour.
In practice, the address information may be carried for 5 seconds, 10 seconds, 20 seconds, or the like in combination with the nonvolatile memory capacity according to the power-off duration information requirement.
According to one embodiment of the present application, after the next power-on restart, the current RTC time value is read as the power-off end time information T off2 Nonvolatile memory read time information T d Time information T c And storing address translation time information T b As power-off start time information T off1 The power-off time length T can be obtained off The method comprises the following steps:
T off =T off2 -T off1
wherein T is b Taking the last time value which is written into the content of the storage unit for multiple times as the conversion time of the storage address, and the only last time value T c Corresponding memory address is converted into time information T b The method comprises the steps of carrying out a first treatment on the surface of the Or take the same stored value T c Corresponding toMaximum memory address translation into time information T b 。
In addition, as shown in fig. 3, the invention further provides a storage system for carrying time information by using a storage unit address, which comprises a microprocessor, a nonvolatile memory and a real-time clock (RTC) circuit, wherein the nonvolatile memory and the RTC circuit are respectively connected with the microprocessor, and a computer program is stored in the microprocessor, and the computer program can realize the steps of the method in any one of claims 1-4 when being executed by the microprocessor.
Finally, it is noted that the above embodiments are only for illustrating the technical solution of the present invention and not for limiting the same, and although the present invention has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications and equivalents may be made thereto without departing from the spirit and scope of the technical solution of the present invention, which is intended to be covered by the scope of the claims of the present invention.
Claims (3)
1. A storage method and a storage system for carrying time information by using a storage unit address are characterized by comprising the following steps:
s1: determining the number of bytes of the single time record according to the power-off duration information requirement and the capacity of the nonvolatile memory; decomposing the single time record byte into memory unit address carrying time information T a Write time information T for a plurality of memory cells c And single memory cell write time information T d ;
S2: storing time information T in a memory cell with a fixed starting address d Taking the next adjacent address of the memory unit with the fixed initial address as the memory unit to carry time information T a And only carries time information T a Sequentially and alternately storing corresponding time information T in the storage units of the memory c ;
S3: periodically storing time information T according to step S2 c And time information T d ;
Memory cell address when the memory cell address carries second information, the T a For time of arrivalInformation seconds, T c For time information, T d The time information is year, month, day and time;
at this time, the step S2 specifically includes:
s21: storing time information of year, month, day and time in storage units of fixed initial address respectively, and requiring 4 storage units in total;
s22: taking the next adjacent address of the storage unit with the fixed initial address as an initial address addr_base of time information seconds;
s23: sequentially and alternately storing corresponding time information in 60 storage units addr_base+second which only carry time information seconds, wherein the writing frequency of each storage unit is 1 time per minute;
memory cell address when the memory cell address carries minute and second information, the T a For time information minutes and seconds, T c In the case of time information, T d Years, months and days are time information;
at this time, the step S2 specifically includes:
s21: storing time information of year, month and day in a storage unit with a fixed initial address respectively, wherein the total number of the storage units is 3;
s22: taking the next adjacent address of the storage unit with the fixed initial address as an initial address addr_base of time information minutes and seconds;
s23: when corresponding time information is sequentially and alternately stored in 3600 memory cells addr_base+second carrying only time information seconds, the writing frequency of each memory cell is 1 time per hour.
2. The method for storing time information carried by a memory cell address according to claim 1, wherein after a next power-on restart, a current RTC time value is read as power-off end time information T off2 Nonvolatile memory read time information T d Time information T c And storing address translation time information T b As power-off start time information T off1 The power-off time length T can be obtained off The method comprises the following steps:
T off =T off2 -T off1
wherein T is b Taking the last time value which is written into the content of the storage unit for multiple times as the conversion time of the storage address, and the only last time value T c Corresponding memory address is converted into time information T b The method comprises the steps of carrying out a first treatment on the surface of the Or take the same stored value T c Conversion of the corresponding maximum memory address into time information T b 。
3. The memory system of claim 1, comprising a microprocessor, a non-volatile memory and a real time clock circuit respectively coupled to the microprocessor, wherein a computer program is stored in the microprocessor, which when executed by the microprocessor, is capable of implementing the method steps of claim 1 or 2.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911381074.3A CN111026676B (en) | 2019-12-27 | 2019-12-27 | Storage method and storage system for carrying time information by using storage unit address |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911381074.3A CN111026676B (en) | 2019-12-27 | 2019-12-27 | Storage method and storage system for carrying time information by using storage unit address |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111026676A CN111026676A (en) | 2020-04-17 |
CN111026676B true CN111026676B (en) | 2023-08-01 |
Family
ID=70194754
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911381074.3A Active CN111026676B (en) | 2019-12-27 | 2019-12-27 | Storage method and storage system for carrying time information by using storage unit address |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111026676B (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101901189A (en) * | 2009-05-26 | 2010-12-01 | 联发科技股份有限公司 | Method for updating user data and method for restoring user data |
CN104035883A (en) * | 2014-06-23 | 2014-09-10 | 北京君正集成电路股份有限公司 | Method and device for writing and detecting data |
Family Cites Families (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4307455A (en) * | 1978-02-27 | 1981-12-22 | Rockwell International Corporation | Power supply for computing means with data protected shut-down |
GB2015208B (en) * | 1978-02-27 | 1982-09-02 | Rockwell International Corp | Data monitoring and recording system incorporating a real time clock using computer means |
JP4146628B2 (en) * | 2001-08-23 | 2008-09-10 | 松下電器産業株式会社 | Memory system and semiconductor integrated circuit |
JP2013218371A (en) * | 2012-04-04 | 2013-10-24 | Seiko Epson Corp | Information processor and data storage processing method in the same |
CN103514103B (en) * | 2012-06-21 | 2016-09-28 | 群联电子股份有限公司 | Data protection method, memory controller and memory storage device |
CN103886902B (en) * | 2012-12-19 | 2017-08-04 | 比亚迪股份有限公司 | A kind of EEPROM storage and its date storage method |
US9471129B2 (en) * | 2014-08-07 | 2016-10-18 | Empire Technology Development Llc | Determining a write operation |
TWI522794B (en) * | 2015-06-10 | 2016-02-21 | 國立成功大學 | Energy-efficient nonvolatile microprocessor |
CN106484308B (en) * | 2015-08-26 | 2019-08-06 | 群联电子股份有限公司 | Data protection method, memory control circuit unit and memory storage device |
JP6790686B2 (en) * | 2016-09-30 | 2020-11-25 | オムロン株式会社 | Controls, control methods and programs |
-
2019
- 2019-12-27 CN CN201911381074.3A patent/CN111026676B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101901189A (en) * | 2009-05-26 | 2010-12-01 | 联发科技股份有限公司 | Method for updating user data and method for restoring user data |
CN104035883A (en) * | 2014-06-23 | 2014-09-10 | 北京君正集成电路股份有限公司 | Method and device for writing and detecting data |
Also Published As
Publication number | Publication date |
---|---|
CN111026676A (en) | 2020-04-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106407050B (en) | Data storage method | |
US7173782B2 (en) | Magnetic disk drive and refresh method | |
JPWO2008013229A1 (en) | Nonvolatile storage device, nonvolatile storage system, and host device | |
JP2005267702A5 (en) | ||
WO2001050268A1 (en) | Apparatus and method for reducing power consumption in an electronic data storage system | |
US20170068304A1 (en) | Low-power memory-access method and associated apparatus | |
CN104750227A (en) | Dormancy awakening method and electronic device | |
CN111026676B (en) | Storage method and storage system for carrying time information by using storage unit address | |
JP7053585B2 (en) | Devices and methods for controlling non-volatile memory refresh cycles | |
CN112511156B (en) | Pulse metering and storing method | |
TW200518103A (en) | Method and system for enhancing the endurance of memory cells | |
CN202473263U (en) | FLASH memorizer circuit supporting high erasing times | |
CN116737647A (en) | SoC chip and quick start method thereof | |
CN211297067U (en) | LED box, display screen and timing circuit | |
CN109299018B (en) | Method and device for reading historical data in Flash memory | |
JP4366968B2 (en) | Temperature detection circuit and storage device | |
JPS58104994U (en) | Electrochromic display electronic clock | |
CN115061627B (en) | A method for counting and recording working information of digital T/R components | |
CN116189742A (en) | System and method for acquiring data storage duration of data block in off-line state of flash memory system | |
JP3378681B2 (en) | Memory data read / write circuit | |
JPH02108296A (en) | Storage accumulation module | |
JP5052221B2 (en) | Semiconductor integrated circuit | |
JPH0744468A (en) | Storage device | |
CN118113628A (en) | Data storage and management method applied to ocean measuring instrument | |
JP2009019996A (en) | Event recorder and time data recording method of event recorder |
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 |