Printer and program

By managing flash memory usage through strategic writing and erasing processes, the solution addresses the rapid deterioration of flash memory in POS printers, achieving a 128-fold reduction in write cycle degradation and enhancing memory lifespan.

JP2025100794APending Publication Date: 2025-07-03TOSHIBA TEC KK
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
JP2025069335
Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-04-21
Publication Date
2025-07-03

AI Technical Summary

Technical Problem

Flash memories used in printers for POS terminals deteriorate rapidly due to repeated rewriting of settings, leading to a high failure risk, as existing solutions are not effective for this specific usage scenario.

Method used

A memory control device that manages flash memory by writing data to blank areas and erasing entire storage areas when necessary, thereby reducing the frequency of write cycles and extending the lifespan of the flash memory.

Benefits of technology

The proposed solution significantly reduces the degradation of flash memory by limiting write cycles to 1/128 of conventional methods, effectively extending its lifespan and reducing failure risk.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 2025100794000001_ABST
    Figure 2025100794000001_ABST
Patent Text Reader

Abstract

To provide a memory control device and a program that can prevent deterioration of a flash memory that is repeatedly rewritten for use for storage of data, to extend the life of the flash memory.SOLUTION: A memory control device performs writing and deletion for a flash memory, and comprises a writing processing unit that, when a predetermined storage area of the flash memory has a blank area in which data is not written, and the capacity of the blank area is sufficient for the capacity of data to be written, writes the data to be written in the blank area; and a deletion processing unit that, when the predetermined storage area does not have the blank area, or when the capacity of the blank area is insufficient for the capacity of the data to be written, deletes the entire storage area.SELECTED DRAWING: Figure 8
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to a memory control device and a program.

Background Art

[0002] Conventionally, a sales data processing device such as a POS terminal performs printing / output (issuance) of a receipt or the like using an attached printer. In such a printer that issues a receipt or the like, various settings set by the user of the POS terminal are stored and referred to when issuing the receipt. In such a printer, the settings are rewritten each time the user changes the settings.

[0003] For storing the above settings, a flash memory is often used as being optimal in consideration of cost-effectiveness and the like. As is well known, a flash memory has a guaranteed number of write cycles defined, and when the number of write cycles exceeds the guaranteed value, it is considered that the flash memory has deteriorated to some extent, so it can be said that the possibility of the flash memory failing is high.

[0004] Various proposals have been made to suppress the deterioration of the flash memory and extend its lifespan, such as the technology described in Patent Document 1. However, it is difficult to say that they are easily applicable and effective solutions required for a device assuming a certain usage method, such as a printer provided in a POS terminal.

Summary of the Invention

Problems to be Solved by the Invention

[0005] The problem to be solved by the present invention is to provide a memory control device and a program capable of suppressing the deterioration of a flash memory used for storing repeatedly rewritten data and extending its lifespan.

Means for Solving the Problems

[0006] The memory control device according to the embodiment performs writing and erasing to the flash memory. When there is a blank area in a predetermined storage area provided in the flash memory where data is not written, and the capacity of the blank area is sufficient for the capacity of the data to be written, a writing processing unit writes the data to be written into the blank area. When there is no blank area or the capacity of the blank area is insufficient for the capacity of the data to be written, an erasing processing unit erases the entire storage area.

Brief Description of the Drawings

[0007]

Figure 1

Figure 2

Figure 3

Figure 4

Figure 5

Figure 6

Figure 7

Figure 8

Embodiments for Carrying Out the Invention

[0008] (First Embodiment) The embodiment will be described with reference to the drawings. In this embodiment, an example in which the present invention is applied to a printer that is connected to a POS (Point Of Sales) terminal used in a store and issues receipts and the like will be described, but the application is not limited thereto.

[0009] FIG. 1 is a perspective view showing the appearances of the POS terminal 2 and the printer 1 in the embodiment. The POS system 100 includes a POS terminal 2 and a printer 1 connected to the POS terminal 2.

[0010] The POS terminal 2 includes a keyboard 21 and a display unit 22. The POS terminal 2 receives an instruction to close an account for a transaction and issue a receipt via the keyboard 21. Further, the POS terminal 2 receives various operations via the keyboard 21 and receives settings regarding the issuance (printing and cutting) of a receipt by the printer 1.

