Control method of storage chip, and related device and storage medium

By identifying the target character of the target memory chip and executing preset operations, the problem that the memory chip communication protocol cannot support operations other than those specified is solved, thus enabling a wider range of operational capabilities.

CN115708073BActive Publication Date: 2026-01-16SHENZHEN LONGSYS ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110961544.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-20
Publication Date
2026-01-16
Estimated Expiration
2041-08-20

AI Technical Summary

Technical Problem

The existing communication protocols of memory chips cannot support operations other than those specified in the communication protocol, which limits their operability.

Method used

By identifying target characters in the target memory chip and performing preset operations based on these characters, the operability of the memory chip is expanded.

Benefits of technology

By combining target characters with the communication protocol, more operations on the memory chip are realized, expanding its operability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115708073B_ABST
    Figure CN115708073B_ABST
Patent Text Reader

Abstract

The application discloses a control method of a storage chip, related equipment and a storage medium. The method comprises the following steps: determining a communication protocol applied by a target storage chip; determining a target character corresponding to the target storage chip in a target command related to the communication protocol and received; and performing a preset operation corresponding to the target character on the target storage chip. Through the method, the operability of the target storage chip can be expanded.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of semiconductor technology, and in particular, to a control method of a storage chip, and related equipment and a storage medium. BACKGROUND

[0002] For a storage chip, relevant operations can be performed on the storage chip based on relevant commands of a communication protocol applied by the storage chip. For example, for a UFS3.1 (Universal Flash Storage 3.1) storage chip, read and write operations of the storage chip can be implemented based on a UFS3.1 protocol.

[0003] In addition, the storage chip also supports relevant operations other than the communication protocol applied by the storage chip, but these relevant operations do not belong to the specification of the communication protocol, which leads to the fact that the relevant operations cannot be performed through the communication protocol applied by the storage chip.

[0004] Therefore, how to improve the communication protocol applied by the storage chip to perform more operations on the storage chip is of great significance. SUMMARY

[0005] The present application provides a control method of a storage chip, and related equipment and a storage medium.

[0006] The first aspect of the present application provides a control method of a storage chip, the method comprising: determining a communication protocol applied by a target storage chip; determining a target character corresponding to the target storage chip in a target command received and related to the communication protocol; and performing a preset operation corresponding to the target character on the target storage chip.

[0007] Therefore, after receiving a target command related to the communication protocol applied by the target storage chip, by determining the target character corresponding to the target storage chip itself in the target command, and performing a preset operation corresponding to the target character on the target storage chip, the target storage chip can be operated based on the communication protocol and in combination with the target character corresponding to the target storage chip itself, thereby expanding the operability of the target storage chip.

[0008] The second aspect of the present application provides an electronic device, which comprises a processor and a memory coupled to each other, wherein the processor is configured to execute a computer program stored in the memory to implement the control method of the storage chip described in the first aspect.

[0009] The third aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, the program instructions being executed by a processor to implement the control method of the storage chip described in the first aspect.

[0010] According to the scheme, after receiving a target command related to a communication protocol applied by a target storage chip, a target character corresponding to the target storage chip itself in the target command is determined, and a preset operation corresponding to the target character is performed on the target storage chip, so that the target storage chip can be operated on the basis of the communication protocol in combination with the target character corresponding to the target storage chip itself, and the operability of the target storage chip is expanded. BRIEF DESCRIPTION OF DRAWINGS

[0011] Figure 1 is a first flowchart of a first embodiment of the control method of the storage chip;

[0012] Figure 2 is a second flowchart of the first embodiment of the control method of the storage chip;

[0013] Figure 3 is a flowchart of a second embodiment of the control method of the storage chip;

[0014] Figure 4 is a flowchart of a third embodiment of the control method of the storage chip;

[0015] Figure 5 is a framework diagram of an embodiment of the electronic device;

[0016] Figure 6 is a framework diagram of an embodiment of the computer readable storage medium. DETAILED DESCRIPTION

[0017] The scheme of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0018] In the following description, specific details such as specific system structures, interfaces, techniques, etc. are presented in order to thoroughly understand the present application, but are not intended to limit the present application.

[0019] The terms "system" and "network" are often used interchangeably in this paper. The term "and / or" in this paper is only a description of the association relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in this paper generally represents an "or" relationship between the front and rear associated objects. In addition, "multiple" in this paper means two or more than two.

[0020] In the present application, the electronic device provided with the storage chip, such as the embedded system composed of hardware and software, personal computer, mobile phone, etc. executes the control method of the storage chip.

