WO2013140516A1 - Procédé d'enregistrement, dispositif d'enregistrement et programme d'enregistrement - Google Patents

Procédé d'enregistrement, dispositif d'enregistrement et programme d'enregistrement Download PDF

Info

Publication number
WO2013140516A1
WO2013140516A1 PCT/JP2012/057062 JP2012057062W WO2013140516A1 WO 2013140516 A1 WO2013140516 A1 WO 2013140516A1 JP 2012057062 W JP2012057062 W JP 2012057062W WO 2013140516 A1 WO2013140516 A1 WO 2013140516A1
Authority
WO
WIPO (PCT)
Prior art keywords
recording
data
data set
record
data length
Prior art date
Application number
PCT/JP2012/057062
Other languages
English (en)
Japanese (ja)
Inventor
景扶 秋田
Original Assignee
富士通株式会社
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 富士通株式会社 filed Critical 富士通株式会社
Priority to PCT/JP2012/057062 priority Critical patent/WO2013140516A1/fr
Publication of WO2013140516A1 publication Critical patent/WO2013140516A1/fr

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/12Formatting, e.g. arrangement of data block or words on the record carriers
    • G11B20/1217Formatting, e.g. arrangement of data block or words on the record carriers on discs

Definitions

  • This case relates to a recording method, a recording apparatus, and a recording program.
  • the process of sequentially recording variable length data in a storage device is widely performed in various applications. For example, when executing a program or operating a device, log information of the program or device is recorded in a storage device. Such operation log information of the program and apparatus is indispensable when performing analysis when a failure occurs.
  • variable-length data may be referred to as “variable-length record”.
  • an operation log is recorded in a nonvolatile memory.
  • an object of the present invention is to provide a technique for sequentially recording variable length data in a storage area of a nonvolatile storage device.
  • the processing device has the variable length data and the variable data respectively from the first recording position to the second recording position in the storage area of the recording device.
  • the first recording position indicates the data length of the long data, sequentially records a data set including front and rear data length information recorded in front and rear of the variable length data, and the remaining recording area is insufficient.
  • the second recording position is changed to the first recording position in a state where the recorded data is overwritten with a new data set from the first recording position toward the second recording position.
  • this recording apparatus is a recording apparatus having a storage area, and variable length data and each variable length from the first recording position to the second recording position in the storage area of the recording apparatus.
  • a data set that indicates the data length of the data and sequentially records a data set including forward and backward data length information recorded in front and rear of the variable-length data, and is recorded at the first recording position according to the occurrence of a shortage of the remaining recording area. Returning from the first recording position to the second recording position, the recorded data is overwritten with a new data set, and then the second recording position is directed to the first recording position.
  • the recording program is a recording program for causing a computer to record data on the recording device.
  • the recording program causes the computer to move from a first recording position to a second recording position in a storage area of the recording device.
  • the variable length data and the data length of the variable length data are respectively indicated, the data set including the front and rear data length information recorded in front and rear of the variable length data is sequentially recorded, and the remaining recording area is insufficient. Accordingly, the second recording position is returned to the first recording position and the recorded data is overwritten with a new data set from the first recording position to the second recording position.
  • a data set in which forward data length information corresponding to the recording position of the forward data length information obtained from backward data length information from the position to the first recording position exists is continuous.
  • the first recording area to be found is specified, and the backward data length information corresponding to the recording position of the backward data length information obtained from the forward data length information from the first recording position toward the second recording position is An existing data set that does not reach the first recording area but is used as the recording start position of the next data set following the data set recorded at the position closest to the first recording area To execute the process.
  • variable length record recording method nonvolatile storage device, and variable length record recording program
  • the new data write start position and the read start position of data written in the nonvolatile storage device are determined from the nonvolatile storage device itself. Can be identified. For this reason, it is possible to sequentially record variable-length records in the storage area of the nonvolatile storage device.
  • FIG. 1 is a schematic diagram illustrating a hardware configuration of a system control unit 1 as an example of the first embodiment.
  • the system control unit (recording device) 1 is, for example, an information processing device or the like, and includes a CPU (Central Processing Unit) 5, a RAM (Random Access Memory) 7, and a nonvolatile memory 9.
  • the CPU 5 is a processor that reads a program from the RAM 7 and the nonvolatile memory 9 and executes processing as a variable-length record recording unit 3 described later.
  • a RAM (volatile storage device) 7 is a volatile memory that temporarily stores various data and programs when the CPU 5 performs calculations and controls.
  • the RAM 7 also stores temporary data (not shown) used by the variable length record recording unit 3.
  • the nonvolatile memory (nonvolatile storage device) 9 is a nonvolatile writable memory including a storage area 61 for storing data.
  • the nonvolatile memory 9 is, for example, an EPROM (Erasable Programmable ROM), an EEPROM (Electrically Programmable ROM), a UV-EPROM (Ultra-Violet Programmable Programmable ROM), or the like.
  • the nonvolatile memory 9 may be another writable nonvolatile memory such as a flash memory.
  • front means a direction in which the address value of the nonvolatile memory 9 decreases
  • backward means a direction in which the address value of the nonvolatile memory 9 increases.
  • head of the nonvolatile memory 9 means the minimum address area of the nonvolatile memory 9, and the tail or tail means the maximum address area.
  • present embodiment is not limited to this, and the present embodiment can be implemented with appropriate modifications.
  • the nonvolatile memory 9 has a storage area 61, and the storage area 61 has a data combination flag 115 (see FIG. 4) at the head.
  • the data combination flag 115 is set by the data combination flag setting unit 41 as described later with reference to FIG.
  • the variable-length record recording unit 3 receives data from a control program 93 executed by the CPU 3 or an operating system (OS) (not shown), and sequentially records this data in the storage area 61 of the nonvolatile memory 9. . At that time, the variable-length record recording unit 3 uses the record structure (data set) 100 described with reference to FIG. 2 to store data uniformly so that data writing is not concentrated on a specific part of the storage area 61. To do.
  • FIG. 2 is a diagram illustrating a record structure (data set) 100 used in the system control unit 1 as an example of the first embodiment.
  • Variable length data having this record structure 100 is stored in the storage area 61 of the nonvolatile memory 9 by the variable length record recording unit 3.
  • the record structure 100 shown in FIG. 2 includes a head flag 101, a forward data length (forward data length information, also called data length 1) 103, a rotation flag 105, overlapping position information 107, a data portion 109, a tail flag 111, and a rear It has a data length 113 (rear data length information, also called data length 2).
  • a record refers to one unit of data having the record structure 100.
  • the head flag 101 is a flag indicating the head of the record structure 100. In this example, for example, a value “0” is set.
  • the start flag 101 is, for example, 1 bit long.
  • the front data length 103 is a portion indicating the length of the data portion 109, and the same value as the rear data length 113 described later is set here.
  • the forward data length 103 is, for example, 7 bits long.
  • the head flag 101 and the forward data length 103 occupy 1 byte, and are collectively referred to as a first header byte 123.
  • the rotation flag 105 indicates that this record is a record written in the previous rotation (hereinafter referred to as the old record or the previous record) or a record written in the current rotation (hereinafter referred to as the new record or the current record). This is used to determine whether Here, the rotation refers to one sequential write from the beginning to the end of the storage area 61.
  • the rotation flag 105 is, for example, 1 bit long. In order to distinguish between the previous rotation record and the current rotation record, values “0” and “1” are alternately set in the rotation flag 105 for each rotation.
  • FIG. 3 is a diagram illustrating a method of using overlapping position information in an example of the first embodiment.
  • data bytes are expressed in hexadecimal.
  • the position of 1 byte in the new data section 109 to be written matches the position of the forward data length 103 of the old record, and this byte (hereinafter also referred to as a duplicate byte) has the same value as the forward data length 103 of the old record.
  • the duplication position information generation unit 43 to be described later reverses the bit “0x04” of the second byte of the data unit 109 of the new record to “0xFB”. Further, the duplication position information generation unit 43 sets a value “2” that is the bit position (second byte in this example) of the data portion 109 with the bit inverted in the duplication position information 107.
  • the data byte of the new data portion 109 to be written is compared with the first header byte 123 (first flag 101 + forward data length 103) of the old record. Since “0” is set, the forward data length 103 can be considered. Therefore, the byte position match is described as “the position of 1 byte in the new data portion 109 to be written matches the position of the forward data length 103”. In addition, the coincidence between the value of the duplicate byte and the first header byte 123 of the old record is described as “the duplicate byte and the forward data length 103 of the old record have the same value”.
  • the overlapping position information 107 is, for example, 7 bits long.
  • the rotation flag 105 and the overlapping position information 107 occupy 1 byte, and are collectively referred to as a second header byte 125.
  • the first header byte 123 and the second header byte 125 are collectively referred to as a header portion 121.
  • the data portion 109 is a variable length portion that stores data contents.
  • the data portion 109 is, for example, 1 to 127 bytes long.
  • the tail flag 111 is a flag indicating the end of data, and a value different from the head flag 101, for example, a value “1” is set.
  • the tail flag 111 is, for example, 1 bit long. As will be described later with reference to the example (6) in FIG. 6, this flag indicates that the old / old data boundary determination error occurs when the front data length 103 of the old record and the rear data length 113 of the new record overlap. Used to prevent.
  • the rear data length 113 is a portion indicating the length of the data portion 109, and here, the same value as that of the front data length 103 is set.
  • the backward data length 113 is, for example, 7 bits long.
  • the tail flag 111 and the backward data length 113 occupy 1 byte, and are collectively referred to as a footer unit 127.
  • the data length information is provided as the front data length 103 at the head of the data, and the rear data length 113 is also provided behind the data. It is arranged.
  • the minimum length of the data structure 100 illustrated in FIG. 2 is 4 bytes when the length of the data portion 109 is 1 byte.
  • the variable-length record recording unit 3 writes data in the storage area 61 in units of this record structure 100. Further, as shown in FIG. 4, the variable-length record recording unit 3 stores a data combination flag 115 in the first 1 byte of the storage area 61 of the nonvolatile memory 9, for example.
  • the data combination flag 115 itself is 1-bit information, and “0” is padded to the remaining 7 bits.
  • the data combination flag 115 is a flag indicating that the data is divided into two parts and stored across the end and the head of the storage area 61 because the data does not completely enter the remaining area at the end of the storage area 61. is there.
  • the value “1” is set in the data combination flag 115.
  • the variable-length record recording unit 3 adds the header part 121 and the footer part 127 to each of the divided data, generates two records, and writes them at the end and the top of the storage area 61, respectively. This division processing will be described later with reference to FIG.
  • FIG. 4 is a schematic diagram illustrating a functional configuration of the system control unit 1 as an example of the first embodiment.
  • the RAM 7 includes an overwrite position storage unit 51, a temporary record storage unit 53, and a rotation flag storage unit 55.
  • the overwrite position storage unit 51 is an area for storing an overwrite position described later.
  • the temporary record storage unit 53 is an area temporarily used when data is written to the storage unit 61 of the nonvolatile memory 9.
  • the rotation flag storage unit 55 is an area for storing a value set in the rotation flag 107 (see FIG. 2).
  • the CPU 5 is a processing device that realizes the variable-length record recording unit 3 by executing a variable-length record recording program (not shown) stored in the RAM 7 or the like.
  • the variable-length record recording unit 3 includes an oldest record specifying unit 11, a latest record specifying unit 13, a writing unit 15, and a reading unit 17.
  • the oldest record specifying unit 11 traces the storage area 61 of the nonvolatile memory 9 forward from the tail (second recording position; tail) to the head (first recording position), and is stored in the storage area 61.
  • the oldest record that can be read is specified.
  • the oldest record specifying unit 11 reads the forward data length 103 based on the backward data length 113, and the boundary between the latest record and the oldest record (hereinafter referred to as the oldest record) from the mismatch of the forward data length 103 and the backward data length 113.
  • the boundary is also referred to as a first recording area, data boundary position, or overwrite position).
  • the oldest record specifying unit 11 includes a record scanning unit 21, a data length acquisition unit 23, a data length comparison unit 25, a rotation flag comparison unit 27, and a head / tail flag determination unit 29.
  • the record scanning unit 21 sequentially reads records one by one from the end of the storage area 61 of the nonvolatile memory 9 toward the front, and reads the rear data length 113. For example, when the record scanning unit 21 moves to the next (one older) record, the record data in the storage area 61 (the value of the read back data length 113 +3) bytes ahead is used as the back data length of the next record. Read as the value of 113.
  • the data length acquisition unit 23 reads the front data length 103 based on the rear data length 113 read by the record scanning unit 21. For example, the data length acquisition unit 23 reads, as the front data length 103, an area ahead of the storage area 61 (the value of the rear data length 113 read by the record scanning unit 21 + 1) bytes.
  • the data length comparison unit 25 compares the forward data length 103 read by the record scanning unit 21 with the backward data length 113 to determine whether they match, and the forward data length 103 and backward data length 113 are compared. If they do not match, the record position is stored in the overwrite position storage unit 51 of the RAM 7.
  • the rotation flag comparison unit 27 compares the rotation flag 107 of the record read by the record scanning unit 21 with the rotation flag 107 of the previous (one new) record. Details of this processing will be described later using an example (3) in FIG.
  • the head / tail flag determination unit 29 determines whether the value of the head flag 101 before the forward data length 103 and the value of the tail flag 111 before the rear data length 113 are “0” or “1”.
  • the latest record specifying unit 13 traces the storage area 61 of the nonvolatile memory 9 from the top and specifies the position of the newest latest record among the records stored in the storage area 61. Based on the forward data length 103, the latest record specifying unit 13 follows from the front of the storage area 61 to the data boundary position (overwrite position) specified by the oldest record specifying unit 11, and then writes data. The position (recording start position of the next data set; second recording area) is specified.
  • the latest record specifying unit 13 includes a record scanning unit 31, a data length acquisition unit 33, and a latest record position specifying unit 35.
  • the record scanning unit 31 traces records one by one in order from the top to the back of the storage area 61 of the nonvolatile memory 9, and reads the forward data length 103. For example, when the record scanning unit 31 moves to the next (one new) record, the record scanning unit 31 sets the area behind (the value of the read forward data length 103 +3) bytes in the forward data length of the next record. Read as a value of 103.
  • the data length acquisition unit 33 reads the rear data length 113 based on the front data length 103 read by the record scanning unit 31. For example, the data length acquisition unit 33 reads a region behind the storage region 61 (the value of the forward data length 103 read by the record scanning unit 31 + 1) bytes as the backward data length 113.
  • the latest record position specifying unit 35 compares the forward data length 103 read by the record scanning unit 31, the backward data length 113 read by the data length acquisition unit 33, and the value stored in the overwrite position storage unit 51 of the RAM 7. Thus, it is determined whether or not the overwrite position stored in the overwrite position storage unit 51 of the RAM 7 is between the forward data length 103 and the backward data length 113.
  • the writing unit 15 writes a record to the storage area 61 of the nonvolatile memory 9. Specifically, the writing unit 15 generates a temporary record in the temporary record storage unit 53 of the RAM 7 and transfers data from the temporary record storage unit 53 to the storage area 61 when the generation of the record is completed.
  • the writing unit 15 includes a data combination flag setting unit 41, an overlapping position information generation unit 43, a rotation flag setting unit 45, and a record transfer unit 47.
  • the data combination flag setting unit 41 divides the data into two when the data does not fit at the end of the storage area 61 and sets the value “1” in the data combination flag 115 (see FIG. 3).
  • the duplicate position information generation unit 43 matches the position of 1 byte in the new data part 109 to be written with the position of the forward data length 103 of the old record (overlap), and the new data and the old record.
  • the forward data length 103 is the same value
  • the duplicate byte is bit-inverted.
  • the overlapping position information generation unit 43 records the position of the bit-inverted byte in the data portion 109 with reference to the head of the data portion 109 in the overlapping position information 107.
  • the value of the first header byte 123 is “0x04” because the top flag 101 of the old record is “0” and the forward data length 103 is “4”.
  • the second byte of the data portion 109 of the data to be written is also “0x04”.
  • the duplication position information generation unit 43 described later inverts the bit “0x04” of the second byte of the data unit 109 to “0xFB”. Further, the duplication position information generation unit 43 sets a value “2” that is the bit position (second byte in this example) of the data portion 109 with the bit inverted in the duplication position information 107.
  • the rotation flag setting unit 45 sets the rotation flag value stored in the rotation flag storage unit 55 of the RAM 7 to the rotation flag 107 of the data to be written. Also, the rotation flag setting unit 45 inverts the value of the rotation flag storage unit 55 of the RAM 7 when the write position returns to the top of the storage area 61, for example.
  • the record transfer unit 47 receives data to be written from the control program 93 or an OS (not shown), generates a record structure 100 based on this data, and stores it in the temporary record storage unit 53. Further, the record transfer unit 47 completes the processing of the data combination flag setting unit 41, the overlapping position information generation unit 43, and the rotation flag setting unit 45, and when the temporary record in the temporary record storage unit 53 is completed, Forward to 61.
  • the reading unit 17 reads the records written in the storage area 61 from the oldest order. Next, processing at the time of data writing in the variable-length record recording unit 3 as an example of the first embodiment will be described.
  • FIG. 5 is a flowchart showing processing at the time of data writing in the variable-length record recording unit 3 as an example of the first embodiment.
  • step S1 the process moves to the last record in the storage area 61 of the nonvolatile memory 9.
  • step S3 the data length acquisition unit 23 reads the rear data length 113 of the current record from the record scanning unit 21.
  • step S5 the data length acquisition unit 23 reads the forward data length 103 of the record based on the backward data length 113 read in step S3.
  • step S9 the data length comparison unit 25 determines whether the backward data length 113 read in step S3 is equal to the forward data length 103 read in step S5.
  • step S11 the rotation flag comparison unit 27 reads the current record read by the record scanning unit 21 and the preceding record. It is determined whether the rotation flags 107 of the (one new) records match. If the rotation flag 107 does not match in step S11 (see the NO route in step S11), in step S13, the head / tail flag determination unit 29 sets the value of the head bit 101 before the forward data length 103 to “0”. Determine whether it is set.
  • step S15 the data length comparison unit 25 determines the backward data length 113 and the forward data length 103.
  • the record that does not match is determined as the position where the latest record exists. That is, when the latest record is written at this position, the forward data length 103 of the old record is overwritten, and the values of the forward data length 103 and the backward data length 113 do not match. For this reason, the data length comparison unit 25 determines that the record in which the front data length 103 and the rear data length 113 coincide immediately before is the oldest record.
  • the data length comparison unit 25 stores the position of the latest record (hereinafter also referred to as an overwrite position) in which the values of the forward data length 103 and the backward data length 113 do not match in the overwrite position storage unit 51 of the RAM 7. .
  • This position is used in the search from the front by the latest record specifying unit 13.
  • the process proceeds to step S15.
  • step S11 If the rotation flag 107 matches in step S11 (see YES route in step S11), the process proceeds to step S7.
  • the record scanning unit 21 sets 1 in the storage area 61 of the nonvolatile memory 9 in step S7. Moves to the previous record (next oldest) record, and the backward data length 113 is read.
  • step S ⁇ b> 17 the record scanning unit 31 moves to the first record in the storage area 61 of the nonvolatile memory 9 and reads the forward data length 103.
  • step S19 the data length acquisition unit 33 reads the rear data length 113 of the record based on the front data length 103 read in step S17.
  • step S21 the latest record position specifying unit 35 stores the position stored in the overwrite position storage unit 51 between the forward data length 103 read in step S17 and the backward data length 113 read in step 8. It is determined whether (overwrite position) is included. When the overwrite position is not included between the forward data length 103 and the backward data length 113 (see NO route in step S21), the overwrite position has not yet been passed in the forward reading of the storage area 61. For this reason, in step S23, the record scanning unit 31 moves to the next record (new record) and reads the forward data length 103 of the record.
  • step S21 the processes in steps S19 to S23 are repeated until an overwrite position is included between the forward data length 103 and the backward data length 113. If the overwriting position is included between the front data length 103 and the rear data length 113 in the determination in step S21 (see YES route in step S21), the processing shifts to writing processing. The current record becomes the latest record, and the next write position is the position next to the latest record.
  • step S25 it is determined whether the position of the 1-byte byte in the data section 109 to be written next matches the position of the forward data length 103 of the oldest record, and whether both values match. For example, in the example of FIG. 3, the position of the second byte (value “0x04”) of the data to be written (data portion 109) and the position of the forward data length 103 (value “4”) of the old data are one. And both are the same value.
  • step S27 The overlap position information generation unit 43 bit-inverts the overlap position data. Further, the duplication position information generation unit 43 sets the bit-inverted position (relative position where the first byte of the data part in the record is 1) in the duplication position information 107 of the temporary record storage unit 53 of the RAM 7.
  • the overlapping position information generation unit 43 sets “0xFB” obtained by bit-inverting “0x04” of the second byte of the data to be written to the data portion of the temporary record storage unit 53 of the RAM 7. Write to the second byte of 109. Further, the duplication position information generation unit 43 writes “2” of the byte position with the bit inverted in the duplication position information 107 of the temporary record storage unit 53.
  • step S29 the record transfer unit 47 writes the forward data length 103, the backward data length 113, and the rotation flag 105 in the temporary record storage unit 53 of the RAM 7. Then, the record is transferred to the write position in the storage area 61 of the nonvolatile memory 9 and the record is written to the nonvolatile memory 9.
  • FIG. 6 is a diagram illustrating various data writing examples in the variable-length record recording unit 3 as an example of the first embodiment.
  • the dashed arrow indicates the first round of writing to the storage area 61 of the nonvolatile memory 9
  • the solid line arrow indicates the second round of writing.
  • the diagonally downward slanting portion on the left indicates the first header byte 123.
  • the horizontal line portion indicates the second header byte 125.
  • the diagonally downward hatched portion on the right indicates a footer portion 127.
  • data bytes are expressed in hexadecimal.
  • the example (1) in FIG. 6 shows processing when data is recorded for the first time (first round) in the storage area 61.
  • the rotation flag setting unit 45 sets a value “0” in the rotation flag storage unit 55 of the RAM 7.
  • the data combination flag 115, the record a, the record b, the record c, and the record d are sequentially written in the storage area 61.
  • the length of the data portion 109 is 3 bytes for record a, 4 bytes for record b, 2 bytes for record c, and 1 byte for record d.
  • the value “0” stored in the rotation flag storage unit 55 of the RAM 7 is written to the rotation flag 105 of the records a to d, and the overlap position information 107 has the value “0” because there is no overlap position. Is written. Therefore, the value of the second header byte 125 is “0x00”. Further, “0x83”, “0x84”, “0x82”, and “0x82” are respectively written in the footer portion 127 of the record.
  • the rotation flag storage unit 55 Inverts the value “0” stored in the rotation flag storage unit 55 of the RAM 7 in order to indicate the rotation change. Set. Then, as shown in Example (2), immediately after the data combination flag 115 in the storage area 61, a new record e having a length of 1 in the data portion 109 is written.
  • the value “1” stored in the rotation flag storage unit 55 is written to the rotation flag 105 of the record e, and the value “0” is written to the overlap position information 107 because there is no overlap position. . Therefore, the value of the second header byte 125 is “0x80”. Thereafter, the oldest record specifying unit 11 traces the record forward from the end of the storage area 61 as indicated by a left-pointing arrow. Since the value “3” of the backward data length 113 of the overwritten record “a” and the value “1” of the forward data length 103 of the record “e” do not match, the data length comparison unit 25 defines the boundary between the old and new data. It is determined that it exists in the vicinity.
  • the oldest record specifying unit 11 traces the record forward from the end of the storage area 61 as indicated by a left-pointing arrow. Since the value “3” of the backward data length 113 of the overwritten record “a” does not match the value “2” of the backward data length 113 of the record “e”, the data length comparison unit 25 defines the boundary between the old and new data. It is determined that it exists in the vicinity.
  • the next example (4) is another case where the position of the forward data length 103 of the old record and the forward data length 103 of the new record overlap. As shown in the example (4), immediately after the data combination flag 115 in the storage area 61, a new record e having a length of 3 in the data portion 109 is written.
  • the value “1” stored in the rotation flag storage unit 55 is written to the rotation flag 105 of the record e, and the value “0” is written to the overlap position information 107 because there is no overlap position. . Therefore, the value of the second header byte 125 is “0x80”. Thereafter, the oldest record specifying unit 11 traces the record forward from the end of the storage area 61 as indicated by a left-pointing arrow.
  • the data length comparison unit 25 determines that the value “3” of the backward data length 113 of the overwritten record a matches the value “3” of the backward data length 113 of the record e.
  • the rotation flag comparison unit 27 compares the rotation flags, so that the record b is the older data. Can be determined.
  • the next example (5) is a case where the positions of the forward data length 103 of the old record and the backward data length 113 of the new record overlap.
  • a new record e having a length of 4 in the data portion 109 is written.
  • the value “1” stored in the rotation flag storage unit 55 is written to the rotation flag 105 of the record e, and the value “0” is written to the overlap position information 107 because there is no overlap position. . Therefore, the value of the second header byte 125 is “0x80”.
  • the oldest record specifying unit 11 traces the record forward from the end of the storage area 61 as indicated by the left-pointing arrow.
  • the data length comparison unit 25 erroneously recognizes the value of the backward data length 113 of the record e as the forward data length 103, and the backward data length 113 of the record b in which the value “4” of the backward data length 113 is overwritten. It is determined that the value matches the value “4”.
  • the head / tail flag determination unit 29 has the value of the flag immediately before the value “4” of the backward data length 113 of the overwritten record b as “1”, and the comparison is made with the forward data length 103. However, since it is determined that the data length is the backward data length 113, it is determined that the boundary between the old and new data exists in this vicinity. In the next example (6), the position of the 1st byte (5th byte) in the data portion 109 of the new record matches the position of the forward data length 103 of the old record. In this case, the data length 103 does not match the value. As shown in the example (6), immediately after the data combination flag 115 in the storage area 61, a new record e having a length of 2 in the data portion 109 is written.
  • the value “1” stored in the rotation flag storage unit 55 is written to the rotation flag 105 of the record e, and the value “0” is written to the overlap position information 107 because there is no overlap position. . Therefore, the value of the second header byte 125 is “0x80”. Thereafter, the oldest record specifying unit 11 traces the record forward from the end of the storage area 61 as indicated by a left-pointing arrow. When the data length comparison unit 25 does not match the value of the backward data length 113 of the overwritten record b with the data of the data portion of the record e, the record b is invalid, and there is a boundary between the old and new data here. I can judge.
  • the position of the 1st byte (5th byte) in the data portion 109 of the new record matches the position of the forward data length 103 of the old record, and the byte to be written and the forward data of the old record This is a case where the value of the length 103 matches.
  • a new record e having a length of 2 in the data portion 109 is written.
  • the value “1” stored in the rotation flag storage unit 55 is written in the rotation flag 105 of the record e.
  • the byte is inverted.
  • the inverted byte position “5” is written in the overlap position information 107. Therefore, the value of the second header byte 125 is “0x85”.
  • the data length comparison unit 25 matches the value of the backward data length 113 of the overwritten record b with the data of the data portion of the record e.
  • this value is the same value as the forward data length 103 at the time of previous writing, and the corresponding portion is the data byte or the forward data length 103. Cannot be determined.
  • the data of the corresponding part is bit-inverted to “0xFB”, and the inverted byte position is recorded in the overlapping position information 107.
  • the next example (8) is a case where the position of the forward data length 103 of the old record and the position of the duplicate position information 107 of the new record overlap.
  • a new record e having a backward data length 113 is written immediately after the data combination flag 115 in the storage area 61, and subsequently a new record f having a length of 3 in the data portion 109 is written.
  • the data length of the old data is overwritten with the duplication position information 107 of the record f. Since the overlapping position information 107 is “0”, does not match the backward data length 113, and the value “0” is an invalid value for the data length, it can be determined that the boundary between the old and new data exists in this vicinity.
  • the broken-line arrows indicate the first round of writing to the storage area 61 of the nonvolatile memory 9
  • the solid-line arrows indicate the second round of writing.
  • the diagonally downward slanting portion on the left indicates the first header byte 123.
  • the horizontal line portion indicates the second header byte 125.
  • the diagonally downward hatched portion on the right indicates a footer portion 127.
  • data bytes are expressed in hexadecimal.
  • the variable length record recording unit 3 writes the data uniformly and evenly in the storage area 61.
  • the data is divided and recorded. Specifically, when the size of the data to be written and the total size of the header part 121 and the footer part 127 exceed the remaining capacity of the storage area 61, the data combination flag setting unit 41 divides the data to be written. At that time, the size of the data part 109 to be recorded at the end of the storage area 61 is expressed by the following formula (remaining capacity of the storage area 61) ⁇ (size of the header part 121 + size of the footer part 127). Is required. Data is divided by this size to form a data part 109, and a header part 121 and a footer part 127 are added to write a record.
  • the remaining data is similarly recorded from the top of the storage area 61 with the header part 121 and the footer part 127 added thereto.
  • the value “1” is set in the head data combination flag 115 of the storage area 61 in order to indicate that the tail record and the head record are originally one data.
  • the data combination flag setting unit 41 pads the remaining 7 bits of the first byte of the storage area 61 with, for example, “0” in order to match the byte boundary. .
  • the minimum record size is a total size of the header part 121, the data part 109, and the footer part 127 (for example, 4 bytes in the example of FIG. 2). Therefore, when the remaining area of the storage area 61 is smaller than this size, the remaining area is filled with “0”.
  • steps S1 to S23 in the flowchart of FIG. 8 are executed to specify the position of the oldest record and the position of the latest record. Since these processes are the same as steps S1 to S23 in the flowchart of FIG. 5, description thereof is omitted.
  • the reading unit 17 reads records in order from the oldest record.
  • step S ⁇ b> 33 the reading unit 17 determines whether the end of the storage area 61 has been reached. When the end of the storage area 61 has not been reached (refer to the NO route in step S33), in step S35, the reading unit 17 reads the previous (next oldest) record. The processes in steps S33 and S35 are repeated until the end of the storage area 61 is reached.
  • the reading unit 17 When the end of the storage area 61 is reached (see YES route in step S33), the reading unit 17 reads the top record in the storage area 61 in step S37. In step S39, the reading unit 17 determines whether or not the latest record has been reached. If the latest record has not been reached (see NO route in step S39), in step S41, the reading unit 17 reads the previous (next oldest) record.
  • the reading process is terminated.
  • the reading unit 17 reads data forward from the last record in the storage area 61, then moves to the top of the storage area 61, and reads records backward from the top record in the order of the latest record.
  • the data can be read in the order in which the data is written.
  • FIG. 9 is a schematic diagram illustrating a hardware configuration of the device 1 including the system control unit 1 as an example of the first embodiment.
  • the system control unit 1 performs some control on the control target 97.
  • the control target 97 is a server body.
  • the system control unit 1 includes a variable length record recording unit 3 and a control program 93 for actually controlling the control target 97.
  • the variable length record recording unit 3 of the system control unit 1 stores an operation log related to control and an abnormality log of the control target 97 in the storage area 61 of the nonvolatile memory 9.
  • the variable-length record recording unit 3 writes log data using the record structure 100 shown in FIG.
  • FIG. 12 For comparison with the present embodiment, an example of a technique for repeatedly recording a variable-length record having only forward data length information sequentially in a storage area is shown in FIG.
  • the data write start position (hereinafter also referred to as overwrite position) to the storage area and the storage area are already written.
  • the data read start position is managed.
  • (1) of FIG. 12 data is written from the beginning to the end of the storage area in the order of data A, data B, data C, and data D. Further, header information indicating the length of the data portion is added in front of these variable length data A to D, respectively.
  • data E is written after data D. After a part of the data E is written to the end of the storage area, it returns to the top of the storage area and the rest of the data E is written. In this case, since the data A recorded at the head of the storage area is overwritten by the data E, the oldest readable data becomes the data B. For this reason, the data read start position must be recognized as the head of data B (that is, header information of data B). Thereafter, data F is written after data E as shown in FIG.
  • this method has header information only at the beginning of the data. For this reason, as shown in (2) and (3) of FIG. 12, if the header portion of the data A is overwritten by returning to the beginning of the storage area, the position of the oldest record that can be read is unknown. End up. In order to avoid such a situation, it is conceivable to provide a data write start position and a read start position in the nonvolatile storage area. However, if a data write start position and a read start position are provided in the nonvolatile storage area, the frequency of writing at the position where these data are stored increases, and the element life of the nonvolatile storage area decreases.
  • the new data write start position and the storage area are written from the nonvolatile memory 9 itself. It is possible to specify the read start position of the read data. There is no need to store the data write start position and the read start position in the nonvolatile memory 9, and the variable length records 100 are evenly distributed over the entire area of the nonvolatile memory 9 without the writing frequency of the nonvolatile memory 9 being biased to a specific area. It can be recorded.
  • the duplicate byte is bit-inverted, and the bit-inverted position is the duplicate position information 107.
  • the head flag 101, the rotation flag 105, and the tail flag 111 are provided, it is possible to prevent the forward data length 103 and the backward data length 113 from being confused with other information. Also, by dividing the data using the data combination flag 115, the data can be packed to the end of the storage area 61, so that the data can be stored evenly.
  • FIG. 10 is a schematic diagram illustrating a configuration of a system control unit 1 ′ as an example of the present embodiment.
  • the system control unit 1 ′ of the present embodiment stores the next record write position 71, the previous data length arrangement information 73 for the previous rotation, and the current rotation information in the RAM 7. Forward data length arrangement information 75. Since the other configuration of the system control unit 1 ′ of the present embodiment is the same as that of the system control unit 1 of the first embodiment illustrated in FIGS. 1 and 4, the description and illustration thereof are omitted.
  • the next record writing position 71 is an address at which data writing to the storage area 61 is started.
  • the forward data length arrangement information 73 for the previous rotation is an area for storing the address (offset position) and the value of each forward data length 103 of all records written in the storage area 61 in the previous rotation.
  • the forward data length arrangement information 75 for the current rotation is an area for storing the address (offset position) and the value of each forward data length 103 of all records written in the storage area 61 in the current rotation.
  • the forward data length arrangement information 75 is created when the variable length record recording unit 3 writes data to the storage area 61.
  • the forward data length arrangement information 75 for the current rotation is collectively transferred to the forward data length arrangement information 73 for the previous rotation, and the current data for the current rotation is rotated.
  • the front data length arrangement information 75 is cleared.
  • FIG. 11 is a flowchart illustrating processing at the time of data writing in the variable-length record recording unit as an example of the second embodiment. Since the next record writing position 71, the forward data length arrangement information 73 for the previous rotation, and the forward data length arrangement information 75 for the current rotation are stored in the RAM 7, they are erased when the system controller 1 'is powered off. . For this reason, initialization of step S51 is performed after the system controller 1 'is powered on. In this initialization, the processing of steps S1 to S23 in FIG. 8 is executed to read data from the storage area 61 of the nonvolatile memory 9. Further, the next record position of the record determined in step S 21 in FIG. 8 is stored in the next record write position 71 of the RAM 7. Further, the forward data length 103 of all records stored in the storage area 61 is sequentially stored in the forward data length arrangement information 75 for the current rotation.
  • the writing unit 15 reads the writing position from the next record writing position 71 of the RAM 7 in step S53.
  • step S55 the writing unit 15 determines whether there is an overlap in the forward data length 103 of the current rotation forward data length arrangement information 75 in the RAM 7 that overlaps the range in which the latest record is written and the data matches. Whether or not is determined based on the address (offset).
  • step S57 The overlapping position information generation unit 43 bit-inverts the byte at the overlapping position. Further, the overlapping position information generating unit 43 sets the position of the byte with the bit inverted in the overlapping position information 107.
  • step S59 a record is written.
  • the forward data length 103 of the written record is stored at the end of the forward data length arrangement information 75 for the current rotation.
  • step S ⁇ b> 61 the writing unit 15 determines whether rotation has been performed, that is, whether writing has been performed to the end of the storage area 61.
  • step S63 the writing unit 15 transfers the forward data length arrangement information 75 for current rotation to the forward data length arrangement information 73 for previous rotation in a batch. Thereafter, the forward data length arrangement information 75 for rotation this time is cleared.
  • step S65 the writing unit 15 adds the address (offset position) and the value of the forward data length 103 of the written record to the end of the forward data length arrangement information 75 for current rotation.
  • step S67 the writing unit 15 updates the next record writing position 71.
  • the present invention is not limited to the configurations described in the above-described embodiments and modifications, and various modifications can be made without departing from the spirit of the present invention.
  • the data length shown in FIG. 2 is merely an example, and the data length can be appropriately changed according to the object controlled by the system control unit 1, the control program 93, and the OS log format (not shown).
  • the function and structure in each functional block shown in FIG. 4 are only examples, and the combination of the functions of each block may be changed as appropriate.
  • the execution order of the steps of the processing flow may be changed. Furthermore, although the duplication of the position between the forward data length 103 of the old data and the data to be written is determined in units of 1 byte, the duplication may be determined in units of multiple bytes.
  • the CPU 5 of the system control unit 1 or 1 ′ executes the variable-length record recording program, so that the variable-length record recording unit 3, the oldest record specifying unit 11, and the latest record shown in FIG.
  • Record identification unit 13 writing unit 15, reading unit 17, record scanning unit 21, data length acquisition unit 23, data length comparison unit 25, rotation flag comparison unit 27, head / tail flag determination unit 29, record scanning unit 31, It functions as the data length acquisition unit 33, the latest record position specifying unit 35, the data combination flag setting unit 41, the overlapping position information generation unit 43, the rotation flag setting unit 45, and the record transfer unit 47.
  • the RAM 7 of the system control unit 1 or 1 ′ includes the overwrite position storage unit 51, the temporary record storage unit 53, the rotation flag storage unit 55, the next record writing position 71, the previous data length arrangement information 73 for the previous rotation, and the current time It functions as forward data length arrangement information 7 for rotation.
  • variable-length record recording unit 3 oldest record specifying unit 11, latest record specifying unit 13, writing unit 15, reading unit 17, record scanning unit 21, data length obtaining unit 23, data length comparing unit 25, rotation Flag comparison unit 27, head / tail flag determination unit 29, record scanning unit 31, data length acquisition unit 33, latest record position specifying unit 35, data combination flag setting unit 41, duplicate position information generation unit 43, rotation flag setting unit 45 and a variable-length record recording program (variable-length record recording program) for realizing the function as the record transfer unit 47 are, for example, a flexible disk, CD (CD-ROM, CD-R, CD-RW, etc.), DVD (DVD-ROM, DVD-RAM, DVD-R, DVD + R, DVD-RW, DVD + W, HD DVD, etc.), a Blu-ray disc, a magnetic disk, an optical disk, such as a magneto-optical disk, is provided in a format recorded on a computer-readable recording medium.
  • a flexible disk CD (CD-ROM, CD-R, CD-RW, etc.)
  • DVD DVD-
  • the computer reads the program from the recording medium, transfers it to the internal storage device or the external storage device, stores it, and uses it.
  • the program may be recorded in a storage device (recording medium) such as a magnetic disk, an optical disk, or a magneto-optical disk, and provided from the storage device to the computer via a communication path.
  • Variable length record recording unit 3 oldest record specifying unit 11, latest record specifying unit 13, writing unit 15, reading unit 17, record scanning unit 21, data length acquiring unit 23, data length comparing unit 25, rotation flag comparing unit 27 , Head / tail flag determination unit 29, record scanning unit 31, data length acquisition unit 33, latest record position specifying unit 35, data combination flag setting unit 41, overlapping position information generation unit 43, rotation flag setting unit 45, and record
  • the program stored in the internal storage device in the present embodiment, the system control unit 1 or the RAM 7 of 1 '
  • the system control unit 1 the RAM 7 of 1 '
  • the computer may read and execute the program recorded on the recording medium.
  • the computer is a concept including hardware and an operating system, and means hardware that operates under the control of the operating system. Further, when an operating system is unnecessary and hardware is operated by an application program alone, the hardware itself corresponds to a computer.
  • the hardware includes at least a microprocessor such as a CPU and means for reading a computer program recorded on a recording medium.
  • the system control unit 1 or 1 'functions as a computer. have.
  • This technology can be used to record variable length records such as variable length log recording and data backup.
  • 1,1 'system controller (recording device) 100 record structure (data set, data) 101 head flag (information indicating the head of the data set) 103 Forward data length (forward data length information) 105 rotation flag (information indicating write rotation) 107 Duplicate position information (information of bit-inverted position) 109 Data part 11 Oldest record specifying part 13 Latest record specifying part 15 Writing part 111 End flag (information indicating the end of the data set) 113 Back data length (back data length information) 115 Data Combined Flag 123 First Header Byte 125 Second Header Byte 127 Footer 3 Variable Length Record Recording 5 CPU (Processor) 7 RAM (another storage device) 71 Position for writing next record 75 Data length arrangement information 9 Non-volatile memory (storage device) 97 Control target

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Cette invention consiste à : enregistrer séquentiellement, dans le sens allant du premier emplacement d'enregistrement vers le second emplacement d'enregistrement d'une zone de stockage (9) dans un dispositif d'enregistrement (1), un ensemble de données comprenant des données à longueur variable et des informations de longueur de données antérieures et postérieures (103, 113), les informations indiquant la longueur des mêmes données et étant enregistrées devant et derrière les mêmes données; faire revenir le processus au premier emplacement d'enregistrement et écraser les données enregistrées par un nouvel ensemble de données dans le sens allant du premier emplacement d'enregistrement vers le second emplacement d'enregistrement, dans lequel une première zone d'enregistrement est identifiée dans laquelle un ensemble de données est découvert d'une manière continue qui contient des informations de longueur de données postérieures correspondant à l'emplacement d'enregistrement d'informations de longueur de données postérieures déterminées à partir des informations de longueur de données postérieures dans le sens allant du second emplacement d'enregistrement vers le premier emplacement d'enregistrement; et régler l'emplacement d'enregistrement à l'emplacement de début d'enregistrement de l'ensemble de données suivant qui suit l'ensemble de données qui contient des informations de longueur de données postérieures correspondant à l'emplacement d'enregistrement d'informations de longueur de données postérieures déterminées à partir des informations de longueur de données postérieures dans le sens allant du premier emplacement d'enregistrement vers le second emplacement d'enregistrement, et qui est enregistré à l'emplacement le plus proche de la première zone d'enregistrement sans s'approcher de la première zone d'enregistrement.
PCT/JP2012/057062 2012-03-19 2012-03-19 Procédé d'enregistrement, dispositif d'enregistrement et programme d'enregistrement WO2013140516A1 (fr)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2012/057062 WO2013140516A1 (fr) 2012-03-19 2012-03-19 Procédé d'enregistrement, dispositif d'enregistrement et programme d'enregistrement

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2012/057062 WO2013140516A1 (fr) 2012-03-19 2012-03-19 Procédé d'enregistrement, dispositif d'enregistrement et programme d'enregistrement

