CN114329640A - Count value reading method, count method, device, electronic device and storage medium - Google Patents

Count value reading method, count method, device, electronic device and storage medium Download PDF

Info

Publication number
CN114329640A
CN114329640A CN202111671094.1A CN202111671094A CN114329640A CN 114329640 A CN114329640 A CN 114329640A CN 202111671094 A CN202111671094 A CN 202111671094A CN 114329640 A CN114329640 A CN 114329640A
Authority
CN
China
Prior art keywords
counting
data
storage unit
line
reading
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.)
Granted
Application number
CN202111671094.1A
Other languages
Chinese (zh)
Other versions
CN114329640B (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.)
Xtx Technology Inc
Shanghai Xincuntianxia Electronic Technology Co ltd
Original Assignee
Xtx Technology Inc
Shanghai Xincuntianxia Electronic Technology 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 Xtx Technology Inc, Shanghai Xincuntianxia Electronic Technology Co ltd filed Critical Xtx Technology Inc
Priority to CN202111671094.1A priority Critical patent/CN114329640B/en
Publication of CN114329640A publication Critical patent/CN114329640A/en
Application granted granted Critical
Publication of CN114329640B publication Critical patent/CN114329640B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to the technical field of semiconductor integrated circuits, and particularly discloses a count value reading method, a count device, electronic equipment and a storage medium, wherein the reading method comprises the following steps: reading a radix value stored by the radix bit in the working storage block; searching along the arrangement direction of the word lines to obtain a digit counting line, wherein the digit counting line is the word line of which the last first storage unit is written with data; searching and acquiring a counting storage unit in the counting line along the arrangement direction of the bit lines, wherein the counting storage unit is the last storage unit with data written in the counting line; acquiring a current count value in the data bits according to the count storage unit; acquiring the total count value according to the current count value and the base number value; the reading method effectively reduces the average time of the reading process of the counting value by searching and acquiring the counting number line to preliminarily screen out the approximate position of the counting storage unit.

Description