[0021] Please refer to Figure 1 ,Figure 1 is a first flowchart of a first embodiment of the control method of the storage chip. Specifically, it can include the following steps:

[0022] Step S11: Determine the communication protocol applied by the target storage chip.

[0023] The target storage chip is, for example, a storage chip manufactured based on NAND flash memory (hereinafter referred to as NAND storage chip) or a dynamic random access memory (DRAM) chip.

[0024] The communication protocol applied by the target storage chip can be a communication protocol matched with the target storage chip. For example, for a NAND storage chip, the communication protocol applied by it can be UFS3.1 protocol, UFS2.1 protocol, eMMC5.0 (Embedded Multi Media Card 5.0), eMMC5.1, SD (Secure Digital Memory Card) card protocol, etc. For a DRAM chip, the communication protocol applied by it is, for example, DDR3, DDR4 protocol, etc. The method of determining the communication protocol applied by the target storage chip can be a general method in the art, for example, obtaining it from the relevant configuration information, which will not be described here.

[0025] Step S12: Determine the target character corresponding to the target storage chip in the target command received in relation to the communication protocol.

[0026] The target command can be sent by other devices to the execution subject of the control method of the storage chip of the present application, for example, the target command can be sent by other computers to the execution subject through Android Debug Bridge (adb). In other embodiments, the target command can also be generated by the execution subject itself.

[0027] After receiving the target command related to the communication protocol, the relevant operation of the target storage chip can be realized based on the communication protocol applied by the target storage chip and in combination with the target command. For example, for a storage chip applying UFS communication protocol, Read buffer cmd or Write buffer cmd commands can be used to realize the write and read operations of the target storage chip.

[0028] In the present application, the target character corresponding to the target storage chip is a character other than the communication protocol applied by the target storage chip, for example, a character defined by the manufacturer of the target storage chip, or other defined character. The target character can define the relevant operation on the target storage chip. Therefore, based on the target character, the operation on the target storage chip can also be realized. In the present application, the target character is part of the target command, and the target command contains the target character. Because the target character is set as part of the target command, the operation on the target storage chip by the target character can be realized based on the interaction mode of the communication protocol applied by the target storage chip.

[0029] In one embodiment, the original character in the target command can be replaced by the target character, so that the target character becomes part of the target command. In another embodiment, the target character can also be added to the target command, so that the target character becomes part of the target command. For example, for the UFS communication protocol, the character in a certain field of the target command, such as the MODE field, can be replaced by the target character, or a specific field can be added, and the target character is used as the character of the specific field.

[0030] Step S13: performing a preset operation corresponding to the target character on the target storage chip.

[0031] Because the operation on the target storage chip can also be realized based on the target character, after determining the target character in the target command corresponding to the target storage chip, the preset operation corresponding to the target character can be performed according to the target character. For example, the target character can be to read the remaining space, and the preset operation corresponding to the target character can be to return the current remaining storage space of the target storage chip. For another example, the target character can be to restore the factory settings, and the preset operation corresponding to the target character can be to delete all user data.

[0032] Therefore, after receiving the target command related to the communication protocol applied by the target storage chip, by determining the target character in the target command corresponding to the target storage chip itself, and performing the preset operation corresponding to the target character on the target storage chip, the relevant operation on the target storage chip can be realized based on the interaction mode of the communication protocol combined with the target character corresponding to the target storage chip itself, which expands the operability of the target storage chip.

[0033] In one embodiment, the target command further comprises verification information. Since the target character in the target command is other than the communication protocol, and the target character corresponds to a related operation on the target storage chip, in order to reduce the situation that the related operation is triggered by mistake, the verification information can be added in the target command to perform handshake authentication by using the verification information. In the case that the verification information in the target command is preset verification information, it can be confirmed that the handshake authentication is successful, and the preset operation corresponding to the target character is performed on the target storage chip. If the verification information in the target command is not the preset verification information, it is confirmed that the handshake authentication fails, and at this time, the preset operation corresponding to the target character is not performed on the target storage chip. By judging whether the verification information is the preset verification information, the preset verification information can be used for handshake authentication, and the related operation is performed only in the case that the handshake authentication is successful, so that the misoperation on the target storage chip can be reduced.

[0034] In one specific embodiment, the verification information can comprise the master information of the target storage chip, the firmware information of the target storage chip, the manufacturer information of the target storage chip, and the target character arranged in sequence. In another specific embodiment, the verification information can further comprise other information, for example, a pre-set verification code, etc. It can be understood that the verification information can be set as needed, which is not limited here.