Publications (1)

Publication Number Publication Date
WO2013140516A1 true WO2013140516A1 (fr) 2013-09-26

Family

ID=49222010

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/057062 WO2013140516A1 (fr) 2012-03-19 2012-03-19 Procédé d'enregistrement, dispositif d'enregistrement et programme d'enregistrement

Country Status (1)

Country Link
WO (1) WO2013140516A1 (fr)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS639587A (ja) * 1986-06-30 1988-01-16 凸版印刷株式会社 Icカ−ド
JP2001229068A (ja) * 2000-02-16 2001-08-24 Dainippon Printing Co Ltd Icモジュール
JP2002229847A (ja) * 2001-02-06 2002-08-16 Seiko Epson Corp フラッシュメモリのデータ管理装置
JP2007133487A (ja) * 2005-11-08 2007-05-31 Nec Corp ファイル管理方法、装置、およびプログラム

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS639587A (ja) * 1986-06-30 1988-01-16 凸版印刷株式会社 Icカ−ド
JP2001229068A (ja) * 2000-02-16 2001-08-24 Dainippon Printing Co Ltd Icモジュール
JP2002229847A (ja) * 2001-02-06 2002-08-16 Seiko Epson Corp フラッシュメモリのデータ管理装置
JP2007133487A (ja) * 2005-11-08 2007-05-31 Nec Corp ファイル管理方法、装置、およびプログラム

