Storage control method, chip, electronic equipment and storage medium
By setting multiple preset areas on the rewritable memory and using data and characteristic value matching to set permissions, the coexistence of multiple storage methods is achieved, which solves the problem of high cost of coexistence of multiple memory types in the existing technology and reduces the cost. and improved accuracy.
Patent Information
- Application Number
- CN202310222946.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-09
- Publication Date
- 2024-09-17
AI Technical Summary
In the existing technology, the cost of coexistence of multiple memory types on one chip is high, and it is difficult to effectively implement permission management, resulting in increased complexity of storage functions.
By setting multiple preset areas on the rewritable memory, and using data and characteristic value matching to set erasure permissions and write permissions, the coexistence of multiple storage methods is achieved, including permission management that prohibits erasure and allows writing.
It reduces the implementation cost, improves the accuracy, and enables the coexistence of multiple storage methods without changing the existing memory manufacturing process. It has the advantages of low production cost and high accuracy.
Smart Images

Figure CN118656016A
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic circuit technology, and in particular to a storage control method, a chip, an electronic device and a storage medium. Background Art
[0002] With the popularization of electronic products, more and more requirements are placed on the storage functions of memories. Common memory types include: FLASH (Flash Memory), MTP (Multiple-Time Programmable Memory), OTP (One-Time Programmable Memory), Efuse (Electronic Fuse Memory), etc. In current applications, more and more scenarios require multiple memory types to coexist on one chip. Currently, multiple storage methods are implemented on one chip through processing technology, which is costly. Summary of the invention
[0003] The present application provides a storage control method, chip, electronic device and storage medium, the main purpose of which is to implement multiple storage methods on a memory at the same time through permission management to reduce implementation costs.
[0004] In a first aspect, an embodiment of the present application provides a storage control method, including:
[0005] Acquire first data stored in a first preset area of a memory;
[0006] When the first data matches a preset characteristic value, setting the erasure permission of the second preset area of the memory to prohibit erasure;
[0007] Wherein, the memory is an erasable memory.
[0008] Furthermore, after setting the erasure permission of the second preset area of the memory to prohibit erasure, the method further includes:
[0009] receiving an access request, and when the address to be accessed corresponding to the access request is located in the second preset area, acquiring second data stored in the address to be accessed;
[0010] The write permission of the address to be accessed is set according to the second data and the preset initial value.
[0011] Further, the step of setting the write permission of the address to be accessed according to the second data and the preset initial value includes:
[0012] If the second data matches the preset initial value, the write permission of the address to be accessed is set to allow writing; otherwise, the write permission of the address to be accessed is set to prohibit writing.
[0013] Furthermore, the second preset area includes at least one sub-area, each of the sub-areas has a corresponding flag bit, and the flag bit is used to indicate whether the corresponding sub-area has been written;
[0014] In setting the erasure permission of the second preset area of the memory to prohibit erasure, the method further includes:
[0015] receiving an access request, and when the address to be visited corresponding to the access request is located in the second preset area, determining a target sub-area to which the address to be visited belongs;
[0016] The write permission of the address to be accessed is set according to the flag bit corresponding to the target sub-region.
[0017] Furthermore, the step of setting the write permission of the address to be accessed according to the flag bit corresponding to the target sub-region includes:
[0018] When the flag bit corresponding to the target sub-region indicates that the target sub-region has been written, the write permission of the target sub-region is set to prohibit writing.
[0019] Furthermore, the method further comprises:
[0020] When the first data matches the preset characteristic value, the erasure permission of the first preset area is set to prohibit erasure.
[0021] Furthermore, the memory further includes a third preset area in addition to the first preset area and the second preset area.
[0022] Furthermore, before obtaining the first data stored in the first preset area on the memory, the method further includes:
[0023] The preset characteristic value is written into the first preset area.
[0024] In a second aspect, an embodiment of the present application provides a chip, including a memory and a storage controller, wherein the memory is an erasable memory, and the storage controller is configured as follows:
[0025] An acquisition module, used for acquiring first data stored in a first preset area on a memory;
[0026] The management module is used to set the erasure permission of the second preset area of the memory to prohibit erasure when the first data matches the preset characteristic value.
[0027] In a third aspect, an embodiment of the present application provides an electronic device, comprising a chip provided in the second aspect.
[0028] In a fourth aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a storage control method provided in the first aspect are implemented.
[0029] The present application proposes a storage control method, chip, electronic device and storage medium, which first obtains the first data stored in the first preset area, and sets the erasure permission of the second preset area on the memory to prohibit erasure when the first data matches the preset characteristic value, thereby changing the erasure permission of the second preset area on the memory, and realizing another storage method on the second preset area. This embodiment does not need to change the existing memory manufacturing process, but can be realized by simple data setting, and has the advantages of low production cost and high accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 A schematic diagram of an application scenario of a storage control method provided in an embodiment of the present application;
[0031] Figure 2 A flowchart of a storage control method provided in an embodiment of the present application;
[0032] Figure 3 A flow chart of a storage permission setting method provided in one embodiment of the present application;
[0033] Figure 4 A flow chart of a storage permission setting method provided in another embodiment of the present application;
[0034] Figure 5 A flowchart of a storage control method provided in yet another embodiment of the present application;
[0035] Figure 6 A schematic diagram of the structure of a chip provided in an embodiment of the present application;
[0036] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0037] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0038] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be understood as limiting the present application.
[0039] In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.
[0040] In the embodiments of the present application, at least one refers to one or more; multiple refers to two or more. In the description of the present application, words such as "first", "second", "third", etc. are only used to distinguish the purpose of description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying order. In addition, the terms "first" and "second" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0041] References to "one embodiment" or "some embodiments" etc. described in this specification mean that one or more embodiments of the present application include a particular feature, structure or characteristic described in conjunction with the embodiment. Thus, in this specification, the terms "include", "comprises", "has" and their variations all mean "including but not limited to", unless otherwise specifically emphasized.
[0042] Figure 1 A schematic diagram of an application scenario of a storage control method provided in an embodiment of the present application, such as Figure 1As shown, the execution subject of the embodiment of the present application is a storage controller, and the execution object of the storage control method is an erasable memory. First, the storage controller obtains the first data stored in the first preset area on the memory. When the first data matches the preset characteristic value, it indicates that other types of storage methods need to be implemented on the erasable memory, and the erase permission of the second preset area of the erasable memory is set to prohibit erasure. In this way, data can only be written once in the second preset area of the erasable memory, thereby changing the storage method of the second preset area of the erasable memory, thereby implementing other types of storage methods on the erasable memory. Compared with the memory of other storage methods manufactured by process in the prior art, it has the advantage of low cost.
[0043] As an implementation method, the storage controller and the memory can be integrated in the same chip. The chip can be an analog chip, a digital chip or a hybrid chip; it can be an AFE (Analog Front End) chip, an MCU (Microcontroller Unit) or a SOC (System on Chip).
[0044] In the present embodiment, the memory is a multi-times erasable programmable memory, that is, the memory can be erased and programmed multiple times. The memory may be FLASH, MTP, EEPROM (Electrically Erasable Programmable Read Only Memory), etc. The specific memory may be determined based on actual conditions, and the present application embodiment does not make any specific limitation on this.
[0045] In the embodiment of the present application, the memory includes at least a first preset area and a second preset area, wherein the first preset area is used to store permission configuration data of the second preset area, and the erase permission of the second preset area can be disabled as needed, so as to realize the function of a one-time programmable memory.
[0046] In some embodiments, the memory may further include a third preset area, which may be another storage area in the memory except the first preset area and the second preset area, and is used to implement a multi-time erasable and programmable storage function.
[0047] The following combination Figure 2-7 The storage control method of the embodiment of the present application is introduced.
[0048] Figure 2 A flowchart of a storage control method provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the method includes:
[0049] S110, acquiring first data stored in a first preset area of a memory;
[0050] Optionally, when receiving a data access request to the first preset area or the second preset area, the storage controller may perform a read operation on a corresponding address of the first preset area on the memory to obtain the first data.
[0051] In this embodiment, the first preset area on the memory refers to an area consisting of some addresses on the memory as the first preset area. The first preset area is not divided on the memory entity, but the selected part of the addresses is set as the first preset area through program setting. Obtaining the first data stored in the first preset area refers to obtaining the data stored in certain addresses contained in the first preset area, and the data stored in the address is used as the first data. It is easy to understand that all the addresses contained in the first preset area can be continuous or discontinuous, which can be determined according to the actual situation, and this embodiment does not make specific limitations on this.
[0052] S120: When the first data matches a preset characteristic value, setting the erasure permission of the second preset area of the memory to prohibit erasure.
[0053] In this embodiment, the erasure permission of the second preset area is determined based on the first data stored in the first preset area. When the first data matches the preset characteristic value, the storage controller sets the erasure permission of the second preset area to prohibit erasure. When the erasure permission of the second preset area is set to prohibit erasure, the data in any storage address of the second preset area will be prohibited from being erased. At this time, when the storage controller writes data to the address in the second preset area once, the data stored in the second preset area cannot be changed because it cannot be erased.
[0054] It should be noted that setting the erasure permission of the second preset area of the memory to prohibit erasure means setting the erasure permission of each storage address in the second preset area to prohibit erasure.
[0055] When the first data and the preset characteristic value do not match, it means that there is no need to implement other types of storage methods on the memory, and the erase permission of the second preset area can be set to allow erasure. After the storage controller sets the erase permission of the second preset area to allow erasure, an erase operation is performed before each data is written to the second preset area. The storage controller can perform multiple write operations on each address in the second preset area.
[0056] It should be noted that the matching of the first data and the preset characteristic value can be that the first data and the preset characteristic value are equal, or there can be a specific functional relationship between the first data and the preset characteristic value, and the first data is equal to the preset characteristic value after conversion by a preset formula. For example, the first data is equal to a preset multiple of the preset characteristic value, the first data is equal to the sum of the squares of the preset characteristic value, and the first data is equal to the preset characteristic value after being operated by an encryption algorithm. The specific method can be determined based on actual conditions, and this embodiment does not make any specific limitation on this.
[0057] In this embodiment, the second preset area on the memory refers to an area composed of some addresses on the memory as the second preset area. The second preset area is not physically divided on the memory, but the selected part of the addresses is set as the second preset area through program setting. Managing the erase permission of the second preset area on the memory refers to managing the erase permission of all addresses contained in the second preset area. It is easy to understand that the addresses contained in the second preset area can be continuous or discontinuous, which can be determined according to actual conditions, and this application does not make specific limitations on this.
[0058] It can be understood that the division of the first preset area and the second preset area can be set by a program, and the first preset area and the second preset area can be independent and different areas in the memory; the first preset area can also be a part of the second preset area, and this embodiment does not make specific limitations on this.
[0059] This embodiment manages the erasure permission of the second preset area on the memory, and when the first data matches the preset characteristic value, sets the erasure permission of the second preset area on the memory to prohibit erasure, while the erasure permission of other areas on the memory remains unchanged. In this way, the second preset area is used to implement the function of a one-time programmable memory, that is, the function of an OTP or Efuse memory is implemented in the second preset area, and other areas of the memory are used to implement the function of a multi-time programmable memory, that is, the function of FLASH, MTP, and EEPROM is implemented in other areas.
[0060] This embodiment provides a storage control method, first obtaining the first data stored in the first preset area, and when the first data matches the preset characteristic value, setting the erasure permission of the second preset area on the memory to prohibit erasure, thereby changing the erasure permission of the second preset area on the memory, and realizing another storage method on the second preset area. This embodiment does not need to change the existing memory manufacturing process, and can be realized only by simple data setting, and has the advantages of low production cost and high accuracy.
[0061] In some embodiments, the memory has a specific preset initial value before data is written to the memory for the first time, so the preset initial value can be used to determine whether it is the first time to write data to the address to be accessed. Figure 3 A flow chart of a storage permission setting method provided in an embodiment of the present application, which can be applied to a memory with a specific initial value, such as a FLASH memory, an MTP memory or other memory whose initial value can be determined.
[0062] like Figure 3 As shown, in the storage control method, after setting the erasure permission of the second preset area of the memory to prohibit erasure, the method further includes:
[0063] S130, receiving an access request, and when the address to be accessed corresponding to the access request is located in the second preset area, acquiring second data stored in the address to be accessed;
[0064] When the erase permission of the second preset area is to prohibit erase, data can only be written once to each address in the second preset area. When an address in the second preset area needs to be accessed, it is necessary to determine whether it is the first write operation to the address, and set the write permission of the second preset area in the memory according to the determination result. If it is the first time to write data, the write permission of the address is to allow writing. If it is not the first time to write data, the write permission of the address is to prohibit writing.
[0065] Specifically, after receiving the access request, the storage controller extracts the address to be accessed in the access request, obtains the second data stored in the address to be accessed if the address to be accessed is located in the second preset area, and determines whether to write data to the address to be accessed for the first time based on the second data.
[0066] S140: Setting the write permission of the address to be accessed according to the second data and a preset initial value.
[0067] In this embodiment, the memory has a specific preset initial value before the first writing, so after the erasing permission of the second preset area is prohibited, the data in each storage address of the second preset area can be used to determine whether the storage address has been written with data. In other words, for the address to be accessed in the second preset area, the write permission of the address to be accessed can be set according to the relationship between the data stored in the address to be accessed and the preset initial value.
[0068] In this embodiment, the preset initial value is the default initial value of the memory, that is, the initial value of the memory when no data is written to the memory. In this embodiment, it can be determined whether the address to be accessed has been written with data based on whether the second data of the address to be accessed is the preset initial value. If the address to be accessed has been written with data, then data cannot be written to the address to be accessed; if the address to be accessed has not been written with data, then data can be written to the address to be accessed.
[0069] It should be noted that the specific value of the preset initial value can be determined according to the actual situation of the memory, and the embodiment of the present invention does not make any specific limitation on this.
[0070] As an example, in step S140, setting the write permission of the address to be accessed according to the second data and the preset initial value includes:
[0071] If the second data matches the preset initial value, the write permission of the address to be accessed is set to allow writing; otherwise, the write permission of the address to be accessed is set to prohibit writing.
[0072] In this embodiment, if the second data matches the preset initial value, it means that the data stored in the address to be accessed is the initial value, that is, the address to be accessed is the first time to write data, so the write permission of the address to be accessed is set to allow writing. After the write permission of the address to be accessed is set to allow writing, if the storage controller receives target data that needs to be written to the address to be accessed, the target data is written to the address to be accessed. On the contrary, if the second data does not match the preset initial value, it means that the data stored in the address to be accessed is not the initial value, that is, the address to be accessed has been subjected to a write data operation. Since the erase permission of the address to be accessed is disabled, the data in the address to be accessed cannot be erased, and therefore, the write data operation cannot be performed on the address to be accessed, and the write permission of the address to be accessed is set to a prohibited state.
[0073] In this embodiment, the matching of the second data and the preset initial value can be that the second data and the preset initial value are equal, or there can be a specific functional relationship between the second data and the preset initial value, and the second data is equal to the preset initial value after conversion by a preset formula. For example, the second data is equal to a preset multiple of the preset initial value, the second data is equal to the sum of the squares of the preset initial value, and the second data is equal to the preset initial value after being operated by an encryption algorithm. The specific method can be determined based on actual conditions, and this embodiment does not make any specific limitation on this.
[0074] This embodiment determines whether data has been written to the address to be accessed based on the relationship between the second data and the preset initial value, and sets the write permission of the address to be accessed based on this, which is simple and convenient and has a high accuracy rate.
[0075] In other implementations, each storage address of the memory does not have a fixed initial value, and it is impossible to use the preset initial value to determine whether data has been written. In this case, a flag bit can be used to record the writing status of the storage area. Figure 4 This is a flow chart of a storage permission setting method provided in another embodiment of the present application. This embodiment can be applied to a memory with an unfixed initial value, such as an EEPROM memory.
[0076] like Figure 4 As shown, the second preset area includes at least one sub-area, each of the sub-areas has a corresponding flag bit, and the flag bit is used to indicate whether the corresponding sub-area has been written; in setting the erasure permission of the second preset area of the memory to prohibit erasure, the method also includes:
[0077] S131, receiving an access request, and when the address to be visited corresponding to the access request is located in the second preset area, determining a target sub-area to which the address to be visited belongs;
[0078] In the case where the erase permission of the second preset area is set to prohibit erasure, that is, each address in the second preset area can only write data once, when it is necessary to access an address in the second preset area, it is necessary to determine whether it is the first write operation to the address, and set the write permission of the second preset area in the memory according to the judgment result. If it is the first time to write data, then the write permission of the address is to allow writing; if it is not the first time to write data, then the write permission of the address is to prohibit writing.
[0079] When the memory does not have a fixed initial value, it is impossible to determine whether the address to be accessed has been written with data based on the data stored in the address to be accessed. In this embodiment, the second preset area is divided into multiple sub-areas, and a flag is configured for each sub-area, and the flag is used to determine whether the corresponding sub-area has been written with data. Optionally, the number of sub-areas can be one, that is, all addresses in the second preset area belong to one sub-area and share one flag; the number of sub-areas can be multiple, that is, the second preset area is divided into multiple sub-areas, and each sub-area can include one or more storage addresses.
[0080] Optionally, a continuous address in the second preset area can be used as a sub-area, or a plurality of discontinuous addresses in the second preset area can be used as a sub-area. The configuration can be made according to the requirements, and this embodiment does not make any specific limitation to this.
[0081] Specifically, after receiving an access request, the storage controller extracts the address to be accessed in the access request, and when the address to be accessed is located in the second preset area, further determines the target sub-area to which the address to be accessed belongs and obtains a flag bit corresponding to the target sub-area.
[0082] S141, setting the write permission of the address to be accessed according to the flag bit corresponding to the target sub-region.
[0083] Among them, if the flag bit of the target sub-region indicates that data has been written to the address to be accessed, then the write permission of the address to be accessed is set to prohibit writing; if the standard bit of the target sub-region indicates that data has not been written to the address to be accessed, then the write permission of the address to be accessed is set to allow writing.
[0084] When the memory does not have a fixed initial value, in this embodiment, the memory is divided into multiple sub-areas and a flag is configured for each sub-area. The flag is used to determine whether the address to be accessed has data written, thereby accurately controlling the write permission of each sub-area.
[0085] As an example, setting the write permission of the address to be accessed according to the flag bit corresponding to the target sub-region includes:
[0086] When the flag bit corresponding to the target sub-region indicates that the target sub-region has been written, the write permission of the target sub-region is set to prohibit writing. Specifically, the flag bit corresponding to the target sub-region can be matched with a preset flag bit representing writing. If the flag bit corresponding to the target sub-region matches the preset flag bit, it means that the target sub-region has been written, and the write permission of the target sub-region is set to prohibit writing; if the flag bit corresponding to the target sub-region does not match the preset flag bit, it means that data has not been written to the target sub-region, and the write permission of the target sub-region is set to allow writing.
[0087] In some embodiments, the method further comprises:
[0088] When the first data matches the preset characteristic value, the erasure permission of the first preset area is set to prohibit erasure.
[0089] In this embodiment, since the authority of the second preset area depends on the data stored in the first preset area, when the characteristic value has been written into the first preset area, the second preset area is set as an area that allows only one write. After the data is written into the second preset area, in order to avoid the data in the second preset area from being overwritten, the erase authority of the second preset area is maintained unchanged and maintained as the prohibition of erase authority. Therefore, after the characteristic value has been written into the first preset area, the erase authority of the first preset area is set to prohibition of erase, so as to avoid the data in the first preset area from being overwritten to other values, thereby avoiding affecting the erase authority of the second preset area, and effectively keeping the data in the second preset area from being overwritten.
[0090] As an implementation manner, when the first data does not match the preset characteristic value, the erasure permission of the first preset area is set to allow erasure.
[0091] In a specific implementation, if the first data and the preset characteristic value do not match, it means that there is no need to set an area on the memory that only allows one write. At this time, the erase permission of the first preset area is set to allow erasure, so that when it is necessary to set an area on the memory that only allows one write, the original data in the first preset area can be erased and the preset characteristic value can be written to the first preset area.
[0092] In some embodiments, the memory further includes a third preset area in addition to the first preset area and the second preset area.
[0093] In this embodiment, the memory further includes a third preset area, which is independent of and does not overlap with the first preset area and the second preset area. It can be seen that, through the relationship between the first data and the preset characteristic value, when the first value and the preset characteristic value match, the erasure permission of the second preset area is set to prohibit erasure, while the erasure permission of the third preset area remains unchanged, which is to allow erasure, so that there are two areas with different erasure permissions on the memory, that is, two types of storage functions can be realized on the memory.
[0094] In some embodiments, before acquiring the first data stored in the first preset area on the memory, the method further includes:
[0095] The preset characteristic value is written into the first preset area.
[0096] Specifically, before the storage controller reads the first data stored in the first preset area on the memory, the storage controller writes a preset characteristic value to the first preset area of the memory to facilitate management of subsequent erase permissions of the memory.
[0097] Figure 5 A flowchart of a storage control method provided in another embodiment of the present application is as follows: Figure 5 As shown, in this embodiment, the memory is FLASH, and the storage function of Efuse is implemented on the second preset area of the FLASH memory by managing the erase and write permissions of the second preset area of the memory.
[0098] Specifically, the addresses contained in the first preset area and the second preset area of the FLASH memory are pre-set in the storage controller. The storage controller first reads the first data stored in the preset address in the first preset area, and then compares the first data with the preset characteristic value. If the first data and the preset characteristic value are not equal, the erase permission of the second preset area remains to allow erasure, so that the erase permission of the FLASH memory remains unchanged, and multiple erasable storage can be implemented for the FLASH memory, that is, the original function of the FLASH remains unchanged.
[0099] If the first data is equal to the preset characteristic value, the erase permission of the second preset area is set to prohibit erasure. After the erase permission of the second preset area is set to prohibit erasure, if data is to be written to the address to be accessed in the second preset area, first determine whether data has been written to the address to be accessed.
[0100] The specific judgment method is to compare the second data stored in the address to be accessed with the preset initial value. If the second data is equal to the preset initial value, it means that data has not been written to the address to be accessed, and data can still be written to the address to be accessed, and the write permission of the address to be accessed is set to allow writing; if the second data is not equal to the preset initial value, it means that data has been written to the address to be accessed, and writing data to the address to be accessed is prohibited, and the write permission of the address to be accessed is set to prohibit writing.
[0101] When the erasure permission of the second preset area is set to prohibit erasure, data can be written only once in the second preset area, that is, the second preset area can realize the storage function of Efuse.
[0102] In summary, in this embodiment, the erase permission of the second preset area on FLASH is determined by the first data and the preset characteristic value. When the first data and the preset characteristic value are the same, the erase permission of the second preset area is set to prohibit erasure, which is equivalent to realizing the Efuse function on the second preset area, that is, realizing the Efuse function in the second preset area on FLASH without changing the existing processing technology, with low production cost and high accuracy; then the second data stored in the address to be accessed in the second preset area is compared with the preset initial value to determine whether the address to be accessed has been written with data. If not, the write permission of the address to be accessed is set to allow writing, indicating that data can still be written. If it has been written, the write permission of the address to be accessed is set to prohibit writing, indicating that data can no longer be written.
[0103] Figure 6 A schematic diagram of the structure of a chip provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the chip 600 includes a memory and a storage controller, the memory is an erasable memory, and the storage controller is configured to execute the storage control method as described in any of the above embodiments.
[0104] This embodiment is a chip embodiment corresponding to the above method, and its specific implementation process is the same as that of the above method embodiment. For details, please refer to the above method embodiment, and this chip embodiment will not repeat it any more.
[0105] Figure 7 A schematic diagram of the structure of an electronic device 700 provided in an embodiment of the present application is shown in FIG. Figure 7 As shown, the electronic device 700 includes the above chip 600. The electronic device 700 can be, but is not limited to, a weight scale, a body fat scale, a nutrition scale, an infrared electronic thermometer, a pulse oximeter, a human body composition analyzer, a mobile power supply, a wireless charger, a fast charger, a car charger, an adapter, a display, a USB (Universal Serial Bus) docking station, a stylus, a true wireless headset, a car central control screen, a car, a smart wearable device, a mobile terminal, and a smart home device. Smart wearable devices include, but are not limited to, smart watches, smart bracelets, and cervical massagers. Mobile terminals include, but are not limited to, smart phones, laptops, tablet computers, and POS (point of sales terminal). Smart home devices include, but are not limited to, smart sockets, smart rice cookers, smart sweepers, and smart lights.
[0106] In one embodiment, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the storage control method in the above embodiment are implemented. Alternatively, when the computer program is executed by a processor, the functions of each module / unit in the above memory management system embodiment are implemented.
[0107] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0108] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0109] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A storage control method, characterized in that: include: Acquire first data stored in a first preset area of a memory; When the first data matches a preset characteristic value, setting the erasure permission of the second preset area of the memory to prohibit erasure; Wherein, the memory is an erasable memory.
2. The storage control method according to claim 1, characterized in that: After setting the erasure permission of the second preset area of the memory to prohibit erasure, the method further includes: receiving an access request, and when the address to be accessed corresponding to the access request is located in the second preset area, acquiring second data stored in the address to be accessed; The write permission of the address to be accessed is set according to the second data and the preset initial value.
3. The storage control method according to claim 2, characterized in that: The step of setting the write permission of the address to be accessed according to the second data and the preset initial value includes: If the second data matches the preset initial value, the write permission of the address to be accessed is set to allow writing; otherwise, the write permission of the address to be accessed is set to prohibit writing.
4. The storage control method according to claim 2, characterized in that: The second preset area includes at least one sub-area, each of the sub-areas has a corresponding flag bit, and the flag bit is used to indicate whether the corresponding sub-area has been written; In setting the erasure permission of the second preset area of the memory to prohibit erasure, the method further includes: receiving an access request, and when the address to be visited corresponding to the access request is located in the second preset area, determining a target sub-area to which the address to be visited belongs; The write permission of the address to be accessed is set according to the flag bit corresponding to the target sub-region.
5. The storage control method according to claim 4, characterized in that: The step of setting the write permission of the address to be accessed according to the flag bit corresponding to the target sub-region includes: When the flag bit corresponding to the target sub-region indicates that the target sub-region has been written, the write permission of the target sub-region is set to prohibit writing.
6. The storage control method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the first data matches the preset characteristic value, the erasure permission of the first preset area is set to prohibit erasure.
7. The storage control method according to any one of claims 1 to 5, characterized in that: The memory further includes a third preset area in addition to the first preset area and the second preset area.
8. The storage control method according to any one of claims 1 to 5, characterized in that: Before acquiring the first data stored in the first preset area on the memory, the method further includes: The preset characteristic value is written into the first preset area.
9. A chip comprising a memory and a storage controller, characterized in that: The memory is a rewritable memory, and the memory controller is configured as follows: An acquisition module, used for acquiring first data stored in a first preset area on a memory; The management module is used to set the erasure permission of the second preset area of the memory to prohibit erasure when the first data matches the preset characteristic value.
10. An electronic device, characterized in that: Comprising the chip as claimed in claim 9.
11. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the storage control method according to any one of claims 1 to 8 are implemented.