[0035] Please refer to Figure 2 , Figure 2 is the second flowchart of the first embodiment of the control method of the storage chip. Specifically, the "performing a preset operation corresponding to the target command based on the target command" mentioned in the above steps can specifically comprise steps S131 and S132.

[0036] In the present embodiment, the target command comprises a first target command and a second target command. The target character in the first target command is a flash type switching character, and the target character in the second target command is a data migration character.

[0037] In the present embodiment, the target storage chip is a NAND storage chip. NAND flash memory can be divided into at least four types according to the storage principle, which are SLC (Single-Level Cell) flash memory, MLC (Multi-Level Cell) flash memory, TLC (Triple-Level Cell) flash memory and QLC (Quad-level cells) flash memory. Based on the storage principle of the four, the storage unit of the NAND flash memory can be changed to store the charge to realize the switching of the flash type, for example, the flash type of the QLC flash memory is switched to the SLC flash memory, the flash type of the TLC flash memory is switched to the SLC flash memory, or the flash type of the TLC flash memory is switched to the SLC flash memory, and then the flash type of the SLC flash memory is switched to the TLC flash memory.

[0038] Step S131: Switch the current flash memory type of the storage area of the target storage chip to the preset flash memory type based on the first target command.

[0039] The storage area of the target storage chip is the area in the target storage chip that stores data, for example, the flash memory in the target storage chip. The preset flash memory type can be SLC flash memory. In other embodiments, the preset flash memory type can also be MLC flash memory. It can be understood that the preset flash memory type can be set as needed as long as the target storage chip itself can support the flash memory type.

[0040] Because the target character in the first target command is a flash memory type switching character, the current flash memory type of the storage area of the target storage chip can be switched to the preset flash memory type. In an embodiment, the current flash memory type of the storage area of the target storage chip is TLC flash memory, and the preset flash memory type is SLC flash memory. By setting 1 memory storage unit in the flash memory of the target storage chip to store 1 bit of data, the TLC flash memory can be switched to SLC flash memory.

[0041] Step S132: Store the target data stored in the storage area corresponding to the current flash memory type in the storage area corresponding to the preset flash memory type based on the second target command.

[0042] After the current flash memory type of the storage area of the target storage chip is switched to the preset flash memory type, the target data stored in the storage area corresponding to the current flash memory type can also be stored in the storage area corresponding to the preset flash memory type based on the data migration character in the second target command. The target data can be user-defined data or all user data, and the present application does not limit the target data.

[0043] In a specific embodiment, after part of the storage area of the target storage chip is switched to SLC flash memory, the target data stored in the TLC flash memory type flash memory can be transferred to the SLC flash memory type flash memory. In this way, by transferring the target data stored in the TLC flash memory type flash memory to the SLC flash memory type flash memory, the high-temperature resistance of the SLC flash memory type can be utilized to prevent the target data from being lost under high temperature, thereby protecting the data and reducing the possibility of generating false bad blocks in the target storage chip.

[0044] Therefore, by switching the current flash memory type of the storage area of the target storage chip to the preset flash memory type and storing the target data stored in the storage area corresponding to the current flash memory type in the storage area corresponding to the preset flash memory type, the target data is migrated to the storage area corresponding to the preset flash memory type.

[0045] Please refer to Figure 3 , Figure 3 is a flowchart of a second embodiment of the control method of the storage chip. In this embodiment, the target command further includes a third target command, and the target character in the third target command is a target capacity character. Specifically, before performing the above-mentioned step of "switching the current flash memory type of the storage region of the target storage chip to the preset flash memory type based on the first target command", the following step can also be performed:

[0046] Step S21: based on the third target command, determining the target capacity that needs to be released in the target storage chip, so that after the flash memory type of the storage region on the target storage chip is switched to the preset flash memory type, the storage region corresponding to the preset flash memory type can store the target data.

[0047] It can be understood that after the storage region on the target storage chip is switched to the preset flash memory type, the storage capacity of the target storage chip will also change accordingly. Therefore, the target capacity that needs to be released in the target storage chip can be determined based on the third target command in combination with the size of the target data. The specific way of releasing the target capacity can be manual deletion by the user or data deletion by the execution subject of the control method of the storage chip of the present application. After the target capacity is released, the remaining capacity of the target storage chip will increase, and at this time, by switching the flash memory type of the storage region of the remaining capacity to the preset flash memory type, the storage region corresponding to the preset flash memory type can store the target data.

[0048] Specifically, it can be determined whether the storage region corresponding to the remaining capacity of the target storage chip can store the target data after being switched to the preset flash memory type. If it can, the target capacity is 0 at this time. If the storage region corresponding to the remaining capacity of the target storage chip cannot store the target data after being switched to the preset flash memory type, it is determined how much storage capacity of the preset flash memory type is needed, and then the target capacity that needs to be released is converted. For example, 1G of SLC type storage region needs to be added, and the current flash memory type is TLC, so it can be determined that the target capacity to be released is 3G of TLC type storage region.

[0049] Step S22: determining whether the capacity of the storage region corresponding to the remaining capacity of the target storage chip after being switched to the preset flash memory type can store the target data.

[0050] After the target capacity is released, due to the calculation error or the size change of the target data, the remaining capacity of the target storage chip may not be able to store the target data after the flash memory type of the storage area corresponding to the remaining capacity is switched to the preset flash memory type. Therefore, whether the current remaining capacity is sufficient can be further determined by judging whether the remaining capacity of the target storage chip can store the target data after the flash memory type of the storage area corresponding to the remaining capacity is switched to the preset flash memory type.

[0051] If the remaining capacity of the target storage chip can store the target data after the flash memory type of the storage area corresponding to the remaining capacity is switched to the preset flash memory type, step S23 is executed, and if the remaining capacity of the target storage chip cannot store the target data after the flash memory type of the storage area corresponding to the remaining capacity is switched to the preset flash memory type, step S21 can be re-executed to inform the user of the target capacity that needs to be released at present.

[0052] Step S23: Switching the current flash memory type of the storage area of the target storage chip to the preset flash memory type based on the first target command.

[0053] For detailed description of this step, please refer to the above step S131.

[0054] Therefore, by determining the target capacity that needs to be released, the storage area on the target storage chip can be switched to the preset flash memory type, and the storage area corresponding to the preset flash memory type can store the target data after the switching, so as to realize the migration of the target data to the storage area corresponding to the preset flash memory type.

[0055] In an embodiment, the target command further includes a fourth target command, and the target character of the fourth target command is a factory reset character. In this embodiment, before the above step of "switching the current flash memory type of the storage area of the target storage chip to the preset flash memory type based on the first target command", the step of "performing a factory reset operation on the target storage chip based on the received fourth target command" can also be executed. The factory reset is to delete all the data of the user and only keep the data that the target storage chip comes with when it is shipped. At this time, the data that the target storage chip comes with when it is shipped is the target data. After performing the factory reset operation on the target storage chip, the step of "switching the current flash memory type of the storage area of the target storage chip to the preset flash memory type based on the first target command" and the subsequent steps can be continued. Therefore, by performing the factory reset operation on the target storage chip, the storage area on the target storage chip can be switched to the preset flash memory type, and the storage area corresponding to the preset flash memory type can store the target data after the switching.

[0056] For detailed description of this step, please refer to the above step S131. Figure 4 , Figure 4is a flowchart of a third embodiment of the control method of the storage chip. In this embodiment, after the step of "storing the target data stored in the storage area corresponding to the current flash memory type in the storage area corresponding to the preset flash memory type", the steps S31 and S32 can also be executed.

[0057] Step S31: determining the mapping relationship between the logical address of the target data and the first physical address of the storage area of the current flash memory type in which the target data is stored.

[0058] It can be understood that the target data in the target storage chip will be assigned a logical address, and the target data stored in the storage area of the current flash memory type of the target storage chip will be assigned a physical address, which is the first physical address, and the logical address and the first physical address have a mapping relationship.

[0059] In this application, because the target data is migrated within the target storage chip, the mapping relationship between the logical address of the target data and the first physical address can be determined in advance, which facilitates subsequent modification of the mapping relationship.

[0060] Step S32: replacing the first physical address in the mapping relationship with the second physical address of the storage area corresponding to the preset flash memory type in which the target data is stored, to establish a new mapping relationship.

[0061] Because the target data is migrated within the target storage chip, the physical address of the target data changes, so the first physical address in the mapping relationship mentioned in step S31 is replaced with the second physical address of the storage area corresponding to the preset flash memory type in which the target data is stored, to establish a new mapping relationship. By establishing the new mapping relationship, the target storage chip does not need to perform system update operations when reading data, thereby simplifying the operation.

