Storage device and storage device counting method
Patent Information
- Application Number
- CN202510507210.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2025-04-17
- Filing Date
- 2025-04-22
- Publication Date
- 2026-10-23
AI Technical Summary
[0006]据此,通过将计数值转换为不规则的非线性值,将可增加数据传输的安全性,且避免计数值可能会被破解的潜在风险。
Smart Images

Figure CN122963434A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to data storage and transmission technology, and in particular to a storage device and a method for counting storage devices. Background Technology
[0002] With the improvement of computer computing performance and storage technology, the performance requirements for storage devices are also increasing. In response to market demands, how to improve the application of memory so that it can not only read and write data, but also have security mechanisms to prevent information leakage has become a major issue. Summary of the Invention
[0003] This invention relates to a storage device comprising a counting circuit, a non-volatile memory, and a conversion circuit. The counting circuit generates a count value. The non-volatile memory is coupled to the counting circuit and stores the count value. The conversion circuit is coupled to the non-volatile memory and converts the count value into a non-linear value according to a conversion relationship. The conversion relationship is neither an increasing nor decreasing relationship, and the non-linear value generated by the conversion circuit does not repeat when the count value corresponds to different values.
[0004] The present invention also relates to a counting method for a storage device, comprising: generating a count value through a counting circuit; and converting the count value into a nonlinear value according to a conversion relationship through a conversion circuit, wherein the conversion relationship is neither an increasing nor a decreasing relationship, and the nonlinear value generated by the conversion circuit does not repeat when the count value corresponds to different values.
[0005] The present invention also relates to a storage device comprising a non-volatile memory, a control circuit, and a conversion circuit. The non-volatile memory is used to store stored data and a count value. The control circuit is used to change the count value during the transfer of stored data. The conversion circuit is coupled to the non-volatile memory and is used to convert the count value into a non-linear value. There is no incrementing or decrementing relationship between the count value and the non-linear value.
[0006] Therefore, by converting the count value into an irregular non-linear value, the security of data transmission can be increased, and the potential risk of the count value being cracked can be avoided. Attached Figure Description
[0007] Figure 1 This is a schematic diagram of a storage device according to a partial embodiment of the present invention.
[0008] Figure 2 This is a flowchart of a storage device counting method according to a partial embodiment of the present invention.
[0009] Figure 3 This is a schematic diagram of the count values and nonlinear values according to some embodiments of the present invention.
[0010] Explanation of reference numerals in the attached figures:
[0011] 100: Storage device
[0012] 110: Control Circuit
[0013] 111: Counting Circuit
[0014] 120: Non-volatile memory
[0015] 130: Temporary Register
[0016] 140: Conversion Circuit
[0017] 301: Trajectory
[0018] 302: Trajectory
[0019] D11: Storing Data
[0020] N11: Count value
[0021] N12: Nonlinear value
[0022] S201-S204: Steps Detailed Implementation
[0023] The following describes several embodiments of the present invention with reference to the accompanying drawings. For clarity, many practical details will be described in conjunction with the following description. However, it should be understood that these practical details are not intended to limit the invention. That is, in some embodiments of the invention, these practical details are not essential. Furthermore, for the sake of simplicity, some known and conventional structures and elements will be shown in the drawings in a simple schematic manner.
[0024] In this document, when an element is referred to as a "connection" or "coupled," it may mean an "electrical connection" or "electrical coupling." "Connection" or "coupled" can also be used to indicate the operation or interaction between two or more elements. Furthermore, although terms such as "first," "second," etc., are used herein to describe different elements, these terms are merely used to distinguish elements or operations described using the same technical terms. Unless the context clearly indicates otherwise, these terms do not specifically refer to or imply any order or sequence, nor are they intended to limit the invention.
[0025] This invention relates to a storage device and a method for counting storage devices. Storage devices come in many types, such as flash memory, resistive random-access memory (ReRAM), electrically erasable programmable read-only memory (EEPROM), and phase-change memory (PCM). Storage devices are used to store digital data and can be easily read or transferred.
[0026] Digital data may pose security risks during transmission, such as being intercepted by hackers (e.g., through replay attacks). Therefore, storage devices need to incorporate security mechanisms. One such mechanism involves encrypting the digital data using a Secure Hash Algorithm (SHA) or Hash-based Message Authentication Code (HMAC), and / or verifying it using a MAC address. Furthermore, during data transmission, the storage device's processor can simultaneously perform a counter, adding the counter value to the transmitted encrypted information as part of the encryption, thus increasing the encryption complexity.
[0027] However, since the count value increases with the number of transmissions, it can still be predicted or cracked. The storage device and storage device counting method provided by this invention are improvements to the security mechanism of storage devices. In the following description, "storage device / memory" can be implemented by non-volatile memory such as Flash, ReRAM, EEPROM, PCM, etc., but this invention is not limited thereto.
[0028] Figure 1 This is a schematic diagram of a storage device 100 according to a partial embodiment of the present invention. The storage device 100 includes a control circuit 110, a non-volatile memory 120, a temporary register 130, and a conversion circuit 140. The control circuit 110 is communicatively connected to an external device for data transmission. The control circuit 110 also includes a counting circuit 111 (e.g., a counter). Each time the storage device 100 transmits data to an external device, the control circuit 110 generates / changes a count value by incrementing or decrementing it. For example, during the first data transmission, the count value is "1", and during the second data transmission, the count value is changed to "2". In some embodiments, the control circuit 110 can establish a communication connection with the external device via a connection circuit or a communication circuit. Since those skilled in the art will understand the methods of data transmission between different devices, further details are omitted here.
[0029] Non-volatile memory 120 is coupled to control circuit 110 to store stored data D11 and count value N11 generated by control circuit 110 / counting circuit 111. In some embodiments, temporary register 130 is also coupled to control circuit 110 to temporarily store the stored data D11 and count value N11 to be sent.
[0030] The aforementioned "stored data D11" refers to one or more data or files stored in storage device 100. During data transfer, storage device 100 may only send at least a portion of the stored data D11 to an external device. In other words, the data content may differ each time it is transferred. The following paragraphs will use "transferring stored data D11" to uniformly refer to data transfer between storage device 100 and an external device.
[0031] The conversion circuit 140 is coupled to the non-volatile memory 120 (or possibly to the control circuit 110) via a temporary register 130, and is used to convert the count value N11 into a non-linear value N12 according to a set conversion relationship. The "conversion relationship" can be a set encoding format, encryption method, scrambling function, or mapping table.
[0032] The "conversion relationship" differs from the "counting method" by which the counting circuit 111 generates the count value N11. The conversion relationship is neither an increasing nor a decreasing relationship. In other words, there is no increasing or decreasing relationship between the count value N11 and the converted result (non-linear value N12). The aforementioned "increasing or decreasing relationship" refers to the correspondence interpreted / identified in formats such as decimal, binary, and hexadecimal.
[0033] Furthermore, the "conversion relationship" is unique and singular. This means that when the count value N11 corresponds to multiple different values, the multiple nonlinear values N12 generated by the conversion circuit 140 will not repeat. For example, if the counting order of the count value N11 is "1, 2, 3, 4" (interpreted in decimal), then the nonlinear value N12 can be four distinct values such as "3, 1, 2, 6". The "conversion relationship" is a pre-defined conversion method with a specific logical relationship; therefore, for a third party (such as a hacker) unaware of the conversion relationship, the changes in the nonlinear value N12 will be irregular.
[0034] Therefore, by converting the count value into an irregular non-linear value, the count value can be made more complex, increasing the difficulty for hackers to predict or crack it, thereby improving the security of the storage device.
[0035] Figure 2This is a flowchart of a storage device counting method according to a partial embodiment of the present invention. In step S201, when the control circuit 110 receives a data read instruction corresponding to the stored data D11, the control circuit 110 generates a count value N11 through the counting circuit 111, and the counting circuit 111 changes the count value N11 in an incrementing or decrementing manner.
[0036] In step S202, the conversion circuit 140 converts the count value N11 into a nonlinear value according to the conversion relationship. As mentioned earlier, the conversion relationship is different from the counting method of the counting circuit 111, and it is not an increasing or decreasing relationship. The conversion relationship is a pre-set encoding format, encryption method, scrambling function, or mapping table within the conversion circuit 140.
[0037] In one embodiment, the conversion relationship includes a cyclic encoding format. The conversion circuit 140 converts the count value N11 from binary format to this cyclic encoding format to generate a non-linear value N12. The cyclic encoding format can be "Gray Code". Gray Code is a cyclic binary unit distance code, defined as follows: for any two adjacent values, their Gray Codes will differ by only one code. For example, for the decimal values "0, 1, 2, 3", the binary code is "000, 001, 010, 011", while the Gray Code is "000, 001, 011, 010". If the Gray Code is interpreted in binary, the interpreted counting order is not increasing or decreasing, but irregular.
[0038] In some embodiments, the conversion relationship may be a scramble function or a mapping table preset in the conversion circuit 140, so that the conversion circuit 140 can convert the count value N11 into a nonlinear value N12.
[0039] In step S203, the control circuit 110 integrates the stored data D11 and the nonlinear value N12 into a single transmission data. In one embodiment, the control circuit 110 encrypts the transmission data into a verification message using at least one one-way function. For example, it encrypts the data using a hash verification code (HMAC, HMAC-SHA256).
[0040] In step S204, the storage device 100 transmits the data (or encrypted verification information) to the external device via an output buffer circuit (not shown). Through the complex nonlinear value, the external device can more securely obtain the complete stored data D11 and prevent replay attacks.
[0041] Figure 3This is a schematic diagram of the count value N11 and the nonlinear value N12 according to a partial embodiment of the present invention. In this embodiment, the counting circuit 111 records the count value N11 in an incrementing manner, and the conversion circuit 140 generates the nonlinear value N12 according to a mapping table.
[0042] exist Figure 3 In the diagram, the vertical axis represents the numerical value in decimal, and the horizontal axis represents the number of file transfers. Trajectory 301 represents the counting order of the count value N11, and trajectory 302 represents the counting order of the non-linear value N12. For example... Figure 3 As shown, the counting order of the counter value N11 is "0, 1, 2, 3, 4", while the counting order of the non-linear value N12 is "0, 3, 1, 2". If the non-linear value N12 is interpreted in binary format, the result will be irregular, thus improving the security of the storage device.
[0043] The elements, method steps, or technical features in the foregoing embodiments can be combined with each other, and are not limited to the order of textual description or graphical presentation in this invention.
[0044] Although the present invention has been disclosed above with reference to embodiments, it is not intended to limit the present invention. Those skilled in the art can make various modifications and refinements without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention shall be determined by the appended claims.
Claims
1. A storage device comprising: A counting circuit used to generate a count value; A non-volatile memory, coupled to the counting circuit, is used to store the count value; and A conversion circuit, coupled to the non-volatile memory, is used to convert the count value into a non-linear value according to a conversion relationship, wherein the conversion relationship is neither an increasing nor a decreasing relationship, and the non-linear value generated by the conversion circuit will not repeat when the count value corresponds to different values.
2. The storage device according to claim 1, further comprising: A control circuit, including the counting circuit, wherein the control circuit is used to integrate the nonlinear value and a stored data into a transmitted data, and to transmit the transmitted data to an external device.
3. The storage device according to claim 2, wherein the control circuit is further configured to encrypt the transmitted data into a verification message by at least one one-way function, so as to transmit the verification message to the external device.
4. The storage device of claim 1, wherein the conversion circuit converts the count value from binary format to a cyclic encoding format to generate the nonlinear value.
5. The storage device according to claim 4, wherein the cyclic encoding format is Gray code format.
6. The storage device of claim 1, wherein the conversion circuit is configured to convert the count value into the nonlinear value according to a scrambling function.
7. The storage device of claim 1, wherein the conversion circuit is configured to convert the count value into the nonlinear value according to a mapping table.
8. A method for counting storage devices, comprising: A count value is generated by a counting circuit; and A conversion circuit converts the count value into a non-linear value according to a conversion relationship, wherein the conversion relationship is neither an increasing nor a decreasing relationship, and the non-linear value generated by the conversion circuit will not repeat when the count value corresponds to different values.
9. The storage device counting method according to claim 8, further comprising: The nonlinear value and a stored data are integrated into a transmission data through a control circuit, and the transmission data is then transmitted to an external device.
10. The storage device counting method according to claim 9, further comprising: The transmitted data is encrypted into a verification message using at least one one-way function, and the verification message is then transmitted to the external device.
11. The storage device counting method according to claim 8, wherein the method of converting the count value to the nonlinear value according to the conversion relationship comprises: The count value is converted from binary format to a cyclic encoding format to produce the non-linear value.
12. The storage device counting method according to claim 11, wherein the cyclic encoding format is Gray code format.
13. The storage device counting method according to claim 8, wherein the method of converting the count value to the nonlinear value according to the conversion relationship comprises: The count value is converted into the nonlinear value using a scrambling function.
14. The storage device counting method according to claim 8, wherein the method of converting the count value to the nonlinear value according to the conversion relationship comprises: The count value is converted into the non-linear value using a mapping table.
15. A storage device comprising: A non-volatile memory for storing stored data and a count value; A control circuit for changing the counter value during the transmission of the stored data; and A conversion circuit is coupled to the non-volatile memory and is used to convert the count value into a non-linear value, wherein there is no increasing or decreasing relationship between the count value and the non-linear value.
16. The storage device of claim 15, wherein the control circuit is configured to integrate the nonlinear value and the stored data into a transmission data, and to transmit the transmission data to an external device.
17. The storage device of claim 16, wherein the control circuit is further configured to encrypt the transmitted data into a verification message by at least one one-way function, so as to transmit the verification message to the external device.
18. The storage device of claim 15, wherein the conversion circuit converts the count value from binary format to a cyclic encoding format to generate the nonlinear value.
19. The storage device of claim 18, wherein the cyclic encoding format is Gray code format.
20. The storage device of claim 15, wherein the conversion circuit is configured to convert the count value into the nonlinear value according to a scrambling function or a mapping table.