CN101582295B - Data update method and system - Google Patents
Data update method and system Download PDFInfo
- Publication number
- CN101582295B CN101582295B CN2008101078101A CN200810107810A CN101582295B CN 101582295 B CN101582295 B CN 101582295B CN 2008101078101 A CN2008101078101 A CN 2008101078101A CN 200810107810 A CN200810107810 A CN 200810107810A CN 101582295 B CN101582295 B CN 101582295B
- Authority
- CN
- China
- Prior art keywords
- data
- page
- specific collection
- pages
- update system
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 21
- 230000015654 memory Effects 0.000 claims abstract description 85
- 238000010586 diagram Methods 0.000 description 8
- 238000013500 data storage Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000006993 memory improvement Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
技术领域 technical field
本发明是有关于数据更新,特别是有关于具可编程页面的闪存存储器(flash memory),有效增加系统弹性度,及提高数据更新时的效率。The present invention is related to data update, especially related to flash memory (flash memory) with programmable pages, which effectively increases the system flexibility and improves the efficiency of data update.
背景技术 Background technique
根据数据储存类型及数据存取机制类型,可将存储器分为两大类:易失性存储器(volatile memory)及非易失性存储器(non-volatile memory)。一般而言,非易失性存储器包括:只读存储器(read only memory;ROM)、可编程只读存储器(programmable read only memory;PROM)、可擦除可编程只读存储器(erasable programmable read only memory;EPROM)、可电擦除可编程只读存储器(electrically erasable programmable read only memory;EEPROM)、以及闪存存储器。According to the type of data storage and the type of data access mechanism, memory can be divided into two categories: volatile memory and non-volatile memory. Generally speaking, non-volatile memory includes: read only memory (read only memory; ROM), programmable read only memory (programmable read only memory; PROM), erasable programmable read only memory (erasable programmable read only memory) ; EPROM), electrically erasable programmable read only memory (electrically erasable programmable read only memory; EEPROM), and flash memory.
其中,可电擦除可编程只读存储器及闪存存储器均可以用电性方式重复读写,且具备擦除的功能,因此广泛地使用于各类数字设备中。可电擦除可编程只读存储器与闪存存储器之间,最大不同为前者是以一字节(byte)为单位进行擦除/写入的动作,而后者则是以一个区块(one sector)或一个页面(one page)为一个单位进行擦除/写入的动作。Among them, the electrically erasable programmable read-only memory and flash memory can be repeatedly read and written electrically, and have the function of erasing, so they are widely used in various digital devices. The biggest difference between EEPROM and flash memory is that the former is erased/written in units of one byte (byte), while the latter is erased/written in units of one sector (one sector) Or one page (one page) is a unit of erase/write action.
就可电擦除可编程只读存储器而言,由于所需晶片面积较大,且价格较昂贵,因此并不适用于高容量产品。相较于可电擦除可编程只读存储器,闪存存储器虽然具备读取速度快、晶片面积小及低耗电量的优点,但却同时牺牲了擦除的弹性度,当待更新数据少、且远小于闪存存储器的更新单位,例如:一个页面时,则原本不需执行更新的区域,亦同时进行了不必要的读取、擦除及写入的循环操作,从而降低闪存存储器的读写耐受能力。As far as the EEPROM is concerned, it is not suitable for high-capacity products because it requires a large chip area and is expensive. Compared with EEPROM, although flash memory has the advantages of fast reading speed, small chip area and low power consumption, it sacrifices the flexibility of erasing at the same time. When there is less data to be updated, And it is much smaller than the update unit of flash memory, for example: when a page is used, the area that does not need to be updated originally also performs unnecessary cycle operations of reading, erasing and writing, thereby reducing the read and write of flash memory tolerance.
发明内容 Contents of the invention
有鉴于此,本发明的目的,在于提供一种具可编程页面的闪存存储器,及其数据更新方法及系统,用以提高闪存存储器的数据更新效率,并在不增加系统成本及不影响系统架构下,动态地调整闪存存储器的页面大小,用以提高闪存存储器的使用率,同时有效提升数据更新的效率。In view of this, the purpose of the present invention is to provide a flash memory with programmable pages, and its data update method and system, in order to improve the data update efficiency of the flash memory, and without increasing the system cost and without affecting the system architecture Next, the page size of the flash memory is dynamically adjusted to improve the utilization rate of the flash memory and effectively improve the efficiency of data updating.
为达成上述目的,于一实施例中,本发明提供一种数据更新方法,应用于一非易失性存储器中,该非易失性存储器具有复数个可同时擦除数据的页面。该方法的步骤包括:取得一第一数据所对应的一储存页面及一储存位置;根据一既定样态值决定这些页面的一操作模式;编程这些页面,以于每一页面中产生符合该操作模式的一特定集合,其中,该储存位置位于该储存页面的该特定集合中;及对该特定集合的数据执行更新操作。To achieve the above object, in one embodiment, the present invention provides a data updating method, which is applied in a non-volatile memory, and the non-volatile memory has a plurality of pages whose data can be erased at the same time. The steps of the method include: obtaining a storage page and a storage location corresponding to a first data; determining an operation mode of these pages according to a predetermined state value; a specific set of schemas, wherein the storage location is in the specific set of the storage pages; and performing an update operation on the data of the specific set.
为达成上述目的,于另一实施例中,本发明更提供一种数据更新系统,是包括:一样态缓存器及一嵌入式装置。该样态缓存器用以储存对应于一操作模式的一既定样态值。该嵌入式装置包括一闪存存储器,且耦接于该样态缓存器。上述闪存存储器具有复数个可同时擦除数据的页面,用以根据该既定样态值编程这些页面,并依序更动每一页面的定址,以于每一页面中产生符合该操作模式的一特定集合。于一储存页面的一特定集合中,是包括待更新的一第一数据。上述数据更新系统,更包括:一微控制器,是耦接于该样态缓存器及该嵌入式装置,用以设定该样态缓存器,并根据该既定样态值对该闪存存储器执行更新操作,用以更新该第一数据。To achieve the above object, in another embodiment, the present invention further provides a data update system, which includes: a status register and an embedded device. The state register is used for storing a predetermined state value corresponding to an operation mode. The embedded device includes a flash memory coupled to the state register. The above-mentioned flash memory has a plurality of pages whose data can be erased at the same time, and is used to program these pages according to the predetermined state value, and sequentially change the addressing of each page, so as to generate an operation pattern in each page according to the operation mode. specific collection. In a specific set of a storage page, a first data to be updated is included. The above-mentioned data update system further includes: a microcontroller, which is coupled to the state register and the embedded device, for setting the state register, and executing the flash memory according to the predetermined state value. The updating operation is used for updating the first data.
为使本发明的上述目的、特征和优点能更明显易懂,下文特举实施例,并配合所附图示,详细说明如下。In order to make the above-mentioned objects, features and advantages of the present invention more comprehensible, the following specific examples will be described in detail with reference to the accompanying drawings.
附图说明 Description of drawings
图1是显示根据本发明实施例的一数据更新系统方块图;FIG. 1 is a block diagram showing a data update system according to an embodiment of the present invention;
图2是显示根据本发明实施例的一嵌入式装置的一存储器配置示意图;FIG. 2 is a schematic diagram showing a memory configuration of an embedded device according to an embodiment of the present invention;
图3是显示根据本发明实施例的一存储器配置表;Fig. 3 shows a memory configuration table according to an embodiment of the present invention;
图4是显示根据第3图的存储器配置表的一页面配置示意图;Fig. 4 is a schematic diagram showing a page configuration of the memory configuration table according to Fig. 3;
图5是显示根据第3图的存储器配置表的另一页面配置示意图;及Fig. 5 is a schematic diagram showing another page configuration of the memory configuration table according to Fig. 3; and
图6是显示根据本发明实施例的一数据更新方法流程图。FIG. 6 is a flowchart showing a data updating method according to an embodiment of the present invention.
附图标号Reference number
100~数据更新系统;100~data update system;
108~微控制器;108~microcontroller;
102~样态缓存器;102~state buffer;
104、204~嵌入式装置;104, 204~embedded device;
106~闪存存储器;106~flash memory;
206~闪存数据存储器;206~flash data memory;
210、212~未使用程序存储器;210, 212~unused program memory;
214~程序存储器;及214 ~ program memory; and
0~511~存储单元。0~511~ storage unit.
具体实施方式 Detailed ways
图1是显示根据本发明实施例的一数据更新系统100方块图。如图1所示,该数据更新系统100包括一微控制器108、一样态缓存器102、及一嵌入式装置104。该微控制器108耦接于该样态缓存器102及该嵌入式装置104,用以设定该样态缓存器102。该样态缓存器102是储存对应于一操作模式的一既定样态值。该嵌入式装置104包括一闪存存储器106,于一实施例中,可用于存放使用者所储存的数据。该微控制器108则根据该既定样态值配置该闪存存储器106,并对该闪存存储器106执行数据更新操作,将进一步说明如下。FIG. 1 is a block diagram showing a data update system 100 according to an embodiment of the present invention. As shown in FIG. 1 , the data update system 100 includes a microcontroller 108 , a state register 102 , and an embedded device 104 . The microcontroller 108 is coupled to the state register 102 and the embedded device 104 for setting the state register 102 . The state register 102 stores a predetermined state value corresponding to an operation mode. The embedded device 104 includes a flash memory 106 which, in one embodiment, can be used to store data stored by a user. The microcontroller 108 configures the flash memory 106 according to the predetermined state value, and performs a data update operation on the flash memory 106, which will be further described as follows.
请参考图2,是显示根据本发明实施例的一嵌入式装置204的一存储器配置示意图。于此实施例中,该嵌入式装置204包括一闪存数据存储器206、未使用程序存储器210及212、及一程序存储器214。值得一提的是,该程序存储器214的存储容量通常为1KB(kilo byte)、2KB或4KB,如图2所示,因此,该未使用程序存储器212的起始位置分别为0400h、0800h及1000h。Please refer to FIG. 2 , which is a schematic diagram showing a memory configuration of an embedded
于一实施例中,该闪存数据存储器206具有8个可同时擦除数据的页面,如图2所标示的页面0、页面1、...、页面7。于一实施例中,当该微控制器108(图1)未使能配置这些页面或未设定该既定样态值时,每一页面的存储容量可设定为64字节,并根据每一页面的存储容量依序定址每一页面。于其它实施例中,每一页面的存储容量亦可设定为16字节,并依序更动每一页面的定址。以下将进一步说明利用该既定样态值编程这些页面的操作。In one embodiment, the
图3是显示根据本发明实施例的一存储器配置表。于图3中,该微控制器108(图1)根据使用者的需求设定该样态缓存器102(图1)的值:“00”、“01”、“10”及“11”,分别对应于操作模式0、1、2及3。FIG. 3 shows a memory configuration table according to an embodiment of the present invention. In FIG. 3, the microcontroller 108 (FIG. 1) sets the value of the status register 102 (FIG. 1) according to user requirements: "00", "01", "10" and "11", These correspond to
图4是显示根据图3的存储器配置表的一页面配置示意图。于此实施例中,该样态缓存器102的值为00,该微控制器108根据该样态值“00”(即操作模式0)编程页面0、页面1、...、及页面7。如图4所示,页面0的存储单元为0~63、页面1的存储单元为64~127、页面2的存储单元为128~191、...、及页面7的存储单元为448~511。如此一来,每一页面的存储容量均为64字节,因此8个页面的存储容量总合为512字节。FIG. 4 is a schematic diagram showing a page configuration of the memory configuration table shown in FIG. 3 . In this embodiment, the value of the state register 102 is 00, and the microcontroller 108
为更清楚说明本发明,请参考图5。图5是显示根据图3的存储器配置表的另一页面配置示意图。在此实施例中,于操作模式0的情况下,每一页面的存储容量为64字节,而8个页面的存储容量总合为512字节,如图5所标示的0~511。当该样态缓存器102的值设定为“01”,即设定为操作模式1时,该微控制器108进一步配置页面0~页面7,于每一页面中产生符合操作模式1的集合,如图5的页面0所示的0~31、页面1所示的32~63、页面2所示的64~95、...、及页面7所示的224~255。每一页面的存储容量为32字节,8个页面的存储容量总合为256字节。To illustrate the present invention more clearly, please refer to FIG. 5 . FIG. 5 is a schematic diagram showing another page configuration of the memory configuration table in FIG. 3 . In this embodiment, in the
同样地,当该样态缓存器102的值设定为“10”,即设定为操作模式2时,则该微控制器108配置每一页面的存储位置,产生如图5的页面0所示的0~15、页面1所示的16~31、页面2所示的32~47、...、及页面7所示的112~127。每一页面的存储容量为16字节,8个页面的存储容量总合为128字节。Similarly, when the value of the state register 102 is set to "10", that is, when it is set to the
如上所述,当该样态缓存器102的值设定为“11”,即设定为操作模式3时,则该微控制器108于每一页面中产生符合操作模式3的集合,如图5的页面0所标示的0~7、页面1所标示的8~15、页面2所标示的16~23、...、及页面7所标示的56~63。每一页面的存储容量为8字节,而8个页面的存储容量总合为64字节。As mentioned above, when the value of the state register 102 is set to "11", that is, when the
当使用者所储存的数据不多,例如:马达控制参数,通常仅需要几字节的存储容量,则以此配置方式更新马达控制参数时,将有效减少备份数据的存储区域,并同时减少更新所需的读取、擦除及写入时间。举例而言,若一组马达控制参数仅需6字节的存储容量,则该微控制器108可设定该样态缓存器102为“11”,并根据该样态值“11”编程该闪存数据存储器206的页面0~页面7,如图5所示,于每一页面中产生符合操作模式3的集合。于此操作模式下,每一页面的存储容量仅为8字节,可有效减少储存该马达控制参数所需的写入时间。同样地,当需要更新所储存的马达控制参数时,该微控制器108会先读取所储存的该马达控制参数,存于备份数据存储器区域,接着对储存该马达控制参数的页面执行页面擦除操作,再将修改后的马达控制参数写回该页面,以完成一更新操作。因为每一页面所需擦除及写入的存储单位为8字节,如此一来,大幅降低原本更新一整个页面所需的时间。如上所述,动态地调整每一页面的存储容量,不仅保留使用上的弹性度,进一步,更显著提升存储器的使用效率。When the user does not store much data, such as motor control parameters, which usually only need a few bytes of storage capacity, updating the motor control parameters in this configuration will effectively reduce the storage area of backup data and reduce updates at the same time required read, erase and write times. For example, if a set of motor control parameters only requires a storage capacity of 6 bytes, the microcontroller 108 can set the state register 102 to "11", and program the state register 102 according to the state value "11".
图6是显示根据本发明实施例的一数据更新方法流程图。该数据更新方法是应用于一非易失性存储器中。于一实施例中,该非易失性存储器为一闪存存储器,具有复数个可同时擦除数据的页面。于此实施例中,该闪存存储器具有8个页面,供使用者储存所需的数据,但不限定于此。当该闪存存储器所储存的一第一数据需进行更新操作时,首先,取得储存该第一数据的一储存页面及一储存位置(步骤602)。接着,该微控制器108(第1)设定一既定样态值,用以决定一操作模式(步骤604)。进一步,该微控制器108根据所决定的操作模式编程每一页面,以于每一页面中产生符合该操作模式的一集合(步骤606)。其中,该第一数据的储存位置亦在该集合中。编程及配置每一页面的方式已详述如上,在此不再予以赘述。FIG. 6 is a flowchart showing a data updating method according to an embodiment of the present invention. The data update method is applied in a non-volatile memory. In one embodiment, the non-volatile memory is a flash memory with a plurality of pages whose data can be erased at the same time. In this embodiment, the flash memory has 8 pages for users to store required data, but it is not limited thereto. When a first data stored in the flash memory needs to be updated, firstly, a storage page and a storage location for storing the first data are obtained (step 602 ). Next, the microcontroller 108 (1st) sets a predetermined state value for determining an operation mode (step 604). Further, the microcontroller 108 programs each page according to the determined operating mode to generate a set in each page that conforms to the operating mode (step 606 ). Wherein, the storage location of the first data is also in the set. The method of programming and configuring each page has been described in detail above, and will not be repeated here.
值得注意的是,亦可以在编程每一页面之后,再将该第一数据储存于该闪存存储器中。如此一来,当该第一数据需要进行更新操作时,直接读取储存该第一数据的储存页面及储存位置。It should be noted that the first data can also be stored in the flash memory after programming each page. In this way, when the first data needs to be updated, the storage page and the storage location for storing the first data are directly read.
然后,于该储存页面中,读取该集合所储存的数据,作为一备份数据(步骤608)。接着,于该备份数据中,修改该第一数据,例如:修改马达的相关控制参数(步骤610)。之后,对该储存页面执行页面擦除操作,意即擦除该储存页面的集合中所储存的数据(步骤612)。最后,再将修改后的备份数据写入该集合,以完成更新该第一数据的操作(步骤614)。Then, in the storage page, read the data stored in the set as a backup data (step 608). Next, modify the first data in the backup data, for example, modify the relevant control parameters of the motor (step 610). Afterwards, a page erase operation is performed on the storage page, which means erasing the data stored in the set of the storage page (step 612 ). Finally, write the modified backup data into the set to complete the operation of updating the first data (step 614).
综上所述,根据本发明所提供的数据更新系统及方法,在不增加系统成本及影响系统架构下,利用可编程页面的一闪存存储器,动态地调整闪存存储器中每一页面的存储容量,藉此提高更新数据的效率,并使存储器的配置更有弹性,允许使用者自行调整所需的配置方式,不但提供使用者更多方便及自主性,亦达到实际上存储器使用效率的提升,这些都是已知可电擦除可编程只读存储器及闪存存储器尚不及的优点。To sum up, according to the data updating system and method provided by the present invention, without increasing the system cost and affecting the system architecture, a flash memory with programmable pages is used to dynamically adjust the storage capacity of each page in the flash memory, In order to improve the efficiency of updating data, and make the memory configuration more flexible, allowing users to adjust the required configuration mode, not only provides users with more convenience and autonomy, but also achieves the actual improvement of memory usage efficiency, these All are advantages that the known electrically erasable programmable read-only memory and the flash memory do not have.
虽然本发明已以较佳实施例揭露如上,然其并非用以限定本发明,任何熟悉此项技术的相关人员,在不脱离本发明的精神和范围内,当可做些许更动与润饰,因此本发明的保护范围当视前附的权利要求所界定者为准。Although the present invention has been disclosed above with preferred embodiments, it is not intended to limit the present invention. Any relevant personnel familiar with this technology may make some changes and modifications without departing from the spirit and scope of the present invention. Therefore, the scope of protection of the present invention should be defined by the appended claims.
Claims (16)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008101078101A CN101582295B (en) | 2008-05-14 | 2008-05-14 | Data update method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2008101078101A CN101582295B (en) | 2008-05-14 | 2008-05-14 | Data update method and system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN101582295A CN101582295A (en) | 2009-11-18 |
CN101582295B true CN101582295B (en) | 2012-04-18 |
Family
ID=41364400
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN2008101078101A Active CN101582295B (en) | 2008-05-14 | 2008-05-14 | Data update method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN101582295B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101599795B1 (en) | 2009-01-13 | 2016-03-22 | 삼성전자주식회사 | Semiconductor device for adjusting page size |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6205530B1 (en) * | 1997-05-08 | 2001-03-20 | Hyundai Electronics Industries Co., Ltd. | Address translation unit supporting variable page sizes |
CN1438579A (en) * | 2002-02-15 | 2003-08-27 | 矽统科技股份有限公司 | Control method of dynamic random access memory and its application in computer |
CN1503272A (en) * | 2002-11-19 | 2004-06-09 | 三星电子株式会社 | Circuit and method for changing page length in semiconductor memory |
-
2008
- 2008-05-14 CN CN2008101078101A patent/CN101582295B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6205530B1 (en) * | 1997-05-08 | 2001-03-20 | Hyundai Electronics Industries Co., Ltd. | Address translation unit supporting variable page sizes |
CN1438579A (en) * | 2002-02-15 | 2003-08-27 | 矽统科技股份有限公司 | Control method of dynamic random access memory and its application in computer |
CN1503272A (en) * | 2002-11-19 | 2004-06-09 | 三星电子株式会社 | Circuit and method for changing page length in semiconductor memory |
Also Published As
Publication number | Publication date |
---|---|
CN101582295A (en) | 2009-11-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8769189B2 (en) | Method and apparatus for byte-access in block-based flash memory | |
US20080282024A1 (en) | Management of erase operations in storage devices based on flash memories | |
US8386698B2 (en) | Data accessing method for flash memory and storage system and controller using the same | |
CN104102585B (en) | Mapping information recording method, memory controller and memory storage device | |
CN104750616B (en) | Data storage device and flash memory control method | |
US8001317B2 (en) | Data writing method for non-volatile memory and controller using the same | |
US9037782B2 (en) | Method of programming memory cells and reading data, memory controller and memory storage apparatus using the same | |
US10120615B2 (en) | Memory management method and storage controller using the same | |
US20080077728A1 (en) | Mapping information managing apparatus and method for non-volatile memory supporting different cell types | |
US20130103889A1 (en) | Page-buffer management of non-volatile memory-based mass storage devices | |
US8850102B2 (en) | Flash memory with small data programming capability | |
US20130097362A1 (en) | Data writing method, and memory controller and memory storage apparatus using the same | |
US8489942B1 (en) | Memory management method, and memory controller and memory storage device using the same | |
US9213631B2 (en) | Data processing method, and memory controller and memory storage device using the same | |
US9032135B2 (en) | Data protecting method, memory controller and memory storage device using the same | |
US9965400B2 (en) | Memory management method, memory control circuit unit and memory storage device | |
US8423707B2 (en) | Data access method for flash memory and storage system and controller using the same | |
WO2005094281A2 (en) | Device-level address translation within a programmable non-volatile memory device | |
US8943289B2 (en) | Data moving method for flash memory module, and memory controller and memory storage apparatus using the same | |
CN103136111A (en) | Data writing method, memory controller and memory storage device | |
US8762685B2 (en) | Data writing method, memory controller and memory storage apparatus | |
CN101582295B (en) | Data update method and system | |
US8589620B2 (en) | Data writing method, memory controller, and memory storage apparatus | |
CN104238956A (en) | Data writing method, memory controller and memory storage device | |
CN117174149A (en) | Memory control method, memory storage device and memory control circuit unit |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |