Method, device, equipment and storage medium for modifying data in memory
By combining a programmable memory and a random access memory in the processing chip, multiple modifications to the data in the programmable memory are achieved, and the problems of increasing chip area, power consumption and cost in MTP memory are solved, and the applicability of the chip is improved.
Patent Information
- Application Number
- CN202211731971.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Existing MTP memory leads to increased chip area, power consumption and cost during data storage, and has low applicability.
The processing unit in the processing chip is adopted, combining a programmable memory and a random access memory, and the data to be written by reading the target data and the address pointer, and the data and address pointer are determined based on the associated data address to be modified to realize multiple data modifications of the programmable memory.
It reduces the area and power consumption of the chip, reduces the cost, improves the applicability of the chip, and at the same time realizes multiple modifications of data in a programmable memory.
Smart Images

Figure CN115981566B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of chip structure technology, and in particular to a method, device, equipment and storage medium for modifying data in a memory. Background Art
[0002] In the process of data storage, in scenarios where multiple programming and rewriting are required, the data usually needs to be stored in a programmable memory.
[0003] In the prior art, when implementing data storage, MTP (Multiple Time Programmable) is mainly used for data storage, and during the data storage process, multiple erasing and writing can be performed.
[0004] However, the structure of MTP is usually more complicated. When using MTP for data storage, it will lead to an increase in the chip area, power consumption and cost. It may not be applicable to scenarios with specific requirements, that is, its applicability is low. Summary of the invention
[0005] The purpose of the present application is to provide a method, device, equipment and storage medium for modifying data of a memory, which can reduce the area and power consumption of a chip, reduce costs and improve the applicability of the chip.
[0006] The embodiment of the present application is implemented as follows:
[0007] In one aspect of an embodiment of the present application, a method for modifying data in a memory is provided. The method is applied to a processing unit of a processing chip. The processing chip further includes: a one-time programmable memory and a random access memory. The processing unit is connected to the one-time programmable memory and the random access memory respectively. The one-time programmable memory includes a plurality of pre-divided storage areas. The method includes:
[0008] Reading target data and an address pointer corresponding to the target data from a random access memory, where the address pointer is used to indicate a storage address of next data of the target data;
[0009] Determine the address of the data to be written in the one-time programmable memory based on the target data and the address pointer corresponding to the target data, the address of the data to be written corresponding to the position of the next storage area in the one-time programmable memory where no data is stored;
[0010] The modified data to be written into the data address and the address pointer corresponding to the modified data are determined based on the address of the associated data of the target data and the target data, wherein the associated data is the data adjacent to the target data address in the random access memory.
[0011] Optionally, determining the modified data to be written into the data address and the address pointer corresponding to the modified data based on the address of the associated data of the target data and the target data includes:
[0012] The modification data and the address pointer corresponding to the modification data are determined based on the address of the second associated data of the target data and the target data, wherein the second associated data is the data of the next adjacent address of the target data in the random access memory.
[0013] Optionally, determining the modified data and an address pointer corresponding to the modified data based on the address of the second associated data of the target data and the target data includes:
[0014] Use the target data as the modified data;
[0015] The address pointed to by the address pointer corresponding to the modified data is determined as the address of the second associated data of the target data.
[0016] Optionally, after determining the address of the data to be written in the one-time programmable memory based on the target data and the address pointer corresponding to the target data, the method further includes:
[0017] Determine the address stored in the address pointer pointing to the address of the data to be written based on the address pointer of the first associated data of the target data, the first associated data being the data of the previous adjacent address of the target data in the random access memory;
[0018] The address pointer pointing to the address of the data to be written is written into the address stored in the address pointer pointing to the address of the data to be written.
[0019] Optionally, before reading the target data, the address pointer corresponding to the target data, and the address of the data associated with the target data from the random access memory, the method further comprises:
[0020] All data in the one-time programmable memory is stored in the random access memory.
[0021] Optionally, storing all data in the one-time programmable memory into the random access memory includes:
[0022] Read the data of the first address in the one-time programmable memory and its corresponding address pointer;
[0023] Determine the next address according to the address pointer corresponding to the data of the first address, and read the data of the next address and the address pointer corresponding to the next address at the next address until all the data in the one-time programmable memory are read;
[0024] All data in the one-time programmable memory is stored in the random access memory.
[0025] Optionally, after determining the modified data to be written into the data address and the address pointer corresponding to the modified data based on the address of the associated data of the target data and the target data, the method further includes:
[0026] The data in the random access memory is modified based on the modification data and the address pointer corresponding to the modification data.
[0027] In another aspect of an embodiment of the present application, a memory data modification device is provided, the device is applied to a processing unit of a processing chip, the processing chip further includes: a one-time programmable memory and a random access memory, the processing unit is connected to the one-time programmable memory and the random access memory respectively, the one-time programmable memory includes a plurality of pre-divided storage areas, the device includes: a reading module, a determining module and a modifying module;
[0028] A reading module, used for reading target data and an address pointer corresponding to the target data from a random access memory, wherein the address pointer is used for indicating a storage address of next data of the target data;
[0029] A determination module, configured to determine an address of data to be written in a one-time programmable memory based on target data and an address pointer corresponding to the target data, wherein the address of the data to be written corresponds to a position of a next storage area in the one-time programmable memory that does not store data;
[0030] The modification module is used to determine the modification data to be written into the data address and the address pointer corresponding to the modification data based on the address of the associated data of the target data and the target data, wherein the associated data is the data adjacent to the target data address in the random access memory.
[0031] Optionally, the modification module is specifically used to determine the modification data and the address pointer corresponding to the modification data based on the address of the second associated data of the target data and the target data, and the second associated data is the data of the next adjacent address of the target data in the random access memory.
[0032] Optionally, the modification module is specifically configured to use the target data as the modification data; and determine the address pointed to by the address pointer corresponding to the modification data as the address of the second associated data of the target data.
[0033] Optionally, the modification module is also used to determine the address stored in the address pointer pointing to the address of the data to be written based on the address pointer of the first associated data of the target data, the first associated data being the data of the previous adjacent address of the target data in the random access memory; and write the address pointer pointing to the address of the data to be written in the address stored in the address pointer pointing to the address of the data to be written.
[0034] Optionally, the reading module is also used to store all data in the one-time programmable memory into the random access memory.
[0035] Optionally, the reading module is specifically used to read the data of the first address in the one-time programmable memory and its corresponding address pointer; determine the next address according to the address pointer corresponding to the data of the first address, and read the data of the next address and its corresponding address pointer at the next address until all the data in the one-time programmable memory are read; and store all the data in the one-time programmable memory in the random access memory.
[0036] Optionally, the modification module is further used to modify the data in the random access memory based on the modification data and the address pointer corresponding to the modification data.
[0037] Another aspect of an embodiment of the present application provides a computer device, including: a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the data modification method of the memory are implemented.
[0038] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for modifying data in a memory are implemented.
[0039] The beneficial effects of the embodiments of the present application include:
[0040] In a data modification method, device, equipment and storage medium of a memory provided by an embodiment of the present application, a processing chip includes: a processing unit, a one-time programmable memory and a random access memory, wherein the one-time programmable memory includes a plurality of pre-divided storage areas, and by reading target data and an address pointer corresponding to the target data from the random access memory, the address of the data to be written in the one-time programmable memory is determined based on the target data and the address pointer corresponding to the target data, and the modified data in the address of the data to be written and the address pointer corresponding to the modified data can be determined based on the address of the associated data of the target data and the target data, so that multiple modifications and writing of data in the one-time programmable memory can be realized. Since the one-time programmable memory requires less space than the multi-time programmable memory and can enter a low power consumption mode during operation, when the one-time programmable memory is used for data storage, the area power consumption of the chip can be reduced, the cost can be reduced, and the applicability of the entire chip can be improved while realizing multiple modifications of the stored data. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A schematic diagram of the structure of a processing chip provided in an embodiment of the present application;
[0043] Figure 2 A schematic diagram of the storage area division of the one-time programmable memory in the processing chip provided in an embodiment of the present application;
[0044] Figure 3 A schematic diagram of a flow chart of a method for modifying data in a memory provided in an embodiment of the present application;
[0045] Figure 4 A schematic diagram of a process for implementing data modification provided in an embodiment of the present application;
[0046] Figure 5 Another schematic diagram of a process for implementing data modification provided in an embodiment of the present application;
[0047] Figure 6 Another schematic diagram of a flow chart of a method for modifying memory data provided by an embodiment of the present application;
[0048] Figure 7 A schematic diagram of the structure of a data modification device for a memory provided in an embodiment of the present application;
[0049] Figure 8 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution 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 part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0051] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0052] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0053] In the description of the present application, it should be noted that the terms "first", "second", "third", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0054] It should be noted that the solution adopted in the prior art mainly uses MTP for data storage, during which data can be erased and written multiple times; however, it is usually not applicable to one-time programmable memory because it cannot be erased and written multiple times.
[0055] In the embodiment of the present application, multiple erasing and writing of a one-time programmable memory can be realized. On this basis, the one-time programmable memory is used to realize data modification. The specific structure of the processing chip where the processing unit applied by this method is located is explained in detail below.
[0056] Figure 1 For a schematic diagram of the structure of the processing chip provided in the embodiment of the present application, please refer to Figure 1 The processing chip includes: a processing unit 110, a one-time programmable memory 120 and a random access memory 140, and the processing unit 110 is connected to the one-time programmable memory 120 and the random access memory 140 respectively.
[0057] The processing unit 110 may be a module on a chip with processing functions, such as a digital logic module or other types of modules that can implement signal transmission and processing, and no specific limitation is made herein.
[0058] The one-time programmable memory 120 may be an OTP (One Time Programmable) memory. After the program is burned into the microcontroller, it cannot be modified or cleared again.
[0059] The random access memory 140 may be, for example, a SRAM (Static Random-Access Memory), or may be other types of memory for random data storage.
[0060] It should be noted that, for the one-time programmable memory 120 , the stored data will not be lost after power failure; and for the random access memory 140 , the stored data will be cleared if power failure occurs.
[0061] The processing unit 110 can be connected to the one-time programmable memory 120 and the random access memory 140 respectively, and the processing unit 110 can read and write the two memories.
[0062] It should be noted that since the one-time programmable memory 120 can only be written once, for example: when the data stored in a location is 0, it can be modified to 1, but after the modification, it cannot be modified again. Therefore, in order to adapt to multiple modifications of the one-time programmable memory implemented in this application, the one-time programmable memory 120 can be first divided into storage areas, that is, the one-time programmable memory includes multiple pre-divided storage areas.
[0063] The following is a detailed explanation of the area division method of the one-time programmable memory in the processing chip provided in the embodiment of the present application.
[0064] Figure 2 For a schematic diagram of the storage area division of the one-time programmable memory in the processing chip provided in the embodiment of the present application, please refer to Figure 2 , Figure 2 Taking the example of dividing the storage area of the one-time programmable memory into four areas (AD areas), the specific division method can be equal distribution. For example, the one-time programmable memory includes 512 storage addresses, and the 512 storage addresses can be evenly distributed into four parts, and each storage area can include 128 addresses.
[0065] It should be noted that, for each storage area, the data stored therein can be any data, but each storage address between different storage areas has a corresponding relationship, for example, the first address in storage area A will correspond to the first address in storage area B. The corresponding relationship between multiple storage areas is similar.
[0066] On this basis, the data stored in each address can include two parts. The first part can be the stored data itself, that is, Figure 2 The data A1-data D126 shown in the second part can be the address pointer corresponding to the storage of the data, that is, Figure 2 Address pointer a1 - address pointer d126 shown in .
[0067] It should be noted that, for each storage area, the first address may not be provided with storage data, and the last address may not be provided with an address pointer.
[0068] It should be noted that the number of storage areas and the number of addresses in each storage area can be set accordingly according to actual needs and are not limited to Figure 2 The examples shown are limitations.
[0069] The specific implementation process of the memory data modification method involved in the embodiment of the present application is explained below in detail based on the structure of the above-mentioned processing chip and the area division of the one-time programmable memory.
[0070] Figure 3 For a flow chart of the method for modifying data in a memory provided in an embodiment of the present application, please refer to Figure 3 , the method comprising:
[0071] S310: Read target data and an address pointer corresponding to the target data from a random access memory.
[0072] The address pointer is used to indicate the storage address of the next data of the target data.
[0073] Optionally, the target data may be any data in a random access memory, for example, an address in a random access memory may be determined according to actual needs, and corresponding data may be read from the determined address, and the data may be used as the target data. The address pointer corresponding to the target data is also the address pointer stored in the address where the target data is stored, and the address pointer may be used to point to the storage address of the next data of the target data.
[0074] It should be noted that in a random access memory, the storage method of each data is similar to that in a one-time programmable memory, and can include multiple storage addresses. Each storage address stores the stored data and an address pointer corresponding to the stored data, and the address pointer points to the storage address of the next data of the stored data.
[0075] The processing unit can read data from the random access memory, wherein the storage address where the target data is stored can be actively selected by the user, or can be randomly determined, and there is no limitation here. After the storage address corresponding to the target data is determined by the user's selection, the target data and the address pointer corresponding to the target data can be read from the random access memory.
[0076] S320: Determine the address of the data to be written in the one-time programmable memory based on the target data and the address pointer corresponding to the target data.
[0077] The address of the data to be written is located at a corresponding position of the next storage area in the one-time programmable memory where no data is stored.
[0078] It should be noted that since both the one-time programmable memory and the random access memory are connected to the processing unit, the one-time programmable memory and the random access memory have a mapping relationship, and the mapping relationship can be specifically that each data in the random access memory is mapped to the first storage area of the one-time programmable memory.
[0079] In addition, for a one-time programmable memory, the data in its first storage area can be already written data, that is, data that has been edited once, and these data are fixed and cannot be changed. Except for the first storage area, the data in other storage areas are all initial unedited data, that is, data that can be edited once.
[0080] That is to say, after determining the target data and the address pointer corresponding to the target data, the storage address of the target data itself in the random access memory can be determined, and then the storage address of the data mapped in the one-time programmable memory can be determined, and the corresponding storage address in the next storage area where no data is stored in the storage area where the storage address is located can be used as the above-mentioned data address to be written.
[0081] For example: Figure 2 Taking the area division shown in as an example, according to the mapping relationship between the target data and the address stored by the address pointer corresponding to the target data, it is determined that the storage address corresponding to the mapping relationship is the position of address 2. The storage area where address 2 is located is the third storage position in storage area A. Then, the corresponding position in the next storage area is the third storage position in storage area B, that is, Figure 2 Address 130 in .
[0082] It should be noted that the corresponding storage address in the next storage area should contain the initial unedited data. If it has been edited, it can be sequentially transferred to the next storage area. Continuing with the above example, if Figure 2 The address 130 in the memory has been edited, then the third memory location in the memory area C can be accessed, that is, Figure 2 Address 258 in.
[0083] Optionally, the data address to be written in the one-time programmable memory of the target data in the random access memory may be determined based on the above method.
[0084] For example, in a one-time programmable memory, under normal conditions, the order of data reading may be from address 0 to address 127. After modification in the above manner, the order of data reading may be from address 0 to address 1, then from address 1 to address 130 (if storage area C is used, it is address 258), then from address 130 to address 3, and then from address 3 to address 127. The modification of the one-time programmable memory is achieved in the above manner.
[0085] It should be noted that the above process only takes the modification of one target data as an example. If multiple target data are modified, the corresponding address can be changed to the corresponding position in the next storage area where no data is stored, so as to achieve this. No specific limitation is made here.
[0086] S330: Determine the modified data to be written into the data address and the address pointer corresponding to the modified data based on the address of the associated data of the target data and the target data.
[0087] The associated data is data adjacent to the target data address in the random access memory.
[0088] Optionally, the associated data may be data adjacent to the target data address in the random access memory, for example, the previous data of the target data or the next data of the target data, which is not specifically limited here.
[0089] It should be noted that the above method only determines the address of the data to be written, but does not determine the modified data in the address of the data to be written and the address pointer corresponding to the modified data. The modified data and the address pointer corresponding to the modified data can be determined based on the address of the associated data of the target data and the target data.
[0090] In a data modification method of a memory provided in an embodiment of the present application, a processing chip includes: a processing unit, a one-time programmable memory and a random access memory, wherein the one-time programmable memory includes a plurality of pre-divided storage areas, and by reading target data and an address pointer corresponding to the target data from the random access memory, the address of the data to be written in the one-time programmable memory is determined based on the target data and the address pointer corresponding to the target data, and the modified data in the address of the data to be written and the address pointer corresponding to the modified data can be determined based on the address of the associated data of the target data and the target data, so that multiple modifications and writing of data in the one-time programmable memory can be realized. Since the one-time programmable memory requires less space than the multi-time programmable memory and can enter a low power consumption mode during operation, when the one-time programmable memory is used for data storage, the area power consumption of the chip can be reduced, the cost can be reduced, and the applicability of the entire chip can be improved while realizing multiple modifications of the stored data.
[0091] In order to explain the process of implementing data modification more clearly, the following will explain the changes of data and pointers in the one-time programmable memory through a specific process diagram.
[0092] Figure 4 Please refer to the schematic diagram of the process of implementing data modification provided in the embodiment of this application. Figure 4 , based on the address of the associated data of the target data and the target data, determining the modified data to be written in the data address and the address pointer corresponding to the modified data, including: determining the modified data and the address pointer corresponding to the modified data based on the address of the second associated data of the target data and the target data, the second associated data being the data of the next adjacent address of the target data in the random access memory.
[0093] It should be noted that, for the random access memory, since there is a mapping relationship between it and the one-time programmable memory, that is to say, the storage method in the random access memory is the same as the storage method in the first storage area in the one-time programmable memory. The mapping relationship specifically refers to the fact that the pointing relationship of the address pointer remains consistent, but the storage data stored in each address may be different.
[0094] For example, if the address pointer in address 2 points to address 3, when the data in address 2 is used as the target data, the data in address 3 is the second associated data of the target data.
[0095] Specifically, determining the modified data and the address pointer corresponding to the modified data based on the address of the second associated data of the target data and the target data includes:
[0096] The target data is used as the modified data; and the address pointed to by the address pointer corresponding to the modified data is determined as the address of the second associated data of the target data.
[0097] That is to say, the target data can be used as the modification data and written into the above-mentioned address of the data to be written, and the address pointed to by the address pointer corresponding to the modification data can be the address of the second associated data of the target data.
[0098] For example: in a random access memory, the address pointer in address 2 points to address 3. When the data in address 2 is used as the target data, the data in address 3 is the second associated data of the target data. After modification in the above manner, address 2 is modified to address 130 in the one-time programmable memory, which means that address 130 is the address of the data to be written, and the target data stored at address 2 in the random access memory is the modified data in address 130. The address pointer corresponding to the modified data at address 130 points to address 3 in the one-time programmable memory. Since when a mapping relationship exists and the above modification is not performed, the address of the random access memory corresponds one-to-one to the address of the first storage area in the one-time programmable memory. Therefore, address 3 in the one-time programmable memory and address 3 in the random access memory are the same.
[0099] Figure 4 As shown in , address 130 is used as the address to be written to implement the modification of the data therein, that is, the modified data and the address pointer corresponding to the modified data are obtained.
[0100] Another change of data and pointers in the one-time programmable memory is explained below through another specific process diagram.
[0101] Figure 5 For another process diagram of implementing data modification provided in the embodiment of the present application, please refer to Figure 5 After determining the address of the data to be written in the one-time programmable memory based on the target data and the address pointer corresponding to the target data, the method also includes: determining the address stored in the address pointer pointing to the address of the data to be written based on the address pointer of the first associated data of the target data, the first associated data being the data of the previous adjacent address of the target data in the random access memory; writing the address pointer pointing to the address of the data to be written in the address stored in the address pointer pointing to the address of the data to be written.
[0102] For example: in a random access memory, if the address pointer in address 1 points to address 2, when the data in address 2 is used as the target data, the data in address 1 is the first associated data of the target data; and after modification in the above manner, address 2 is modified to address 130 in the one-time programmable memory, that is, address 130 is the above-mentioned address of the data to be written, and address 1 still points to address 2 at this time. In order to make adaptive modifications, the address stored in the address pointer pointing to the address of the data to be written can be determined based on the address pointer of the first associated data of the target data. The address stored in the address pointer pointing to the address of the data to be written is also address 1 in the one-time programmable memory. The address pointer pointing to the address of the data to be written can be written in address 1, that is, the address pointer stored in address 1 in the one-time programmable memory is changed to point to address 130.
[0103] Figure 5 As shown in , address 130 is used as the address to be written to realize the modification of the data therein, that is, the pointing of the address pointer in address 1 is modified, and the address pointer originally pointing to address 2 is changed to point to address 130.
[0104] Optionally, before reading the target data, the address pointer corresponding to the target data and the address of the data associated with the target data from the random access memory, the method further includes: storing all the data in the one-time programmable memory into the random access memory.
[0105] It should be noted that, in order to initially record the data in the one-time programmable memory, all the data in the one-time programmable memory may be stored in the random access memory before performing the above-mentioned modification process.
[0106] Among them, after storing in the above manner, the contents stored in the one-time programmable memory and the random access memory are exactly the same, but since the random access memory can be edited at any time, before making the above modification, the data stored in the random access memory can also be edited accordingly. The data content in the random access memory can be changed through this editing, but in order to maintain the consistency of the mapping relationship, the address pointer is usually not modified, but the stored data can be modified.
[0107] The following is a detailed explanation of the specific implementation process of storing data into a random access memory in the data modification method of the memory provided in the embodiment of the present application.
[0108] Figure 6 Another flowchart of the method for modifying data in a memory provided in an embodiment of the present application is shown in FIG. Figure 6 , storing all data in the one-time programmable memory into the random access memory, including:
[0109] S610: Read data of a first address in a one-time programmable memory and its corresponding address pointer.
[0110] Optionally, in order to store all the data in the one-time programmable memory into the random access memory, the data at the first readable address and the corresponding address pointer may be read in sequence from the address.
[0111] S620: Determine a next address according to an address pointer corresponding to the data of the first address, and read the data of the next address and its corresponding address pointer at the next address until all the data in the one-time programmable memory are read.
[0112] Optionally, after the address pointer corresponding to the data in the first address is read in the above manner, the next address can be determined based on the address pointer, so that all data in the one-time programmable memory can be read in this manner.
[0113] S630: Storing all data in the one-time programmable memory in the random access memory.
[0114] Optionally, after all the data in the one-time programmable memory are read in the above manner, the data may be stored in the random access memory in a mapping manner, that is, corresponding data and address pointers corresponding to the data are stored in corresponding addresses.
[0115] Optionally, after determining the modified data to be written into the data address and the address pointer corresponding to the modified data based on the address of the associated data of the target data and the target data, the method further includes: modifying the data in the random access memory based on the modified data and the address pointer corresponding to the modified data.
[0116] It should be noted that the above method can be used to implement programming modification of data in a one-time programmable memory. In actual applications, since the one-time programmable memory and the random access memory are connected, based on a preset logical relationship, the data in the random access memory is usually read first, and the data in the random access memory is not changed. Therefore, the data in the random access memory can be modified based on the modified data and the address pointer corresponding to the modified data.
[0117] Optionally, in addition to the above-mentioned modification method, the method of powering off and then powering on again can also be used to re-initialize the reading. Since the random access memory will clear the storage content after powering off, and the one-time programmable memory will not clear the storage due to power off, the random access memory can be implemented by powering off and then powering on again, and then the above-mentioned initialization reading steps S610-S630 can be re-executed, thereby realizing the modification of the data in the random access memory.
[0118] The following describes the devices, equipment, storage media, etc. corresponding to the data modification method of the memory provided in the present application. The specific implementation process and technical effects are described above and will not be repeated below.
[0119] Figure 7 For a structural diagram of a data modification device for a memory provided in an embodiment of the present application, please refer to Figure 7 , the device includes: a reading module 710, a determining module 720 and a modifying module 730;
[0120] A reading module 710 is used to read target data and an address pointer corresponding to the target data from a random access memory, where the address pointer is used to indicate a storage address of the next data of the target data;
[0121] A determination module 720, configured to determine an address of data to be written in the one-time programmable memory based on the target data and an address pointer corresponding to the target data, the address of the data to be written corresponding to a position of a next storage area in the one-time programmable memory that does not store data;
[0122] The modification module 730 is used to determine the modification data to be written into the data address and the address pointer corresponding to the modification data based on the address of the associated data of the target data and the target data, wherein the associated data is the data adjacent to the target data address in the random access memory.
[0123] Optionally, the modification module 730 is specifically used to determine the modification data and the address pointer corresponding to the modification data based on the address of the second associated data of the target data and the target data, and the second associated data is the data of the next adjacent address of the target data in the random access memory.
[0124] Optionally, the modification module 730 is specifically configured to use the target data as the modification data; and determine the address pointed to by the address pointer corresponding to the modification data as the address of the second associated data of the target data.
[0125] Optionally, the modification module 730 is also used to determine the address stored in the address pointer pointing to the address of the data to be written based on the address pointer of the first associated data of the target data, the first associated data being the data of the previous adjacent address of the target data in the random access memory; and write the address pointer pointing to the address of the data to be written into the address stored in the address pointer pointing to the address of the data to be written.
[0126] Optionally, the reading module 710 is further configured to store all data in the one-time programmable memory into the random access memory.
[0127] Optionally, the reading module 710 is specifically used to read the data of the first address in the one-time programmable memory and its corresponding address pointer; determine the next address according to the address pointer corresponding to the data of the first address, and read the data of the next address and its corresponding address pointer at the next address until all the data in the one-time programmable memory are read; and store all the data in the one-time programmable memory in the random access memory.
[0128] Optionally, the modification module 730 is further configured to modify the data in the random access memory based on the modification data and the address pointer corresponding to the modification data.
[0129] In a data modification device of a memory provided in an embodiment of the present application, a processing chip includes: a processing unit, a one-time programmable memory and a random access memory, wherein the one-time programmable memory includes a plurality of pre-divided storage areas, by reading target data and an address pointer corresponding to the target data from the random access memory, determining the address of the data to be written in the one-time programmable memory based on the target data and the address pointer corresponding to the target data, and determining the modified data in the address of the data to be written and the address pointer corresponding to the modified data based on the address of the associated data of the target data and the target data, multiple modifications and writing of data in the one-time programmable memory can be realized, since the one-time programmable memory requires less space than the multi-time programmable memory and can enter a low power consumption mode during operation, therefore, when the one-time programmable memory is used for data storage, the area power consumption of the chip can be reduced while realizing multiple modifications of the stored data, thereby reducing the cost, and thus improving the applicability of the entire chip.
[0130] The above-mentioned device is used to execute the method provided by the aforementioned embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0131] The above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0132] Figure 8 For a schematic diagram of the structure of the computer device provided in the embodiment of the present application, please refer to Figure 8 The computer device includes: a memory 810 and a processor 820. The memory 810 stores a computer program that can be run on the processor 820. When the processor 820 executes the computer program, the steps of the memory data modification method are implemented.
[0133] Optionally, the computer device may specifically refer to the above-mentioned processing chip, the memory 810 may refer to the above-mentioned one-time programmable memory and random access memory, and the processor 820 may refer to a processing unit.
[0134] In another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the method for modifying data in a memory are implemented.
[0135] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0136] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0137] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0138] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
[0139] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0140] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for modifying data in a memory, It is characterized in that The method is applied to a processing unit of a processing chip, the processing chip further comprising: a one-time programmable memory and a random access memory, the processing unit is connected to the one-time programmable memory and the random access memory respectively, the one-time programmable memory comprises a plurality of pre-divided storage areas, and the method comprises: Reading target data and an address pointer corresponding to the target data from the random access memory, wherein the address pointer is used to indicate a storage address of next data of the target data; Determine the address of the data to be written in the one-time programmable memory based on the target data and the address pointer corresponding to the target data, the address of the data to be written corresponding to the position of the next storage area in the one-time programmable memory where no data is stored; The modified data in the address of the data to be written and the address pointer corresponding to the modified data are determined based on the address of the associated data of the target data and the target data, wherein the associated data is data adjacent to the address of the target data in the random access memory.
2. The method for modifying data in a memory as claimed in claim 1, It is characterized in that The determining, based on the address of the associated data of the target data and the target data, the modified data in the address of the data to be written and the address pointer corresponding to the modified data comprises: The modification data and an address pointer corresponding to the modification data are determined based on an address of second associated data of the target data and the target data, wherein the second associated data is data of a next adjacent address of the target data in the random access memory.
3. The method for modifying memory data according to claim 2, It is characterized in that The determining the modification data and the address pointer corresponding to the modification data based on the address of the second associated data of the target data and the target data includes: Using the target data as the modified data; The address pointed to by the address pointer corresponding to the modified data is determined as the address of the second associated data of the target data.
4. The method for modifying memory data according to claim 1, It is characterized in that After determining the address of the data to be written in the one-time programmable memory based on the target data and the address pointer corresponding to the target data, the method further includes: Determining the address stored in the address pointer pointing to the address of the data to be written based on the address pointer of the first associated data of the target data, wherein the first associated data is data of the previous adjacent address of the target data in the random access memory; The address pointer pointing to the address of the data to be written is written into the address stored in the address pointer pointing to the address of the data to be written.
5. The method for modifying data in a memory as claimed in claim 1, It is characterized in that Before reading the target data and the address pointer corresponding to the target data from the random access memory, the method further includes: All data in the one-time programmable memory are stored in the random access memory.
6. The method for modifying data in a memory as claimed in claim 5, It is characterized in that The storing all the data in the one-time programmable memory into the random access memory comprises: Reading data of a first address in the one-time programmable memory and its corresponding address pointer; Determine a next address according to an address pointer corresponding to the data of the first address, and read the data of the next address and the address pointer corresponding to the next address at the next address until all the data in the one-time programmable memory are read; All data in the one-time programmable memory are stored in the random access memory.
7. The method for modifying data in a memory as claimed in claim 1, It is characterized in that After determining the modified data in the address of the data to be written and the address pointer corresponding to the modified data based on the address of the associated data of the target data and the target data, the method further includes: The data in the random access memory is modified based on the modification data and an address pointer corresponding to the modification data.
8. A data modification device for a memory, It is characterized in that The device is applied to a processing unit of a processing chip, the processing chip further includes: a one-time programmable memory and a random access memory, the processing unit is connected to the one-time programmable memory and the random access memory respectively, the one-time programmable memory includes a plurality of pre-divided storage areas, and the device includes: a reading module, a determining module and a modifying module; The reading module is used to read the target data and the address pointer corresponding to the target data from the random access memory, wherein the address pointer is used to indicate the storage address of the next data of the target data; The determining module is used to determine the address of the data to be written in the one-time programmable memory based on the target data and the address pointer corresponding to the target data, and the address of the data to be written corresponds to the position of the next storage area in the one-time programmable memory where no data is stored; The modification module is used to determine the modification data in the data address to be written and the address pointer corresponding to the modification data based on the address of the associated data of the target data and the target data, and the associated data is the data adjacent to the target data address in the random access memory.
9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the computer program, the steps of the method described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, which, when executed by a processor, implements the steps of the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
OTP memory, data writing reading methods thereof and security chip
CN107908359A
Real-time data processing method and device and equipment
CN111405040A