[0062] In one embodiment, the target commands further include a fifth target command and a sixth target command, the target character in the fifth target command is a data migration pause character, and the target character in the sixth target command is a data migration cancel character. Specifically, after the step of "storing the target data stored in the storage area corresponding to the current flash memory type in the storage area corresponding to the preset flash memory type based on the second target command", the following steps S41 and S42 can also be executed.

[0063] Step S41: based on the fifth target command, pausing the execution of storing the target data stored in the storage area corresponding to the current flash memory type in the storage area corresponding to the preset flash memory type.

[0064] It can be understood that the user may need to suspend the data migration process for his own reasons or other reasons, and therefore the execution subject of the control method of the storage chip can suspend the execution of storing the target data stored in the storage area corresponding to the current flash type in the storage area corresponding to the preset flash type based on the fifth target command.

[0065] Step S42: based on the sixth target command, stop executing the step of storing the target data stored in the storage area corresponding to the current flash type in the storage area corresponding to the preset flash type.

[0066] It can be understood that the user may need to stop the data migration process for his own reasons or other reasons, and therefore the execution subject of the control method of the storage chip can stop the execution of storing the target data stored in the storage area corresponding to the current flash type in the storage area corresponding to the preset flash type based on the sixth target command.

[0067] Thereafter, the user can also be prompted whether to switch the storage area that has been switched to the preset flash type back to the current flash type.

[0068] Therefore, by using the fifth target command and the sixth target command, the step of suspending or stopping the execution of storing the target data stored in the storage area corresponding to the current flash type in the storage area corresponding to the preset flash type can be realized.

[0069] In one embodiment, the target command further includes a seventh target command, and the target character in the seventh target command is a state query character. Specifically, the "based on the target command, executing the preset operation corresponding to the target command" mentioned in the above steps can be "based on the seventh target command, determining the current state of the target storage chip".

[0070] In one implementation scenario, if the target data stored in the storage area corresponding to the current flash type is currently being stored in the storage area corresponding to the preset flash type, it can be determined that the current state is in data migration.

[0071] In one implementation scenario, if the execution of storing the target data stored in the storage area corresponding to the current flash type in the storage area corresponding to the preset flash type is currently suspended, it can be determined that the current state is in suspended data migration.

[0072] In one implementation scenario, if the execution of storing the target data stored in the storage area corresponding to the current flash type in the storage area corresponding to the preset flash type has been stopped, it can be determined that the current state is that the data migration has been cancelled.

[0073] Therefore, by using the seventh target command, the process of data migration can be queried.

[0074] Referring to Figure 5 , Figure 5 is a schematic diagram of the framework of an embodiment of the electronic device. The electronic device 50 includes a memory 51 and a processor 52 coupled to each other. The processor 52 is configured to execute program instructions stored in the memory 51 to implement the steps of any of the embodiments of the control method of the storage chip. In a specific implementation scenario, the electronic device 50 can include but is not limited to a microcomputer, a server, and in addition, the electronic device 50 can also include a notebook computer, a tablet computer, and the like, without limitation. In this embodiment, the memory 51 can be a target storage chip, or a memory other than the target storage chip.

[0075] Specifically, the processor 52 is configured to control itself and the memory 51 to implement the steps of any of the embodiments of the control method of the storage chip. The processor 52 can also be referred to as a CPU (Central Processing Unit). The processor 52 can be an integrated circuit chip with signal processing capability. The processor 52 can also be a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field-Programmable Gate Array), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor or the like. In addition, the processor 52 can be implemented by an integrated circuit chip together.

[0076] Referring to Figure 6 , Figure 6 is a schematic diagram of the framework of an embodiment of the computer-readable storage medium. The computer-readable storage medium 60 stores program instructions 61 executable by a processor, the program instructions 61 being configured to implement the steps of any of the embodiments of the control method of the storage chip.

[0077] The above scheme, after receiving a target command related to a communication protocol applied by a target storage chip, determines a target character in the target command corresponding to the target storage chip itself, and performs a preset operation corresponding to the target character on the target storage chip. In this way, the target storage chip can be operated based on the interaction mode of the communication protocol in combination with the target character corresponding to the target storage chip itself, thereby expanding the operability of the target storage chip.

[0078] In some embodiments, the apparatus provided by the embodiments of the present disclosure has functions or includes modules that can be used to perform the methods described in the above method embodiments, and the specific implementation can refer to the description of the above method embodiments. For brevity, it will not be repeated here.

[0079] The above description of various embodiments tends to emphasize the differences between various embodiments, and the same or similar parts can be referred to each other. For brevity, it will not be repeated here.

[0080] In several embodiments provided in the present application, it should be understood that the disclosed methods and apparatuses can be implemented in other ways. For example, the above-described apparatus implementation is only schematic, for example, the division of modules or units is only a logical function division, and actual implementation can have another division manner, for example, a unit or component can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the shown or discussed each other can be indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other form.

[0081] The unit described as a separate component can or can not be physically separated, and the component shown as a unit can or can not be a physical unit, that is, it can be located in one place, or it can be distributed to network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the present embodiment scheme.

[0082] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or in the form of a software functional unit.

[0083] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in other words, the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods of the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

Claims

1. A control method of a memory chip, characterized by, The method comprises: determining a communication protocol applied by a target storage chip; determining a target character corresponding to the target storage chip in a target command received in relation to the communication protocol; wherein the target command comprises a first target command, a second target command and a third target command, the target character in the first target command is a flash type switching character, the target character in the second target command is a data migration character, and the target character in the third target command is a target capacity character; performing a preset operation corresponding to the target character on the target storage chip; wherein performing the preset operation corresponding to the target character on the target storage chip comprises: determining a target capacity that needs to be released in the target storage chip based on the target capacity character in the third target command; determining whether the capacity of a storage area corresponding to the remaining capacity of the target storage chip after the flash type switching of the storage area is switched to a preset flash type can store the target data; if yes, switching the current flash type of the storage area of the target storage chip to the preset flash type based on the flash type switching character in the first target command; storing the target data stored in the storage area corresponding to the current flash type in the storage area corresponding to the preset flash type based on the data migration character in the second target command.

2. The method of claim 1, wherein, The target command further comprises a fourth target command, and the target character of the fourth target command is a factory reset character; before the current flash type of the storage area of the target storage chip is switched to the preset flash type based on the first target command, the method further comprises performing a factory reset operation on the target storage chip based on the received fourth target command.

3. The method according to claim 1 or 2, characterized in that, after the target data stored in the storage area corresponding to the current flash type is stored in the storage area corresponding to the preset flash type, the method further comprises: determining a mapping relationship between a logical address of the target data and a first physical address of the storage area of the current flash type storing the target data; replacing the first physical address in the mapping relationship with a second physical address of the storage area corresponding to the preset flash type storing the target data to establish a new mapping relationship.

4. The method according to claim 1 or 2, characterized in that, The target command further comprises a fifth target command and a sixth target command, the target character in the fifth target command is a data migration pause character, and the target character in the sixth target command is a data migration cancel character; after the target data stored in the storage area corresponding to the current flash type is stored in the storage area corresponding to the preset flash type based on the data migration character in the second target command, the method further comprises: suspending the execution of storing the target data stored in the storage area corresponding to the current flash type in the storage area corresponding to the preset flash type based on the data migration pause character in the fifth target command; or, Stop performing the storing of the target data stored in the storage area corresponding to the current flash memory type in the storage area corresponding to the preset flash memory type based on the data migration cancel character in the sixth target command.

5. The method of claim 4, wherein, The target command further comprises a seventh target command, and a target character in the seventh target command is a state query character. The performing of the preset operation corresponding to the target character on the target storage chip comprises: determining a current state of the target storage chip based on the state query character in the seventh target command. If the target data stored in the storage area corresponding to the current flash memory type is currently being stored in the storage area corresponding to the preset flash memory type, the current state is determined to be in data migration; if the storing of the target data stored in the storage area corresponding to the current flash memory type in the storage area corresponding to the preset flash memory type is currently being paused, the current state is determined to be in paused data migration; and if the storing of the target data stored in the storage area corresponding to the current flash memory type in the storage area corresponding to the preset flash memory type has been stopped, the current state is determined to be in data migration canceled.

6. The method of claim 1, wherein, The target command further comprises verification information, and the method further comprises: After receiving each target command, verifying whether the verification information of the target command is preset verification information to perform handshake authentication by using the verification information. If the verification information is the preset verification information, it is confirmed that the handshake authentication is successful, and the preset operation corresponding to the target character is performed on the target storage chip.

7. An electronic device, comprising: The processor and the memory are coupled to each other, wherein, The processor is configured to execute the computer program stored in the memory to perform the method in any one of claims 1 to 6.

8. A computer-readable storage medium, characterized in that, The computer program capable of being run by the processor is stored, and the computer program is used to implement the method in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Memory device and its operation method

    CN101089830A

  • Data storage method and device and memory

    CN110413224A