Count value reading method, count method, device, electronic device and storage medium
Technical Field
The present disclosure relates to the field of semiconductor integrated circuit technologies, and in particular, to a count value reading method, a count device, an electronic device, and a storage medium.
Background
In the prior art, the monotonic counter often uses two memory blocks to store and count data in turn.
The storage block for storing the count is a working storage block, the working storage block of the monotonic counter mainly relates to reading and counting operations in the normal use process, the reading and counting operations need to be gradually traversed and read from the initial address of the data bit to search the storage unit of the data bit for finally recording the data, the searching mode is heavy, when the storage unit of the finally recorded data is positioned in the storage unit behind the data bit, more time needs to be consumed to finish the reading and counting operations, and the average time consumption consumed by the storage unit for obtaining the finally recorded data in the normal reading and counting operation processes of the monotonic counter is longer.
In view of the above problems, no effective technical solution exists at present.
Disclosure of Invention
The present application provides a count value reading method, a count device, an electronic device, and a storage medium, so as to reduce the average time consumed for obtaining a storage unit of last recorded data.
In a first aspect, the present application provides a count value reading method, configured to read a total count value of a working memory block in a monotonic counter, where the working memory block is provided with a base bit and a data bit, and the reading method includes the following steps:
reading a radix value stored by the radix bit in the working storage block;
searching along the arrangement direction of the word lines to obtain a digit counting line, wherein the digit counting line is the word line of which the last first storage unit is written with data;
searching and acquiring a counting storage unit in the counting line along the arrangement direction of the bit lines, wherein the counting storage unit is the last storage unit with data written in the counting line;
acquiring a current count value in the data bits according to the count storage unit;
and acquiring the total count value according to the current count value and the base number value.
According to the counting value reading method, the word line where the counting storage unit is located is determined primarily in a mode of searching the counting digit line, and then the counting storage unit is searched in the storage unit of the counting digit line, so that the average time of the counting value reading process is effectively reduced.
The method for reading the count value, wherein the step of searching and acquiring the count line along the word line arrangement direction comprises:
sequentially reading the data of the first memory cell on each word line in the data bits along the arrangement sequence direction of the word lines;
stopping the reading operation when the first storage unit which is not written with data is read or when the last storage unit is read with data;
and regarding the word line where the last first storage unit of the first storage unit in which data is not written is located as the counting digit line, or regarding the word line where the last first storage unit in which data is written is located as the counting digit line.
In the counting value reading method of the example, the counting digit line searching mode determines the counting digit line based on the change characteristic that the first storage unit in different word lines has data written to data not written, has the characteristic of simple operation process, and can quickly locate the counting digit line where the counting storage unit is located.
The method for reading a count value, wherein the step of searching for a count memory cell in the count line along the bit line arrangement direction comprises:
sequentially reading the data of each memory cell in the digit line along the arrangement sequence direction of the bit lines;
stopping the reading operation when the memory unit which is not written with data is read or when the last memory unit is read with data;
and regarding the last storage unit of the storage units in which the data is not written as the counting storage unit, or regarding the last storage unit in which the data is written as the counting storage unit.
In the count value reading method of this example, the count memory cell searching manner determines the count memory cell based on a characteristic of a change in the memory cell in the count line from data written to data unwritten.
The method for reading the count value, wherein the step of searching and acquiring the count line along the word line arrangement direction comprises:
sequentially reading the data of the first memory cell on each word line in the data bits along the reverse sequence direction of the word line arrangement;
and when the first memory cell written with data is read, stopping the reading operation, and regarding the word line where the first memory cell written with data is positioned as the counting word line.
The method for reading a count value, wherein the step of searching for a count memory cell in the count line along the bit line arrangement direction comprises:
sequentially reading the data of each memory cell in the digit line along the reverse direction of the bit line arrangement;
when the memory cell written with data is read, the reading operation is stopped, and the memory cell written with data is regarded as the counting memory cell.
The method for reading the count value, wherein the step of obtaining the current count value in the data bits according to the count storage unit comprises:
and acquiring the current count value in the data bit according to the address of the counting storage unit.
In a second aspect, the present application further provides a counting method for increasing the count of a working memory block in a monotonic counter, the counting method comprising the steps of:
searching along the arrangement direction of the word lines to obtain a digit counting line, wherein the digit counting line is the word line of which the last first storage unit is written with data;
searching and acquiring a counting storage unit in the counting line along the arrangement direction of the bit lines, wherein the counting storage unit is the last storage unit with data written in the counting line;
and writing the next storage unit of the counting storage unit.
According to the counting method, data bits do not need to be read step by step from the initial addresses of the data bits to obtain the counting storage units, and the average time of the whole counting operation of the monotonic counter is effectively reduced by obtaining the counting digit lines to preliminarily screen out the approximate positions of the counting storage units.
In a third aspect, the present application further provides a count value reading apparatus, configured to read a total count value of a working memory block in a monotonic counter, where the working memory block is provided with a base bit and a data bit, and the reading apparatus includes:
the first reading module is used for reading the base value stored by the base digit in the working storage block;
the word line searching module is used for searching and obtaining a counting line along the word line arrangement direction, wherein the counting line is the word line of which the last first storage unit is written with data;
the bit line searching module is used for searching and acquiring a counting storage unit in the counting lines along the bit line arrangement direction, wherein the counting storage unit is the last storage unit written with data in the counting lines;
the second reading module is used for acquiring the current count value in the data bit according to the count storage unit;
and the calculation module is used for acquiring the total count value according to the current count value and the base number value.
According to the counting value reading device, the word line where the counting storage unit is located is preliminarily determined in a mode of searching the counting storage unit through the word line searching module, then the counting storage unit is searched in the storage unit of the counting storage unit through the bit line searching module, the data bit data are read and gradually traversed from the initial address of the data bit to obtain the counting storage unit, and the average time of the counting value reading process is effectively reduced through a method of preliminarily screening out the approximate position of the counting storage unit through obtaining the counting storage unit.
In a fourth aspect, the present application further provides an electronic device comprising a processor and a memory, wherein the memory stores computer readable instructions, and the computer readable instructions, when executed by the processor, perform the steps of the method as provided in the first aspect.
In a fifth aspect, the present application also provides a storage medium having a computer program stored thereon, which when executed by a processor performs the steps of the method as provided in the first aspect above.
In view of the above, the present application provides a method for reading a count value, a method for counting, a device, an electronic device, and a storage medium, wherein the reading method divides a process of searching a last storage unit written with data into two parts compared with an original reading process of traversing data bits to obtain a current count value, a word line where the counting storage unit is located is preliminarily determined by searching a counting line, then the counting storage unit is searched in the storage unit of the counting line, the data bits are read without traversing from a start address of the data bits step by step to obtain the counting storage unit, and average time of the reading process of the count value is effectively reduced by preliminarily screening out an approximate position of the counting storage unit by obtaining the counting line.
Drawings
Fig. 1 is a flowchart of a count value reading method according to an embodiment of the present disclosure.
Fig. 2 is a flowchart of a counting method according to an embodiment of the present disclosure.
Fig. 3 is a schematic structural diagram of a count value reading apparatus according to an embodiment of the present application.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Reference numerals: 301. a first reading module; 302. a word line search module; 303. a bit line search module; 304. a second reading module; 305. a calculation module; 4. an electronic device; 401. a processor; 402. a memory; 403. a communication bus.
Detailed Description
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 only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
The answer protection monotonic counter (abbreviated as monotonic counter) is used to guarantee confidentiality and integrity of data when the chip is running: when the flash memory is operated, the response protection monotonic counter performs monotonic counting, so that the mutual authentication between the host computer and the flash memory chip with the response protection monotonic counter is ensured, and the information safety is ensured.
The answer protection monotonic counter typically sets two memory blocks to be used alternately for counting, the memory blocks typically containing a base bit, an identification bit, a check bit, and a data bit, wherein the memory block currently being used for counting is considered as a working memory block.
The memory block of the response protection monotonic counter generally comprises a base bit, an identification bit, a check bit and a data bit, wherein the data stored in the base bit is used for recording the counting data counted when the last working memory block is fully written and switched; the data of the identification bit is used for representing whether the corresponding storage block needs to be subjected to erasing and programming operation; the data of the check bit is used for representing the base bit of the corresponding storage block and whether the data in the identification bit is valid or not; therefore, in the process of using the answer protection monotonic counter, the memory block which is currently counting is determined by analyzing the data of the base digit data, the identification digit data and the check digit data, the memory block is regarded as a working memory block, and the reading of the count value or the writing of a new count can be performed by combining the base digit data and the data digit data in the working memory block; the addresses of the data bits are continuously set, and a counting function is realized for gradually writing data according to an address increasing mode, so that the data bits can be understood to be formed by a storage array formed by interleaving a plurality of rows of word lines and bit lines; the data bits of the answer protection monotonic counter are counted with a single byte of storage space (i.e., one byte, a byte) as a storage unit, i.e., 8 binary storage elements as a unit.
For the existing monotonic counter for response protection, no matter the operation process of reading the count value or writing the count value, the address of the memory cell in which data is written last in the working memory block needs to be obtained first, and the obtaining process generally adopts the step-by-step increment from the initial address of the data bit to start searching until the memory cell in which data is written last is searched, the obtaining process needs to step-by-step traverse the data bit data from the initial address of the data bit, the reading process takes a long time, and a large amount of searching time is needed for the case that the count value stored by the data bit is large.
In a first aspect, please refer to fig. 1, where fig. 1 is a count value reading method in some embodiments of the present application, configured to read a total count value of a working memory block in a monotonic counter, where the working memory block has a base bit and a data bit, and the reading method includes the following steps:
s101, reading a base number value stored in a base number position in a working storage block;
specifically, the base value is a total count value counted when the last working memory block is fully written and switched, and the total count value currently counted by the working memory block can be obtained by adding the base value to a current count value recorded by a data bit in the working memory block.
S102, searching and acquiring a digit line along the arrangement direction of the word lines, wherein the digit line is the word line of which the last first storage unit is written with data;
specifically, the monotonic counter stores data through a storage block formed by a storage array to realize counting, data bits of the monotonic counter are counted by taking bytes (byte) as a counting unit, that is, each storage unit in the monotonic counter corresponds to a storage space with 8 bits, that is, a storage space with one byte size, the storage block of the monotonic counter is generally provided with n (n is a positive integer) word lines and 8m (m is a positive integer) bit lines (the number of the word lines and the number of the bit lines determine the storage capacity of the whole storage block, that is, the upper limit of the count when the corresponding working storage block data bits are fully written), so that each corresponding storage space of each word line in each storage block has m storage units, that is, the storage space on each word line can store data with m bytes.
More specifically, as can be seen from the foregoing, the storage block is divided into a base bit, an identification bit, a check bit, and a data bit according to the storage area, wherein the base bit, the identification bit, and the check bit in the storage block are arranged in the first 8 storage cells (corresponding to the storage cells numbered byte0 through byte 7) in the monotonic counter, so that the 9 th storage cell (the storage cell numbered byte 8) in the storage block is the first storage cell in the data bit; the monotonic counter counts by the write data, and generally counts along the number direction of the storage unit, i.e. along the extension direction of the word line, and switches to the next word line to count after the storage space corresponding to one word line is full of data.
More specifically, the conventional monotonic counter generally has 16 word lines, and the base bit, the identification bit, and the check bit are all disposed on the storage space corresponding to the first word line.
More specifically, the search retrieval process includes performing a read operation for different memory cells to retrieve data in the corresponding memory cells.
More specifically, the search obtaining process may be to search the storage space of the storage block, that is, to perform a read operation on the base bit, the identification bit, the check bit, and the data bit in the storage block, or to perform a read operation only on the data bit in the storage block, so that, for the storage space of the first word line, the first 8 storage cells correspondingly include the base bit, the identification bit, and the check bit, so that the first storage cell of the first word line should be understood as the ninth storage cell, that is, the storage cell corresponding to byte8, and the first storage cell of the remaining word lines should be understood as the first storage cell in the corresponding word line.
More specifically, since the count word line is a word line in which data is written to the last first memory cell, the memory cells on the word line before the count word line are all written with data, and the memory cells on the word line after the count word line are all not written with data, while the memory cells in the count word line are at least one memory cell written with data, that is, the memory cell of the monotonic counter which stores the count value last in the last write count operation is necessarily located on the count word line; therefore, the reading method of the embodiment of the present application preliminarily determines the position of the count memory cell from the data in the first memory cell in each word line.
More specifically, since this step reads only the data in the first memory cell in each word line, step S102 needs to read the data n times (corresponding to the number of word lines) at most.
More specifically, in some other embodiments, since the working memory block is a memory block for counting, and the memory space corresponding to the first word line is in a state for counting or a fully written state, step S102 may also be to skip a reading process of a first memory cell of the first word line, and start reading the first memory cell from the second word line along the word line arrangement direction to search for and obtain the count word line; in this implementation, when it is determined that no data is written into the first memory cell on the second word line, the first word line may be determined as the digit line, so that the reading and identification of the first memory cell on the first word line are not required in the whole search and acquisition process, and the digit line is determined in step S102 by reading the data n-1 times at most.
S103, searching and acquiring a counting storage unit in the counting digit line along the arrangement direction of the bit line, wherein the counting storage unit is the last storage unit written with data in the counting digit line;
specifically, the count storage unit is a storage unit in which the monotonic counter writes the count value last during the last write count operation.
More specifically, step S102 determines the word line where the counting memory cell is located, and since the operation of writing the count by the monotonic counter is performed according to the number of the memory cell, all the memory cells located before the counting memory cell in the counting word line have data written therein, and all the memory cells located before the counting memory cell have no data written therein; therefore, step S103 can perform a read operation step by step along the bit line arrangement direction to search out the count memory cell.
S104, acquiring a current count value in the data bit according to the count storage unit;
specifically, the count storage unit obtained in step 103 can know the number of storage units with data written in the whole storage block through analysis, so as to obtain the current count value in the data bits according to the count storage unit.
And S105, acquiring a total count value according to the current count value and the base number value.
Specifically, the total count value recorded in the working memory block can be obtained by calculating the sum of the current count value and the base value, thereby completing the count value reading operation of the monotonic counter.
Compared with a reading process of traversing data bits to obtain a current count value, the reading process of searching the last memory cell written with data is divided into two parts, a word line where the counting memory cell is located is firstly preliminarily determined in a mode of searching a counting digit line, then the counting memory cell is searched in the memory cell of the counting digit line, the data bits are not required to be traversed and read step by step from the initial address of the data bits to obtain the counting memory cell, and the average time of the counting value reading process is effectively reduced by means of obtaining the counting digit line to preliminarily screen out the approximate position of the counting memory cell.
More specifically, the working memory block of the monotonic counter related to the embodiment of the present application is a general memory block, in which the type and the amount of the data written by the base bits and the data bits are consistent with the type and the amount of the data in the general memory block.
In some preferred embodiments, in the process of searching and acquiring the count line along the word line arrangement direction in step S102, the word line arrangement direction may be a sequential direction (increasing direction) or a reverse direction (decreasing direction), and the specific operation processes of the two search modes are as follows:
in the first search method, the step of searching for and acquiring a count line in the word line arrangement direction in step S102 includes the following substeps:
s1021, sequentially reading the data of the first memory cell on each word line in the data bits along the arrangement sequence direction of the word lines;
specifically, the word lines of the monotonic counter have the numbers WL <0>, WL <1>, WL <2> … … WL < n-1> in sequence, and the data of the first memory cell on each word line in the data bits is read in sequence along the word line arrangement sequence direction, and the data of the first memory cell in WL <0>, WL <1>, WL <2> … … WL < n-1> is read in sequence, or the data of the first memory cell in WL <1>, WL <2> … … WL < n-1> is read in sequence.
S1022, when the first memory cell to which data is not written is read or when the last memory cell to which data is written is read, the read operation is stopped;
specifically, in the process of sequentially reading the data of the first memory cell in each word line, when the first memory cell with unwritten data is read for the first time, it indicates that none of the memory cells on the word line of the first memory cell with unwritten data has unwritten data, and the word line on which the last memory cell of the first memory cell with unwritten data is located has a counting memory cell; in addition, the count word line may be the last word line, so that the last word line is indicated as the count word line when the last first memory cell read is written with data.
S1023, a word line on which the first memory cell of the first memory cell to which data is not written is regarded as a count word line, or a word line on which the last memory cell to which data is written is regarded as a count word line.
Specifically, in step S102 of the search method, the counting line is determined based on a change characteristic that the first memory cell in different word lines changes from written data to unwritten data, and the corresponding word line can be directly regarded as the counting line when the last first memory cell writes data.
In the second search mode, the step of searching for and acquiring a count line in the word line arrangement direction in step S102 includes the following substeps:
s1021', sequentially reading data of a first memory cell on each word line in the data bits along the word line arrangement reverse direction;
specifically, the data of the first memory cell of WL < n-1>, WL < n-2>, WL < n-3> … … WL <0> is read sequentially along the word line arrangement reverse direction, or the data of the first memory cell of WL < n-1>, WL < n-2>, WL < n-3> … … WL <1> is read sequentially.
S1022', when the first memory cell written with data is read, the reading operation is stopped, and the word line in which the first memory cell written with data is located is regarded as the counter word line.
Specifically, in the process of sequentially reading the data of the first memory cell in each word line, when the first memory cell written with data is read for the first time, it indicates that none of the memory cells on the word line where the last memory cell of the first memory cell written with data is located have written data, and the word line where the first memory cell written with data is located has a counting memory cell.
Specifically, in step S102 of the search method, the counting digit line is determined based on a change characteristic that the first memory cell in different word lines transits from unwritten data to written data.
In the embodiment of the present application, the first search mode is preferably adopted in step S102, and the sequential search mode better conforms to the chip arithmetic logic, so as to avoid the chip arithmetic instruction from being designed too complicated.
In some preferred embodiments, in the step S103, in the process of searching the count word line in the bit line arrangement direction to obtain the count memory cell, the bit line arrangement direction may be a sequential direction (increasing direction) or a reverse direction (decreasing direction), and the specific operation processes of the two search modes are as follows:
in the first search method, the step S103 of searching the count word line for the acquired count memory cell in the bit line arrangement direction includes the following substeps:
s1031, sequentially reading data of each memory cell in the digit line along the arrangement sequence direction of the bit lines;
specifically, the word line of the monotonic counter has the numbers BL <0>, BL <1>, BL <2> … … BL <8m-2>, BL <8m-1> in sequence, and the process of reading the memory cell is to read the data of 8bit lines as a group, so the reading process of this step is to read the data of the count word line corresponding to the bit lines BL <0> -BL <7>, BL <8> -BL15>, BL <16> -BL <23> … … BL <8m-8> -BL <8m-1> in sequence.
S1032, stopping reading operation when the memory cell which is not written with data is read or when the last memory cell is read with data;
specifically, in the process of sequentially reading the data of each storage unit on the count word line, when a storage unit which is not written with data is read for the first time, it is indicated that the storage units in front of the storage unit which is not written with data are all written with data, and the storage units behind the storage unit which is not written with data are all not written with data; in addition, the count memory cell may be the last memory cell in the count word line, and thus, when the last memory cell read is written with data, it indicates that the last memory cell is the count memory cell.
S1033, regarding the last memory cell of the memory cells to which data is not written as a count memory cell, or regarding the last memory cell to which data is written as a count memory cell.
Specifically, in step S103 of the search method, a count memory cell is determined based on a change characteristic of a memory cell in the count line from written data to unwritten data, and the memory cell can be directly regarded as the count memory cell when the last memory cell is written with data.
In the second search method, the step S103 of searching the count word line for the acquired count memory cell in the bit line arrangement direction includes the following substeps:
s1031', sequentially reading the data of each memory cell in the digit line along the reverse direction of the bit line arrangement;
specifically, the step reading process reads the data on the counter word line corresponding to the bit lines BL <8m-8> -BL <8m-1>, BL <8m-17> -BL <8m-9> … … BL <8> -BL15>, BL <0> -BL <7> … … in sequence.
S1032' when the memory cell written with data is read, the reading operation is stopped, and the memory cell written with data is regarded as a count memory cell.
Specifically, in the process of sequentially reading the data of each memory cell on the count word line, when the memory cell written with data is read for the first time, the memory cell written with data is indicated as a count memory cell.
Specifically, in step S103 of the search method, a count memory cell is determined based on a change characteristic of a memory cell in the count line from unwritten data to written data.
In this embodiment, the first search mode is preferably adopted in step S103, and the sequential search mode better conforms to the chip arithmetic logic, so as to avoid the chip arithmetic instruction from being too complex in design.
In some preferred embodiments, the step of obtaining the current count value in the data bits according to the count storage unit in step S104 includes:
and acquiring the current count value in the data bit according to the address of the counting storage unit.
Specifically, the storage units are used for storing data in the storage block, and the storage units are also used for counting, so that each storage unit has a corresponding unique storage address, and the storage addresses are generally arranged according to the arrangement position sequence of the storage units, so that the step can determine the number of the storage units written with data in the data bits of the working storage block by acquiring the addresses of the counting storage units, and further determine the current counting value.
More specifically, the current count value coincides with the number of memory cells in the data bit where data is written.
In a second aspect, please refer to fig. 2, fig. 2 is a counting method provided in some embodiments of the present application for increasing the count of a working memory block in a monotonic counter, the counting method includes the following steps:
s201, searching and acquiring a digit line along the arrangement direction of the word lines, wherein the digit line is the word line of which the last first storage unit is written with data;
s202, searching and acquiring a counting storage unit in the counting digit line along the arrangement direction of the bit line, wherein the counting storage unit is the last storage unit written with data in the counting digit line;
and S203, writing the next storage unit of the counting storage unit.
Specifically, since the counting process of the monotonic counter is implemented by writing a new count in the order of addresses in the data bits, after the position of the counting storage unit is determined in step S202, in step S203, writing a new count value in the next storage unit of the counting storage unit is completed, so as to implement the writing counting operation of the monotonic counter.
Compared with the method for acquiring the current counting bit by traversing the data bit and then writing to realize counting, the counting method divides the process of searching the last storage unit with data written into two parts, firstly preliminarily determines the word line where the counting storage unit is located by searching the counting digit line, secondly searches the counting storage unit in the storage unit of the counting digit line, does not need to gradually traverse and read the data bit data from the initial address of the data bit to acquire the counting storage unit, and effectively reduces the average time of the whole counting operation of the monotonic counter by initially screening out the approximate position of the counting storage unit by acquiring the counting digit line.
In some preferred embodiments, the following steps may be further performed between step S202 and step S203:
s202', a current count value in the data bit is obtained according to the count storage unit, and a total count value is obtained according to the current count value and the base number value.
The obtained total count value can be supplied to a monotonic counter for data verification and other processing.
In a third aspect, referring to fig. 3, fig. 3 is a counting value reading apparatus provided in some embodiments of the present application, configured to read a total counting value of a working memory block in a monotonic counter, where the working memory block is provided with a base bit and a data bit, and the reading apparatus includes:
the first reading module 301 is configured to read a radix value stored in a radix bit in the working memory block;
a word line searching module 302, configured to search and obtain a digit line along a word line arrangement direction, where the digit line is a word line in which data is written in a last first memory cell;
the bit line searching module 303 is configured to search and obtain a counting storage unit in the counting word line along the bit line arrangement direction, where the counting storage unit is a last storage unit in the counting word line, where data is written;
a second reading module 304, configured to obtain a current count value in the data bits according to the count storage unit;
and a calculating module 305, configured to obtain a total count value according to the current count value and the radix value.
Compared with the original reading process of traversing data bits to obtain the current count value, the process of searching the last memory cell written with data is divided into two parts, the word line where the counting memory cell is located is firstly preliminarily determined in a mode of searching the counting bit line through the word line searching module 302, then the counting memory cell is searched in the memory cell of the counting bit line through the bit line searching module 303, the data bits are not required to be traversed and read step by step from the initial address of the data bits to obtain the counting memory cell, and the average time of the counting value reading process is effectively reduced by the method of preliminarily screening out the approximate position of the counting memory cell through obtaining the counting bit line.
In some preferred embodiments, the above-mentioned counter value reading device is preferably used for executing a counter value reading method provided by the first aspect.
In a fourth aspect, please refer to fig. 4, where fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application, and the present application provides an electronic device 4, including: the processor 401 and the memory 402, the processor 401 and the memory 402 being interconnected and communicating with each other via a communication bus 403 and/or other form of connection mechanism (not shown), the memory 402 storing a computer program executable by the processor 401, the processor 401 executing the computer program when the computing device is running to perform the method of any of the alternative implementations of the embodiments described above.
In a fifth aspect, the present application provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the computer program performs the method in any optional implementation manner of the foregoing embodiments. The storage medium may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), an Erasable Programmable Read-Only Memory (EPROM), a Programmable Read-Only Memory (PROM), a Read-Only Memory (ROM), a magnetic Memory, and a flash Memory.
In summary, the embodiments of the present application provide a counter value reading method, a counter method, an apparatus, an electronic device, and a storage medium, where the reading method divides a process of searching a last storage unit written with data into two parts compared with an original reading process of traversing data bits to obtain a current counter value, first preliminarily determines a word line where the counter storage unit is located by searching a counter line, then searches the counter storage unit in the storage unit of the counter line, and does not need to traverse the data bits from a start address of the data bits step by step to obtain the counter storage unit, and an average time consumption of the counter value reading process is effectively reduced by preliminarily screening out an approximate position of the counter storage unit by obtaining the counter line.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
In this document, relational terms such as first and second, and the like may be 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.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. A count value reading method for reading a total count value of a working memory block in a monotonic counter, the working memory block being provided with a base bit and a data bit, the reading method comprising the steps of:
reading a radix value stored by the radix bit in the working storage block;
searching along the arrangement direction of the word lines to obtain a digit counting line, wherein the digit counting line is the word line of which the last first storage unit is written with data;
searching and acquiring a counting storage unit in the counting line along the arrangement direction of the bit lines, wherein the counting storage unit is the last storage unit with data written in the counting line;
acquiring a current count value in the data bits according to the count storage unit;
and acquiring the total count value according to the current count value and the base number value.
2. A method for reading a count value according to claim 1, wherein said step of searching for and obtaining a count line along the word line arrangement direction includes:
sequentially reading the data of the first memory cell on each word line in the data bits along the arrangement sequence direction of the word lines;
stopping the reading operation when the first storage unit which is not written with data is read or when the last storage unit is read with data;
and regarding the word line where the last first storage unit of the first storage unit in which data is not written is located as the counting digit line, or regarding the word line where the last first storage unit in which data is written is located as the counting digit line.
3. A method for reading a count value according to claim 1, wherein said step of searching for a memory cell of a count obtained along a bit line arrangement direction in said count line comprises:
sequentially reading the data of each memory cell in the digit line along the arrangement sequence direction of the bit lines;
stopping the reading operation when the memory unit which is not written with data is read or when the last memory unit is read with data;
and regarding the last storage unit of the storage units in which the data is not written as the counting storage unit, or regarding the last storage unit in which the data is written as the counting storage unit.
4. A method for reading a count value according to claim 1, wherein said step of searching for and obtaining a count line along the word line arrangement direction includes:
sequentially reading the data of the first memory cell on each word line in the data bits along the reverse sequence direction of the word line arrangement;
and when the first memory cell written with data is read, stopping the reading operation, and regarding the word line where the first memory cell written with data is positioned as the counting word line.
5. A method for reading a count value according to claim 1, wherein said step of searching for a memory cell of a count obtained along a bit line arrangement direction in said count line comprises:
sequentially reading the data of each memory cell in the digit line along the reverse direction of the bit line arrangement;
when the memory cell written with data is read, the reading operation is stopped, and the memory cell written with data is regarded as the counting memory cell.
6. A method for reading a count value according to claim 1, wherein said step of obtaining a current count value in said data bits according to said count storage unit comprises:
and acquiring the current count value in the data bit according to the address of the counting storage unit.
7. A counting method for increasing a count of a working memory block in a monotonic counter, the counting method comprising the steps of:
searching along the arrangement direction of the word lines to obtain a digit counting line, wherein the digit counting line is the word line of which the last first storage unit is written with data;
searching and acquiring a counting storage unit in the counting line along the arrangement direction of the bit lines, wherein the counting storage unit is the last storage unit with data written in the counting line;
and writing the next storage unit of the counting storage unit.
8. A count value reading apparatus for reading a total count value of a working memory block in a monotonic counter, the working memory block being provided with a base bit and a data bit, the reading apparatus comprising:
the first reading module is used for reading the base value stored by the base digit in the working storage block;
the word line searching module is used for searching and obtaining a counting line along the word line arrangement direction, wherein the counting line is the word line of which the last first storage unit is written with data;
the bit line searching module is used for searching and acquiring a counting storage unit in the counting lines along the bit line arrangement direction, wherein the counting storage unit is the last storage unit written with data in the counting lines;
the second reading module is used for acquiring the current count value in the data bit according to the count storage unit;
and the calculation module is used for acquiring the total count value according to the current count value and the base number value.
9. An electronic device comprising a processor and a memory, said memory storing computer readable instructions which, when executed by said processor, perform the steps of the method of any of claims 1-6.
10. A storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the steps of the method according to any one of claims 1-6.
CN202111671094.1A 2021-12-31 2021-12-31 Count value reading method, count method, device, electronic device and storage medium Active CN114329640B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111671094.1A CN114329640B (en) 2021-12-31 2021-12-31 Count value reading method, count method, device, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111671094.1A CN114329640B (en) 2021-12-31 2021-12-31 Count value reading method, count method, device, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN114329640A true CN114329640A (en) 2022-04-12
CN114329640B CN114329640B (en) 2022-12-06

