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 PDF

Info

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
Application number
CN201911381074.3A
Other languages
Chinese (zh)
Other versions
CN111026676A (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.)
CCTEG Chongqing Research Institute Co Ltd
Original Assignee
CCTEG Chongqing Research Institute 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 CCTEG Chongqing Research Institute Co Ltd filed Critical CCTEG Chongqing Research Institute Co Ltd
Priority to CN201911381074.3A priority Critical patent/CN111026676B/en
Publication of CN111026676A publication Critical patent/CN111026676A/en
Application granted granted Critical
Publication of CN111026676B publication Critical patent/CN111026676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/04Generating or distributing clock signals or signals derived directly therefrom
    • G06F1/14Time supervision arrangements, e.g. real time clock
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • G06F2212/1036Life time enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1041Resource optimization
    • G06F2212/1044Space efficiency improvement
    • YGENERAL 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
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE 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/00Energy efficient computing, e.g. low power processors, power management or thermal management

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

Storage method and storage system for carrying time information by using storage unit address
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.
CN201911381074.3A 2019-12-27 2019-12-27 Storage method and storage system for carrying time information by using storage unit address Active CN111026676B (en)

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)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901189A (en) * 2009-05-26 2010-12-01 联发科技股份有限公司 Data updating and recovering methods for a non-volatile memory array
CN104035883A (en) * 2014-06-23 2014-09-10 北京君正集成电路股份有限公司 Method and device for writing and detecting data

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB2015208B (en) * 1978-02-27 1982-09-02 Rockwell International Corp Data monitoring and recording system incorporating a real time clock using computer means
US4307455A (en) * 1978-02-27 1981-12-22 Rockwell International Corporation Power supply for computing means with data protected shut-down
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 guard method, Memory Controller and memorizer memory devices
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 guard method, memorizer control circuit unit and memorizer memory devices
JP6790686B2 (en) * 2016-09-30 2020-11-25 オムロン株式会社 Controls, control methods and programs

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101901189A (en) * 2009-05-26 2010-12-01 联发科技股份有限公司 Data updating and recovering methods for a non-volatile memory array
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
JP5243250B2 (en) Nonvolatile storage device, nonvolatile storage system, and host device
US8923088B2 (en) Solid state storage device with sleep control circuit
US20030014582A1 (en) Data recorder and method for recording data in flash memory
JP2005267702A5 (en)
CN101320596B (en) Bad block management method facing high-capacity FLASH solid memory
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
TW201525867A (en) Electronic apparatus and method for resuming from hibernation
CN100369156C (en) Semiconductor storage and control method thereof
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
JP2020042890A (en) Memory system and controlling method of memory system
CN112511156B (en) Pulse metering and storing method
CN202473263U (en) FLASH memorizer circuit supporting high erasing times
TW200518103A (en) Method and system for enhancing the endurance of memory cells
CN112269725A (en) Recording device and method for storing power-on and power-off time of controller
CN109299018B (en) Method and device for reading historical data in Flash memory
CN211297067U (en) LED box, display screen and timing circuit
CN112130765A (en) EEPROM data reading and writing method and device
JP4366968B2 (en) Temperature detection circuit and storage device
JP2015132937A (en) Information processing apparatus, information processing method and recording medium
CN105824760B (en) Storage device and power control method thereof
RU2011116257A (en) TIMER MANAGER (OPTIONS) AND METHOD FOR IMPLEMENTING THE TIMER MANAGER ARCHITECTURE BASED ON THE BINARY PYRAMID
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

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