[0011] Examples of the settings regarding the issuance of a receipt by the printer 1 include the dimensions of the roll paper used as the receipt paper, the type of cutting method after printing (full cut that completely separates the paper after printing, or partial cut that leaves a part of the paper such as the center or end of the paper without cutting), and the like.

[0012] The printer 1 prints the print data received from the POS terminal 2, which is the upper device, on the paper stored inside the housing 11 and issues it as a receipt from the receipt issuing port 12. Further, the printer 1 cuts the paper by switching between full cut and partial cut in response to a command received from the POS terminal 2.

[0013] Inside the housing 11 of the printer 1, a storage unit for storing roll-shaped paper (receipt paper) is provided. The housing 11 is divided into a lower housing and a cover that serves as the lid of the lower housing. The storage unit can be opened and closed by the cover.

[0014] The receipt issuing port 12 is provided on the front surface of the printer 1. The receipt paper subjected to printing processing by the thermal head 33 (see FIG. 2) is discharged from the receipt issuing port 12 and is fully cut or partially cut by a cutter 360 (see FIG. 2) provided on the back side of the receipt issuing port 12 to issue a receipt.

[0015] Also, an operation display unit 15 is provided below the receipt issuing port 12 on the front surface of the lower housing of the printer 1. The operation display unit 15 has a plurality of LEDs for notifying operation statuses such as paper out and paper jam of the printer 1, and various operation buttons.

[0016] FIG. 2 is a block diagram showing the configuration of the printer 1. The printer 1 includes a CPU (Central Processing Unit) 30 that executes various operations and controls each part. A flash memory 31, which is a non-volatile memory, and a RAM (Random Access Memory) 32, which is a volatile memory, are bus-connected to the CPU 30.

[0017] The flash memory 31 stores a program 311 and a setting storage unit 312. The setting storage unit 312 stores various settings. Examples of the various settings include the size of the roll paper and the cutting method at the time of cutting receipt paper. Note that the settings stored in the setting storage unit 312 are not limited to those exemplified. The settings stored in the setting storage unit 312 are assumed to be those that are expected to be rewritten to some extent repeatedly in the use of the printer 1 when issuing receipts, and it is assumed that the data capacity required for storing the settings is determined in advance.

[0018] The program 311 has a module configuration including various functional units (input reception unit 301, reception processing unit 302, printing control unit 303, cutting control unit 304, writing processing unit 305, erasing processing unit 306) exemplified in FIG. 3 described later. The CPU 30 (processor) reads the program 311 from the flash memory 31, loads it onto the main storage device, and expands it. As a result, the input reception unit 301, reception processing unit 302, printing control unit 303, cutting control unit 304, writing processing unit 305, and erasing processing unit 306 are generated on the main storage device.

[0019] A communication I / F (Interface) 42, a thermal head 33, a paper feed motor 35, a cutter motor 36, etc. are bus-connected to the CPU 30.

[0020] The communication I / F 42 is an interface such as USB (Universal Serial Bus), and the CPU 30 is connected to the CPU of the POS terminal 2 via the communication I / F 42. The thermal head 33 includes a plurality of heating elements arranged linearly, and thermally transfers the print data received from the POS terminal 2 onto thermal paper (paper).

[0021] The paper feed motor 35 functions as a power source for rotating the platen roller facing the thermal head 33 to convey the paper. The cutter motor 36 controls the operation of the cutter 360 provided near the receipt issuing port 12 to cut the paper by full cut or partial cut.

[0022] Next, the functional configuration of the program 311 will be described. FIG. 3 is a block diagram showing the functional configuration of the printer 1. The CPU 30 realizes the control unit 300 by expanding and executing the program 311 in the RAM 32. The control unit 300 includes various functional units (input reception unit 301, reception processing unit 302, printing control unit 303, cutting control unit 304, writing processing unit 305, erasing processing unit 306) shown in FIG. 3.

[0023] The input reception unit 301 receives operation inputs by various operation buttons of the operation display unit 15. Further, the input reception unit 301 receives the input of detection signals of various sensors provided in the printer 1.

[0024] For example, the input reception unit 301 receives a cover open signal indicating that the cover is opened with respect to the lower housing from a sensor that detects cover opening and closing. Further, the input reception unit 301 receives a cover close signal indicating that the cover is closed with respect to the lower housing of the printer 1 from the same sensor.

[0025] The receiving processing unit 302 receives, from the POS terminal 2 via the communication I / F 42, a command indicating the paper cutting method together with the printing data. That is, the receiving processing unit 302 receives, from the POS terminal 2, one of a full cut command, a partial cut command, or a mixed cut command together with the printing data.

[0026] Note that the full cut command is an instruction to cut the paper by a full cut that separates the paper in the width direction. The partial cut command is an instruction to cut the paper by a partial cut that does not cut a part in the width direction. The mixed cut command is an instruction to cut a plurality of sheets of paper by mixing both a full cut and a partial cut when continuously printing on a plurality of sheets of paper and issuing the plurality of sheets of paper as a set.

[0027] The mixed cut command may be a command indicating simply that it is a mixed cut. That is, for example, in the case of a mixed cut, the leading edge of the first sheet and the trailing edge of the last sheet are full cuts, and the space between the sheets is a partial cut. In some cases, the combination of the full cut and the partial cut is uniformly fixed and operated. For such an operation, it is sufficient to indicate simply that it is a mixed cut in the mixed cut command.

[0028] Alternatively, in the mixed cut command, the full cut and the partial cut may be indicated for each sheet of paper. In this case, the POS terminal 2 side may perform settings such as distributing the cutting method according to the printing data.

[0029] When the receiving processing unit 302 receives the printing data, the printing control unit 303 drives the paper feed motor 35 to send the paper toward the printing position of the thermal head 33. Further, the printing control unit 303 outputs the printing data received by the receiving processing unit 302 to the thermal head 33, and controls the printing operation by thermally transferring the printing data to the paper by the thermal head 33.

[0030] The cutting control unit 304 controls the operation of the cutter 360 to cut the paper using a cutting method according to the command received from the POS terminal 2. Further, when cutting the paper without depending on the command from the POS terminal 2, the cutting control unit 304 cuts the paper using the cutting method stored in the setting storage unit 312.

[0031] The writing processing unit 305 records, for example, as information indicating the cutting method, a command for instructing the cutting method received from the POS terminal 2 in the setting storage unit 312. Details of the data writing process by the writing processing unit 305 will be described later.

[0032] The erasing processing unit 306 erases a predetermined range of the setting storage unit 312 of the flash memory 31 at a predetermined timing. The erasing is by data erasing for each block, that is, so-called block erase. The erasing processing unit 306 erases the entire storage area if there is no blank in the storage area where the writing processing unit 305 performs writing, or if the capacity of the blank area is insufficient for the capacity of the data to be written. Further, the erasing processing unit 306 erases the data stored in the block prior to the next writing after the writing processing unit 305 has used up all the small areas obtained by multiplying the block by an integer multiple.

[0033] Here, the printer 1 of the present embodiment is an example of a memory control device that performs writing and erasing to the flash memory 31. The writing process by the writing processing unit 305 and the erasing process by the erasing processing unit 306 will be described in more detail. FIG. 4 is a diagram for explaining the capacity division of the setting storage unit 312. FIG. 5 is a diagram schematically showing how the setting storage unit 312 is used.

[0034] In this embodiment, as shown in FIG. 4, when writing a predetermined setting A, the capacity (X kilobytes) of a predetermined storage area 400 to which the setting A is to be written is made to correspond to the capacity of a block which is a unit of an erase process in the flash memory 31. Further, the capacity (Y bytes) of small areas 401, 402, …, 40n associated with one write of setting A is made to be an integer (n) multiple of the capacity of the storage area 400. Here, Y bytes is equal to or greater than the data capacity of setting A.

[0035] Illustrating with specific numerical values, when the unit capacity of block erase performed by the erase processing unit 306 is 64 kilobytes, the capacity (X kilobytes) of the storage area 400 for setting A is made to be 64 kilobytes. Further, when the capacity required for recording setting A is at most 500 bytes or less, since one 128th (n) of 64 kilobytes (= 65536 bytes) is 512 bytes, the capacity (Y bytes) of small areas 401, 402, …, 40n is made to be 512 bytes. Note that these numerical examples are shown for the purpose of aiding understanding and should be changed according to the unit capacity of block erase and the data capacity of the setting.

[0036] Next, as shown in FIG. 5, it is assumed that all of the storage area 400 erased at once by block erase is used for recording setting A, and as a storage area 500 for recording another setting B, a separate area not erased by block erase for the storage area 400 for setting A is allocated. Further, the capacity (V bytes) of small area 501 associated with one write of setting B is also an integer (m) multiple of the unit capacity (X kilobytes) of block erase. This integer m does not have to match the above-mentioned integer n.

[0037] When the write processing unit 305 writes setting A to the storage area 400, each of the small areas 401, 402, …, 40n is sequentially moved and used as setting A is updated. FIG. 6 is a diagram showing an example of management information of storage areas 400, 500, … to which various settings A, B, … are to be written, in a table format. The flash memory 31 also stores this management information.

[0038] The management information stores, in an associated manner, the identifier (such as a name) of setting A, the location of the area used for writing setting A, the capacity (unit capacity) required for one write of setting A, and the latest write position. In the illustrated example, it stores, in an associated manner, the identifier "setting A", "storage area 400", "Y bytes", and "small area 403".

[0039] By referring to the management information, the writing processing unit 305 interprets that the value currently valid as setting A is recorded in small area 403. Also, the writing processing unit 305 interprets that past settings A that are currently invalid are recorded in small areas 401 and 402 of storage area 400. Further, the writing processing unit 305 interprets that the remaining small areas 404 to 40n of storage area 400 are blank.

[0040] Next, an example of the processing executed by the printer 1 will be described. FIG. 7 is a flowchart schematically showing the flow of processing performed by the control unit 300 as the writing processing unit 305 and the erasing processing unit 306.

[0041] When there is an instruction to rewrite a setting, the control unit 300, as the writing processing unit 305, determines whether it is possible to secure an area (step S1). That is, the writing processing unit 305 determines whether there is a blank area in a predetermined storage area 400 provided in the flash memory 31 that is sufficient for the capacity (Y bytes) of the data to be written (setting A).

[0042] In step S1, if there is a blank area in the predetermined storage area 400 provided in the flash memory 31 that is sufficient for the capacity of the data to be written (Yes in step S1), the writing processing unit 305 writes the data to be written in a part (or all) of the blank area, i.e., small area 40x (step S2). Here, small area 40x is any one of small areas 401, 402,..., 40n and is the next small area after the small area 40x - 1 where writing has been performed. If there has been no writing to the storage area 400, the writing processing unit 305 writes to the first small area 401.

[0043] Next, the writing processing unit 305 updates the latest writing position of the management information (FIG. 6) (step S3) and ends this process.

[0044] On the other hand, in step S1, when there is no blank area in the predetermined storage area 400 provided in the flash memory 31 that is sufficient for the capacity of the data to be written (No in step S1), the control unit 300 executes block erase as the erase processing unit 306 (step S4). That is, the erase processing unit 306 erases the entire storage area 400. After that, the control unit 300 updates the latest writing position of the management information (FIG. 6) (step S6) and advances the process to step S2. Note that, by step S6, the latest writing position is made blank. As a result, the writing processing unit 305 that refers to the management information interprets that all the small areas 401 to 40n of the storage area 400 are blank.

[0045] FIG. 8 is a diagram for explaining the transition of the storage status of the setting storage unit 312. By performing the process described in the flowchart, for example, as shown in FIG. 8(a), when the latest setting is written in the small area 401 of the storage area 400, at the time of the next setting write, the latest setting is written in the next small area 402, and the setting of the small area 402 becomes valid.

[0046] In the next setting write, as shown in FIG. 8(b), the latest setting is written in the small area 402 of the storage area 400, and in the next setting write, as shown in FIG. 8(c), the latest setting is written in the small area 403. The setting stored in the area before the area where the latest setting is written is invalid.

[0047] Then, as shown in FIG. 8(d), if all the small areas 401 to 40n of the storage area 400 have been written and there is no blank in the storage area 400, before the next write, the storage area 400 is block erased (FIG. 8(e)). After that, the latest setting is written in the first small area 401.

[0048] In the example described in the present embodiment, conventionally, every time the setting A was rewritten, the storage area 400 was subjected to an erasure process, and the degradation of the target area progressed with each rewrite. However, according to the present embodiment, for setting A, an erasure process is performed once for 128 rewrites. Therefore, theoretically, it is possible to suppress the degradation to 1 / 128 of that in the conventional case.

[0049] Therefore, according to the printer 1 of the present embodiment, it is possible to suppress the degradation of the flash memory 31 used for storing data that is repeatedly rewritten and used, and extend its lifespan.

[0050] The program executed by the memory control device of the present embodiment is provided by being pre - incorporated into a ROM or the like.

[0051] The program executed by the memory control device of the present embodiment may be configured to be recorded on a computer - readable recording medium such as a CD - ROM, a flexible disk (FD), a CD - R, a DVD (Digital Versatile Disk), etc. in an installable or executable file format and provided.

[0052] Furthermore, the program executed by the memory control device of the present embodiment may be configured to be stored on a computer connected to a network such as the Internet, and provided by being downloaded via the network. Also, the program executed by the memory control device of the present embodiment may be configured to be provided or distributed via a network such as the Internet.

[0053] Although several embodiments of the present invention have been described, these embodiments are presented as examples and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the gist of the invention. These embodiments and their modifications are included in the scope and gist of the invention, and are included in the invention described in the claims and its equivalent scope.

Description of Signs

[0054] 100…POS system, 1 … Printer (Memory Control Device) 11… Housing, 12… Receipt Issuing Port, 15… Operation Display Section 2 … POS Terminal, 21… Keyboard, 22… Display Section 30 … CPU 31 … Flash Memory, 311… Program, 312… Setting Storage Section 32 … RAM 33 … Thermal Head 35 … Paper Feed Motor 36 … Cutter Motor, 360… Cutter 42 … Communication I / F 300… Control Section, 301… Input Reception Section, 302… Reception Processing Section, 303… Printing Control Section, 304… Cutting Control Section, 305… Writing Processing Section, 306… Erasing Processing Section 400… Storage Area, 401, 402, …, 40n (40x)… Small Area 500… Storage Area, 501… Small Area

Prior Art Documents

Patent Documents

[0055]

Patent Document 1

Claims

1. A memory control device for writing to and erasing a flash memory, comprising: If there is a blank area in a predetermined storage area provided in the flash memory where data is not written, and the capacity of the blank area is sufficient for the capacity of the data to be written, a writing processing unit that writes the data to be written into the blank area; If there is no such blank area or the capacity of the blank area is insufficient for the capacity of the data to be written, an erasing processing unit that erases the entire storage area; A memory control device comprising the above.

2. The writing processing unit: When writing a predetermined setting, makes the capacity of the predetermined storage area to which the setting is to be written correspond to the capacity of a block, which is a unit of erasing processing in the flash memory; Makes the capacity of the area associated with one writing of the setting be an integer multiple of the capacity of the predetermined storage area; Sequentially uses each area obtained by multiplying the block by an integer multiple as the setting is updated. The memory control device according to Claim 1.

3. The erasing processing unit erases the data stored in the block prior to the next writing after the writing processing unit has used up all the areas obtained by multiplying the block by an integer multiple. The memory control device according to Claim 2.

4. A program that causes a computer included in a memory control device for writing to and erasing a flash memory to function as: If there is a blank area in a predetermined storage area provided in the flash memory where data is not written, and the capacity of the blank area is sufficient for the capacity of the data to be written, a writing processing unit that writes the data to be written into the blank area; If there is no such blank area or the capacity of the blank area is insufficient for the capacity of the data to be written, an erasing processing unit that erases the entire storage area. ​

Citation Information

Patent Citations

  • Printer device including nonvolatile memory

    JP1993113858A

  • Storage device using flash memory and its control method

    JP2000057061A

  • Nonvolatile storage device, image forming device provided with the same, its control method and its control program

    JP2005004515A

  • Data writing / reading control device, and data writing / reading control method

    JP2005092659A

  • Flash memory, memory control circuit, microcomputer and memory control method

    JP2007172259A