Family

ID=81020548

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111671094.1A Active CN114329640B (en) 2021-12-31 2021-12-31 Count value reading method, count method, device, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN114329640B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095772A (en) * 2014-05-19 2015-11-25 英特尔公司 Method and apparatus for securely saving and restoring the state of a computing platform
CN112582010A (en) * 2020-12-11 2021-03-30 武汉新芯集成电路制造有限公司 Monotonic counter and method of operating the same
US20210265004A1 (en) * 2020-02-25 2021-08-26 SK Hynix Inc. Storage device and operating method thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095772A (en) * 2014-05-19 2015-11-25 英特尔公司 Method and apparatus for securely saving and restoring the state of a computing platform
US20210265004A1 (en) * 2020-02-25 2021-08-26 SK Hynix Inc. Storage device and operating method thereof
CN112582010A (en) * 2020-12-11 2021-03-30 武汉新芯集成电路制造有限公司 Monotonic counter and method of operating the same

Also Published As

Publication number Publication date
CN114329640B (en) 2022-12-06

Similar Documents

Publication Publication Date Title
US7240178B2 (en) Non-volatile memory and non-volatile memory data rewriting method
US8892814B2 (en) Data storing method, and memory controller and memory storage apparatus using the same
US8341336B2 (en) Region-based management method of non-volatile memory
US8489942B1 (en) Memory management method, and memory controller and memory storage device using the same
US6742078B1 (en) Management, data link structure and calculating method for flash memory
CN106448737A (en) Flash memory data reading method and device and solid disk drive
US8832527B2 (en) Method of storing system data, and memory controller and memory storage apparatus using the same
CN101901169B (en) Scanner and method
CN108959526B (en) Log management method and log management device
US20160266791A1 (en) Memory control circuit unit, memory storage apparatus and data accessing method
CN110673789A (en) Metadata storage management method, device, equipment and storage medium of solid state disk
CN112000536A (en) Memory detection method, system and related equipment
US20140089566A1 (en) Data storing method, and memory controller and memory storage apparatus using the same
US9778862B2 (en) Data storing method for preventing data losing during flush operation, memory control circuit unit and memory storage apparatus
CN107229580A (en) Sequential stream detection method and apparatus
US10007601B2 (en) Data storage device and operating method for flash memory
CN103106148A (en) Block management method, storage controller and storage storing device
CN114329640B (en) Count value reading method, count method, device, electronic device and storage medium
CN114300026A (en) Monotonic counter, counting method, electronic device and storage medium
CN205541960U (en) Processing apparatus and NOT AND type flash memory of bad row in NOT AND type flash memory
CN106445397B (en) Storage management method, memorizer control circuit unit and memory storage apparatus
CN113870931A (en) Data writing method, data reading method, data writing device, data reading device, electronic equipment and storage medium
CN112988037A (en) Static wear leveling method, terminal and computer-readable storage medium
CN114328283B (en) Counting address acquisition method, counting method, device, equipment and storage medium
CN103514953A (en) Emulated electrically erasable memory having an address RAM for data stored in flash memory

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