Similar Documents

Publication Publication Date Title
US9063838B1 (en) Data storage device shifting data chunks of alignment zone relative to sector boundaries
US8285965B2 (en) Aligning data storage device partition to boundary of physical data sector
JP4164118B1 (ja) フラッシュメモリを用いた記憶装置
US8935469B2 (en) Autonomic reclamation processing for tapes
JP4215746B2 (ja) 情報処理装置および寿命監視方法
JP2010020586A (ja) データ処理装置
KR20070046844A (ko) 소거/재기록 가능 메모리를 위해 고안된 호스트 장치에사용할 수 있는 한 번 또는 몇 번의 프로그램이 가능한메모리를 위한 방법 및 장치
JP2014044490A (ja) ホスト装置及びメモリデバイス
JP6005010B2 (ja) 複数のテープメディアに1つのファイルをスパニングする方法、ストレージ・システム、およびプログラム
KR20070089603A (ko) 정보 처리 장치 및 정보 처리 방법과 컴퓨터ㆍ프로그램
JP2008504628A (ja) 安全なフラッシング
JP2013161185A (ja) 磁気テープ装置及びその制御方法
CN114840449A (zh) 基于MCU片内flash的数据存储方法、装置、设备及存储介质
TWI519951B (zh) 資料儲存裝置以及快閃記憶體控制方法
KR20080066381A (ko) 소프트웨어의 업그레이드 방법
US20150199980A1 (en) Tape apparatus and write processing method
WO2013140516A1 (fr) Procédé d'enregistrement, dispositif d'enregistrement et programme d'enregistrement
JP2004362580A (ja) ストレージシステムおよびその動作方法、ならびにテープストレージ媒体装置
JPWO2013140516A1 (ja) 記録方法、記録装置及び記録プログラム
US9405668B1 (en) Data storage device initialization information accessed by searching for pointer information
JP2005243120A (ja) 情報記録装置、その制御方法、情報記録プログラム、記録媒体
US8996839B1 (en) Data storage device aligning partition to boundary of sector when partition offset correlates with offset of write commands
JP5533141B2 (ja) 書き込み装置、書き込み方法、及び書き込みプログラム
KR101083054B1 (ko) 플래쉬 메모리 덮어쓰기 방법 및 장치
JP2008191797A (ja) ファイルシステム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12872179

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2014505847

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12872179

Country of ref document: EP

Kind code of ref document: A1