Search

CN-114153757-B - Cache control method and control system of memory

CN114153757BCN 114153757 BCN114153757 BCN 114153757BCN-114153757-B

Abstract

The invention provides a cache control method and a cache control system of a memory, wherein the cache control method comprises the following steps: and acquiring user operation information, and determining a buffer space allocation mode according to the operation information. And generating a control instruction according to the cache space allocation mode, and transmitting the control instruction to the receiving end, wherein the control instruction comprises a plurality of instruction sets. And determining an instruction set according to the control instruction, and marking the setting state of the cache space. And calling an instruction set according to the setting state of the cache space. And configuring a space management form of the cache space according to the instruction set so that the space management form matches the space allocation pattern. The cache control method and the cache control system for the memory can improve the working adaptability of the memory in various scenes.

Inventors

  • WANG SHOULEI

Assignees

  • 合肥康芯威存储技术有限公司

Dates

Publication Date
20260505
Application Date
20211206

Claims (6)

  1. 1. A method for controlling a memory, comprising: Acquiring user operation information, determining a buffer space allocation mode according to the operation information, wherein the buffer space comprises a plurality of allocation modes, setting the size of a space occupied by read-write operation in the buffer space according to the requirement of a user when the buffer space is a selection mode, and calling an instruction set, wherein the allocation mode of the buffer space also comprises an automatic mode, wherein the automatic mode sets the buffer space of a memory into a read-write mixed mode, and automatically adjusts the size of the space occupied by the read-write operation according to actual conditions; Generating a control instruction according to the cache space allocation mode, and transmitting the control instruction to a receiving end, wherein the control instruction comprises a plurality of instruction sets; Determining the instruction set according to the control instruction, and marking the setting state of the cache space; calling the instruction set according to the setting state of the cache space, and Configuring a space management form of the cache space according to the instruction set so that the space management form matches the space allocation pattern; wherein the instruction set includes a command to modify a cache space of the memory, a parameter to indicate a form of the cache space, and data to indicate a current set state of the cache space; When the application space finds that the space is insufficient, the application space is at the dividing line, and the space to be expanded is in an idle state, the cache space is expanded and configured.
  2. 2. The method for controlling a memory according to claim 1, wherein generating a control instruction according to the buffer space allocation pattern and transmitting the control instruction to a receiving terminal comprises: determining a mode unit state according to the allocation mode of the cache space; calling a list unit according to the mode unit state to generate the control instruction, and And transmitting the control instruction to a receiving end through a selection unit.
  3. 3. The method for controlling a memory according to claim 1, wherein configuring the space management form of the cache space so that the space management form matches the space allocation pattern according to the instruction set comprises: receiving an instruction packet; parsing the instruction packet to obtain commands, parameters, and data, and And configuring the cache space according to the command, the parameter and the data.
  4. 4. A memory control system, comprising: The control module is used for acquiring user operation information, determining a buffer space allocation mode according to the operation information, wherein the buffer space comprises a plurality of allocation modes, setting the size of a space occupied by read-write operation in the buffer space according to the requirement of a user when the buffer space is a selection mode, calling an instruction set, and setting the buffer space of a memory into a read-write mixed mode in the automatic mode, and automatically adjusting the size of the space occupied by the read-write operation according to actual conditions; wherein the control module generates a control instruction according to the buffer space allocation mode and transmits the control instruction to a receiving end, wherein the control instruction comprises a plurality of instruction sets, and The response module is used for determining the instruction set according to the control instruction and marking the setting state of the cache space; The response module calls the instruction set according to the setting state of the cache space; The response module configures a space management form of the cache space according to the instruction set so that the space management form matches the space allocation mode; wherein the instruction set includes a command to modify a cache space of the memory, a parameter to indicate a form of the cache space, and data to indicate a current set state of the cache space; When the application space finds that the space is insufficient, the application space is at the dividing line, and the space to be expanded is in an idle state, the cache space is expanded and configured.
  5. 5. The control system of the memory of claim 4, wherein the control module comprises: A mode unit for determining the mode unit state according to the allocation mode of the cache space; a list unit for calling the list unit according to the state of the mode unit to generate the control instruction, and And the selection unit is used for transmitting the control instruction to the receiving end.
  6. 6. The control system of the memory according to claim 4, wherein the response module includes: A receiving unit configured to receive the instruction packet; a parsing unit for parsing the instruction packet to obtain the command, the parameter and the corresponding data, and And the configuration unit configures the cache space according to the acquired command, the acquired parameters and the acquired data.

Description

Cache control method and control system of memory Technical Field The present invention relates to the field of storage technologies, and in particular, to a cache control method and a control system for a memory. Background Non-volatile memory (nonvolatile memory) is widely used in electronic devices such as personal computers because it has the advantage that it can store, read, erase data many times and the stored data does not disappear even after power is turned off. However, the existing cache space control system based on the nonvolatile memory controls the cache space in a firmware mode, so that the system is difficult to adapt to diversified customer use scenes. Therefore, how to improve the working adaptability of the memory in various situations has become a problem to be solved. Disclosure of Invention In view of the above drawbacks, the present application provides a method and a system for controlling a cache of a memory, which can control a cache space of a nonvolatile memory by a user in a software manner, so as to improve working adaptability of the memory in various scenarios. To achieve the above and other objects, the present application provides a memory control method, comprising: Acquiring user operation information, and determining a cache space allocation mode according to the operation information; Generating a control instruction according to the cache space allocation mode, and transmitting the control instruction to a receiving end, wherein the control instruction comprises a plurality of instruction sets; Determining the instruction set according to the control instruction, and marking the setting state of the cache space; calling the instruction set according to the setting state of the cache space, and And configuring a space management form of the cache space according to the instruction set so that the space management form matches the space allocation mode. In one embodiment of the application, the cache space includes a plurality of allocation modes, wherein the instruction set is invoked when the cache space is in a selection mode. In one embodiment of the application, the instruction set includes a command to modify a cache space of the memory, a parameter to indicate a form of the cache space, and data to indicate a current set state of the cache space. In one embodiment of the present application, the generating a control instruction according to the buffer space allocation mode and transmitting the control instruction to a receiving end includes: determining a mode unit state according to the allocation mode of the cache space; calling a list unit according to the mode unit state to generate the control instruction, and And transmitting the control instruction to a receiving end through a selection unit. In one embodiment of the present application, said configuring a space management form of the cache space according to the instruction set such that the space management form matches the space allocation pattern includes: receiving an instruction packet; parsing the instruction packet to obtain commands, parameters, and data, and And configuring the cache space according to the command, the parameter and the data. In one embodiment of the application, the allocation mode of the buffer space further comprises an automatic mode. In one embodiment of the present application, the auto mode sets the cache space of the memory to a read-write mix form. Based on the same conception, the application also provides a control system of the memory, comprising: the control module is used for acquiring user operation information and determining a cache space allocation mode according to the operation information; wherein the control module generates a control instruction according to the buffer space allocation mode and transmits the control instruction to a receiving end, wherein the control instruction comprises a plurality of instruction sets, and The response module is used for determining the instruction set according to the control instruction and marking the setting state of the cache space; The response module calls the instruction set according to the setting state of the cache space; and the response module configures a space management form of the cache space according to the instruction set so that the space management form matches the space allocation mode. In one embodiment of the application, the control module comprises: A mode unit for determining the mode unit state according to the allocation mode of the cache space; a list unit for calling the list unit according to the state of the mode unit to generate the control instruction, and And the selection unit is used for transmitting the control instruction to the receiving end. In one embodiment of the application, the response module comprises: A receiving unit configured to receive the instruction packet; a parsing unit for parsing the instruction packet to obtain the command, the parameter and the corresponding