WO2004068348A1 - 差分データ生成装置及び方法、更新後データ復元装置及び方法、並びにプログラム - Google Patents

差分データ生成装置及び方法、更新後データ復元装置及び方法、並びにプログラム Download PDF

Info

Publication number
WO2004068348A1
WO2004068348A1 PCT/JP2003/013383 JP0313383W WO2004068348A1 WO 2004068348 A1 WO2004068348 A1 WO 2004068348A1 JP 0313383 W JP0313383 W JP 0313383W WO 2004068348 A1 WO2004068348 A1 WO 2004068348A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
update
area
restoration
difference
Prior art date
Application number
PCT/JP2003/013383
Other languages
English (en)
French (fr)
Inventor
Nobuaki Tanaka
Kentarou Iida
Takanosuke Adachi
Original Assignee
Matsushita Electric Industrial Co., Ltd.
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 Matsushita Electric Industrial Co., Ltd. filed Critical Matsushita Electric Industrial Co., Ltd.
Priority to EP03756702A priority Critical patent/EP1589430A1/en
Priority to AU2003303838A priority patent/AU2003303838A1/en
Priority to US10/543,967 priority patent/US20060200502A1/en
Publication of WO2004068348A1 publication Critical patent/WO2004068348A1/ja

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/654Updates using techniques specially adapted for alterable solid state memories, e.g. for EEPROM or flash memories
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • G06F8/658Incremental updates; Differential updates

Definitions

  • the present invention relates to a data update method for updating data in the own device using difference data, and relates to a difference data generation device and method, an after-update data restoration device and method, and a program used in the data update method.
  • a terminal device such as a personal computer, a personal digital assistant (PDA), or a mobile phone
  • PDA personal digital assistant
  • the target program is executed in order to improve the program.
  • a so-called version upgrade may be performed to update the version of the data that contains it.
  • data such as software before update (hereinafter referred to as “before update data”) recorded on a rewritable recording medium such as a flash ROM or a hard disk is used. Version) (to be referred to as updated data hereinafter).
  • Non-Patent Document 1 a method of transferring update data via a communication path such as a network and updating the data.
  • the transmitting device compares the pre-update data with the post-update data to extract the difference, and transfers only the difference data
  • the receiving terminal device transfers the pre-update data in the device.
  • a procedure for restoring the updated data from the difference data and updating the data is used (for example, see Patent Document 1).
  • the difference is extracted in parts (referred to as blocks) (for example, see Non-Patent Document 1).
  • the detailed difference extraction technique in Non-Patent Document 1 is described in Non-Patent Document 2.
  • This difference extraction technique is called the Block-Move algorithm, and compares the pre-update data with the post-update data to search for a matching data sequence, and the matching data sequence is used as it is from the pre-update data to the post-update data.
  • the data is copied in such a way that it moves as Move data, and the difference data is created by adding and writing a new data string as Add data for the data string that does not match.
  • FIG. 11 shows a pseudo code used for extracting difference data.
  • (P, q, 1) in the pseudo code is an instruction to move continuous data, and means that one (ell) byte from address p of the pre-update data can be carried to address q of the post-update data.
  • p i to p 3 indicate addresses in the pre-update data. If the pre-update data is in the memory, p 1 to; 3 is the difference between the address in the memory and the head address of the pre-update data. If there is pre-update data on the file, p1 to p3 are represented by the distance from the beginning of the file. (11 to (13 are addresses in the post-update data, and have the same meanings as p1 to p3 in the pre-update data.)
  • FIG. 12 shows an example of the data.
  • FIG. 12 (A) shows the data before update
  • FIG. 12 (B) shows the data after update
  • FIG. 12 (C) shows the difference data.
  • the output from the pseudo code in Fig. 11 is (i> 2, q2, 2) (p 3, q 3, 2) (pl, ql, 3).
  • This command is transferred as differential data to the terminal device on the receiving side, and is applied to the data before update in FIG. 12 (A) at the terminal device, whereby the updated data in FIG. 12 (B) can be obtained.
  • the difference data to be transferred becomes small, and the receiving terminal can restore and generate updated data based on the small amount of difference data to update the data. It becomes.
  • Non-Patent Document 2 when generating difference data, By comparing each block obtained by dividing the data in a predetermined unit, instead of comparing the entire data, the time required for extracting the difference can be reduced. If the difference between the pre-update data and the post-update data is small and the pre-update data is mostly in the same block of the post-update data, the difference is extracted by referring to only a part of the data in block units as described above. It is possible to greatly reduce the amount of calculation for. Also, in this case, the increase in the amount of differential data by dividing into blocks is not so large, and the differential data can be kept small.
  • Non-Patent Document 1 By referencing the preceding and following blocks in this way, it is possible to copy data that has moved significantly across blocks from the pre-update data to the post-update data, thus further reducing the amount of differential data. it can.
  • a normal computer is assumed as a terminal device that receives the difference data for updating and the like and updates the data. It is not considered for use in embedded devices such as portable information terminals. Embedded devices such as mobile phones have the following special features.
  • an area (also referred to as an updatable area or a code area) for holding data to be updated such as a device program on a rewritable non-volatile memory such as a flash ROM and the like when the user uses it.
  • An area that holds stored data, etc., and that is not to be rewritten when updating data (also referred to as non-updatable area or user area) may be mixed.
  • the post-update data cannot be saved during the update. If an attempt is made to write the updated data to the area where the updated data is stored in parallel with the restoration of the updated data, the contents of the unupdated data referred to during restoration using the differential data will be changed. I cannot do a correct restoration.
  • FIG. 13 is a diagram for explaining a problem when restoring and writing of updated data are performed in parallel.
  • the non-updatable user areas 501, 503 and the updatable area code areas 502, 504 are mixed.
  • the data update operation in the state where the data is present will be described.
  • blocks a to g of code regions 502 and 504 are updated.
  • the data is updated by referring to the pre-update data of the reference range 5 1 2 (block b in the example shown) starting from the rewrite address 5 11 1 at the address 5 10 in the memory.
  • the updated data is restored based on the data, and the updated data is written to the write range 5 13 (block b).
  • the reference range 5 12 and the write range 5 13 overlap, and the data in the reference range 5 12 changes during the restoration and writing operations, making it impossible to restore the updated data. It becomes.
  • the updated data is restored by referring to a plurality of blocks before and after as described in the related art, the user area that is the non-updatable area and the code area that is the updatable area are separated. If the code areas are mixed and discontinuous, or blocks with different block sizes are mixed in the code area, correct restoration cannot be performed.
  • the area in which the difference extraction means updates data is continuous. It interprets that it is and extracts the difference.
  • the data may not be correctly restored because it may refer to different data than when the difference was extracted There is a risk.
  • FIG. 14 is a diagram illustrating a problem when the code area that is the updatable area is discontinuous.
  • the user areas 501 and 503 which are non-updatable areas
  • the code areas 500, 504 which are updatable areas
  • the data update operation of the blocks a to g in the code areas 502 and 504 in the state where the data is mixed will be described.
  • Fig. 14 (A) when the pre-update data 540 is divided into uniform and continuous block sizes according to the conventional method, and the difference is extracted by comparing multiple blocks.
  • the reference range 551 for block b and the reference range 552 for block d are compared between the pre-update data and the post-update data. Will do.
  • FIG. 14 (B) When restoring the updated data, as shown in FIG. 14 (B), on address 510 of rewritable nonvolatile memory 500, reference range 531 for block b and reference range 531 for block d Reference range 5 32 will be referred to.
  • the block d refers to the user area 503, and there are parts 5 3 3 and 5 5 3 where the contents of the reference destination are different between the time of difference extraction and the time of restoration, and data can be restored correctly. Can not. Also, in this case, since the user area and the code area are not recognized to be distinguished, data may be written to the user area.
  • the pre-update data is expanded on the rewritable nonvolatile memory 500 as shown in FIGS. 15 (A) and (B). It is also conceivable that dummy data 561 and 562 are inserted and expanded in the user area so that the layout is the same as that described above, and the difference is extracted using the expanded pre-update data 560.
  • the reference range 571 for the block b and the reference range 572 for the block d are compared between the pre-update data and the post-update data. For comparison reference.
  • the block d refers to the dummy data 562 when extracting the difference, and refers to the user area 503 different from the dummy data 562 when restoring the updated data. 5 3 3 and 5 7 3 are generated, and data restoration cannot be performed correctly.
  • the present invention relates to a case where a non-updatable area and an updatable area are mixed on a memory, and a storage area for pre-update data / updated data is discontinuous, or a storage area having a different block size is mixed. Even in this case, it is an object of the present invention to provide a differential data generation device and method, a post-update data restoration device and method, and a program that enable data to be correctly and efficiently executed with a simple calculation procedure.
  • the present invention firstly provides a differential data generation device that generates differential data for rewriting data from pre-update data to post-update data, wherein the data-recovery-side data regarding the pre-update data and the post-update data
  • Area setting means for setting a reference range of data before update at the time of difference extraction based on storage area information including arrangement information of storage areas in the data storage means;
  • Difference extracting means for comparing and referencing the data before update to generate difference data; and header information including address information of target data at the time of data restoration in the data storage means on the data restoration side in the generated difference data.
  • a difference file generating means for generating the added difference file.
  • the updatable area for storing the data to be updated and the non-updatable area for storing the user data are mixed and the updatable area is discontinuous.
  • the difference extracting means can generate difference data by referring to only one continuous updatable area based on the storage area information.
  • the restoration-side device can normally restore the updated data from the pre-update data and the difference data by referring to only one continuous updatable area based on the header information in the difference file. It is.
  • a storage area information holding means for holding the storage area information wherein the data storage means on the data restoration side stores the pre-update data or the post-update data in units of blocks.
  • the storage area information includes address information of a storage area for storing the pre-update data and the post-update data in the data storage unit on the data restoration side;
  • a storage area in which addresses on the data storage means are continuous and composed of one or more blocks of the same block size is defined as one updatable area, and the start address, end address, and It shall include the block size.
  • the difference is determined by referring to only one continuous updatable area based on the storage area information. It is possible to generate data, and it is possible to prevent a problem in which difference data is generated by referring to another area.
  • the reference range is set as a reference range of the data before update at the time of extraction so as to refer to a plurality of blocks combining the target block and one or more blocks before and after the target block based on the storage area information. If the reference range obtained from the target block does not fit in the updatable area, an area that is within the reference range and that is within the updatable area is newly set as the reference range. Shall be.
  • the pre-update data and post-update data consist of multiple blocks
  • other data is generated based on the storage area information. It is possible to generate difference data by referring to only one continuous updatable area without straddling the area. In this case, the data amount of the difference data can be reduced by referring to a plurality of blocks. Therefore, the restoration-side device can normally restore data while referring to a plurality of blocks even if the updatable area of the data storage means is discontinuous.
  • the header information includes address information indicating a writing range of updated data at the time of data restoration in the data restoration unit on the data restoration side.
  • the address information includes a reference range of the pre-update data at the time of data restoration in the data storage unit on the data restoration side.
  • the restoration-side device uses the header information to store the difference data and the pre-update data.
  • the process of restoring the updated data by referring to the data and the process of writing the restored updated data can be executed appropriately, so that when the data is restored, it is referred to over other areas or blocks that are still within the reference range are restored. It is possible to prevent a problem such as writing data after updating. For this reason, it is possible to normally rewrite the data before update to the data after update. In addition, these operations can be performed without requiring storage area information.
  • the present invention provides a differential data generation method for generating differential data for rewriting data from pre-update data to post-update data, wherein the pre-update data and the post-update data are related to the data restoration side.
  • a difference extraction step of generating difference data by comparing and referring to the pre-update data, and adding the address information of the target data at the time of data restoration in the data storage means on the data restoration side to the generated difference data.
  • the updatable area for storing the data to be updated and the non-updatable area for storing the user data are mixed and the updatable area is discontinuous.
  • the restoration-side device can normally restore the post-update data from the pre-update data and the difference data by referring to only one continuous updatable area based on the storage area information.
  • the data storage means on the data restoration side has a storage area for storing the pre-update data or the post-update data in block units, and the storage area information is the data restoration side.
  • a storage area consisting of one or a plurality of blocks having consecutive addresses on the storage means and having the same block size is defined as one updatable area, and the start address, end address, and block size of each updatable area are defined as
  • the difference extraction is performed.
  • the reference range is set as a reference range of the data before update based on the storage area information so as to refer to a plurality of blocks combining the target block and one or more blocks before and after the target block. If the reference range obtained from the target block does not fit in the updatable area, an area that is within the reference range and within the updatable area is newly set as the reference range. I do.
  • the pre-update data and the post-update data are composed of multiple blocks, and the difference data is generated by referring to multiple blocks that combine the target block and the blocks before and after it, other data is generated based on the storage area information. It is possible to generate difference data by referring to only one continuous updatable area without straddling the area. In this case, the amount of difference data can be reduced by referring to a plurality of blocks. Therefore, the restoration-side device can normally restore data while referring to a plurality of blocks even if the updatable area of the data storage means is discontinuous.
  • the present invention provides a program for causing a computer to execute the procedure of the differential data generation method according to the sixth or seventh aspect.
  • the non-updatable area and the updatable area are mixed on the data storage means on the restoration side, the storage areas for the pre-update data and the post-update data are discontinuous, and the storage areas of different block sizes are used. Even when there is a mixture of data, it is possible to execute data updating correctly and efficiently with a simple calculation procedure.
  • the present invention relates to an after-update data restoring device for restoring after-update data from before-update data and rewriting data by using difference data received via communication means, And data storage means for storing the updated data; reception means for receiving difference data sent via the communication means and address information of target data in the data storage means at the time of data restoration; Data restoring means for restoring post-update data from the pre-update data and the difference data with reference to the pre-update data of the reference range specified in the data storage means specified based on the address information; Buffer means for holding the updated data; And a data writing means for writing the updated data into a writing area in the data storage means specified based on the address information.
  • the data storage means can have an updatable area for storing the data to be updated and a non-updatable area for storing user data and the like, so that the updatable area is discontinuous.
  • the restoration means can restore the updated data by referring to only one continuous updatable area based on the address information. In this case, processing such as address conversion is not required at the time of restoration, and restoration processing can be performed with few simple procedures.
  • the address information is a storage area including arrangement information of a storage area in the data storage unit regarding the pre-update data and the post-update data in the differential data generation device that generates the differential data. Information is stored and is generated based on this storage area information, and includes a writing range of updated data at the time of data restoration in the data storage means.
  • the address information includes a reference range of pre-update data at the time of data restoration in the data storage means.
  • the restoration process of the post-update data by referring to the difference data and the pre-update data and the write process of the restored post-update data can be appropriately executed in a small amount of memory, and other areas can be restored at the time of restoration. It is possible to prevent such a trouble that the data is referred to over a plurality of blocks or the updated data is written in a block still in the reference range. For this reason, it is possible to normally rewrite the data before the update to the data after the update on one data storage memory.
  • the data storage means divides the pre-update data into a plurality of blocks in block units and stores the blocks.
  • the storage area of the data storage means is transmitted to the differential data generation device.
  • a storage area in which addresses on the data storage means are continuous and one or a plurality of blocks of the same block size is defined as one updatable area
  • the data restoring means refers to a plurality of blocks obtained by combining the target block in the data storage means and one or more blocks before and after the block based on the address information as the reference range H, and refers to the updated data. Restore and block the target If the reference range obtained from is not within the updatable area, an area that is within the reference range and within the updatable area is newly referred to as the reference range and restored.
  • the buffer unit includes a plurality of regions each configured by a buffer of a ring buffer system and holding updated data restored for each of the blocks
  • the data writing unit includes: When the writing range of the updated data held in the buffer unit in the data storage unit deviates from the reference range at the time of data restoration by the data restoration unit, the corresponding updated data is stored in the data storage unit from the buffer unit. In this case, it is assumed that an instruction is given to open the holding area for the updated data after the completion of writing in the buffer means.
  • the data storage means is reduced to a minimum memory capacity.
  • the present invention provides a post-update data restoring method for rewriting data by restoring post-update data from pre-update data using difference data received via communication means, and Receiving the address information of the target data at the time of data restoration in the data storage means for storing the transmitted differential data and the pre-update data, and the data storage means specified based on the address information.
  • the updatable area for storing the data to be updated and the non-updatable area for storing user data and the like in the data storage means are discontinuous and the updatable area is discontinuous.
  • processing such as address conversion is not required at the time of restoration, and restoration processing can be performed with few simple procedures.
  • the address information is a differential data generation device that generates the differential data, wherein the storage area information including the storage area arrangement information in the data storage unit with respect to the pre-update data and the post-update data.
  • the data storage means is generated based on the storage area information, and includes a write range of updated data at the time of data restoration in the data storage means. Is divided into a plurality of blocks for each block, and stored in the storage area of the data storage means.According to the storage area information held in the differential data generation device, the addresses on the data storage means are consecutive, In addition, a storage area consisting of one or more blocks of the same block size constitutes one updatable area.
  • the data restoration step based on the address information, a plurality of blocks obtained by combining a target block in the data storage unit and one or more blocks before and after the target block are set as the reference range. And restoring the post-update data, and when the reference range obtained from the target block does not fit in the updatable area, an area that is within the reference range and is within the updatable area. It is assumed that the reference range is newly referred to and restored.
  • the address information includes a reference range of the pre-update data at the time of data restoration in the data storage means.
  • the pre-update data and post-update data consist of multiple blocks, and the updated data is referenced by referring to multiple blocks that combine the target block and blocks before and after it.
  • the data can be normally read by referring to only one continuous updatable area without straddling other areas based on the address information. Data can be restored.
  • the updated data restored for each of the blocks is stored in a plurality of buffer units by using a buffer unit configured with a buffer of a ring buffer system and having a plurality of areas.
  • the write range of the updated data held in the buffer means in the data storage means is referred to at the time of data restoration in the data restoration step.
  • the corresponding updated data is written from the buffer means to the data storage means, and thereafter, an instruction is given to release the holding area of the written updated data in the buffer means.
  • the buffer means of the ring buffer method it is possible to easily and appropriately execute the restoration processing of the updated data and the writing processing of the restored updated data by using the data storage means with the minimum memory capacity, In one data storage memory, it is possible to normally rewrite data from before update to data after update.
  • the present invention provides, 18thly, a program for causing a computer to execute the procedure of the post-update data restoration method described in any one of the above 14th to 17th.
  • the non-updatable area and the updatable area are mixed on the data storage means on the restoration side, the storage areas for the pre-update data and the post-update data are discontinuous, and the storage areas of different block sizes are used. Even when there is a mixture of data, it is possible to execute data updating correctly and efficiently with a simple calculation procedure.
  • FIG. 1 is a block diagram showing a functional configuration of a data updating device that realizes a data updating method according to an embodiment of the present invention.
  • FIG. 2 is a diagram showing an example of the contents of the code area information file and the structure of the data storage memory according to the present embodiment.
  • (A) shows the contents of the code area information file
  • (B) shows the structure of the data storage memory.
  • FIG. 3 shows the difference for one block in the combined file according to the present embodiment.
  • FIG. 4 is a diagram showing an example of a file format
  • FIG. 4 is a diagram showing an address and a reference range when restoring the block b of the code area in the data storage memory according to the present embodiment
  • FIG. 5 is a flowchart showing an operation procedure for generating difference data in the difference data generation and transmission unit of the present embodiment.
  • FIG. 6 is a flowchart showing an operation procedure of the post-update data restoration in the difference data restoration unit of the present embodiment
  • FIG. 7 is a diagram showing a specific example of an operation at the time of data restoration by the updated data restoration algorithm shown in FIG. 6 for each step.
  • FIG. 8 is a diagram showing a specific example of an operation at the time of data restoration by the updated data restoration algorithm shown in FIG. 6 for each step.
  • FIG. 9 is a graph showing the relationship between the number of reference blocks and the difference data size when the difference data generation method according to the present embodiment is applied.
  • FIG. 10 is a diagram showing a specific example of an operation at the time of data restoration according to a conventional method for each step as a comparative example with respect to the present embodiment.
  • FIG. 11 is a diagram showing pseudo code used for differential data extraction.
  • Fig. 12 shows an example of data when data is updated.
  • (A) shows data before update
  • (B) shows data after update
  • (C) shows these difference data.
  • FIG. 13 explains the problems when restoring and writing the updated data in parallel when updating data in one rewritable nonvolatile memory using the conventional data update method.
  • Fig. 14 explains the problem when the code area, which is the updatable area, is discontinuous when updating data in one rewritable nonvolatile memory using the conventional data update method.
  • FIG. 15 shows dummy data inserted in order to avoid differences in the position of the reference range when restoring data when updating data in one rewritable nonvolatile memory using the conventional data update method.
  • FIG. 7 is a diagram for explaining a problem in the case where the above operation is performed.
  • 101 is data before update
  • 102 is data after update
  • 105 is a combined file
  • 110 is a difference data generation and transmission unit
  • 110 is a data storage unit
  • 1 1 2 Is a difference extraction section
  • 1 13 is a transmission buffer
  • 1 14 is a transmission section
  • 1 15 is a code area information file
  • 1 16 is a code area setting section
  • 1 17 is a control section
  • 1 18 is an area Information storage unit
  • 120 is a differential data restoration unit
  • 1 21 is a data storage memory
  • 122 is a reception unit
  • 123 is a reception buffer
  • 124 is a restoration unit
  • 125 is a restoration buffer
  • 1 26 is the memory write section
  • 1 27 is the control section
  • 130 is the network
  • 150 is the rewrite address
  • 152 is the reference range
  • 150 3 is the write range
  • 201, 203 is a user area
  • 202 and 204 are code areas.
  • FIG. 1 is a block diagram showing a functional configuration of a data updating device that realizes a data updating method according to an embodiment of the present invention.
  • a data updating apparatus a configuration and an example of an operation when updating a version of data including an operation program and the like stored in a terminal device such as a mobile phone will be described.
  • a difference data generation / transmission unit 110 provided in a server device and a difference data restoration unit 120 provided in a terminal device such as a mobile phone are connected by a wired or wireless communication device. It is configured to be connected via network 130.
  • This data update device is used, for example, to update data in a terminal device via a communication line by transferring difference data from a server device to the terminal device via a network of a mobile communication system via a wireless communication network. Used for etc.
  • the difference data generation and transmission unit 110 is composed of a data storage unit 111 composed of a hard disk or the like for storing the pre-update data 101 and the post-update data 102, the pre-update data 101 and the post-update data 110.
  • a difference extraction unit 1 1 2 that extracts the difference from 2 to generate difference data
  • a transmission buffer 1 13 that stores a combined file 1 05 for transmission that combines the generated difference data
  • a transmitting unit 114 for transmitting data such as 5 to the differential data restoring unit 120 via the network 130.
  • an area information storage unit 118 that stores a code area information file 115 that includes a code area (updatable area) block arrangement information in the memory of the receiving terminal device, and a code area information file 11 1 Based on the contents of 5
  • a code area setting unit 116 for setting and instructing the difference extracting unit 112 is provided, and a control unit 117 for controlling each unit.
  • the code area setting unit 116, the area information storage unit 118, and the control unit 117 implement the function of the area setting means described in the claims.
  • the code area information file 115 corresponds to the storage area information described in the claims
  • the area information storage unit 118 corresponds to the storage area information holding means described in the claims.
  • the difference extracting unit 112 and the control unit 117 realize the function of the difference extracting means described in the claims.
  • the difference extraction unit 112, the transmission buffer 113, and the control unit 117 realize the function of the difference file generation means described in the claims.
  • the difference data restoring unit 120 is provided with a data storage memory 121 such as a rewritable nonvolatile memory (flash ROM, etc.) for storing data such as a program to be updated.
  • a receiving unit 122 for receiving data such as the combined file 105 sent from the difference data generating and sending unit 110; a receiving buffer 123 for storing the received combined file 105;
  • a restoration unit 124 that restores the updated data for each block while referring to the combined file 105 and the data before update in the data storage memory 121, and a restoration that temporarily stores the restored updated data.
  • the data storage memory 121 corresponds to the data storage means described in the claims
  • the restoration buffer 125 corresponds to the buffer means described in the claims.
  • the receiving unit 122 and the receiving buffer 123 realize the function of the receiving means described in the claims.
  • the restoration unit 124 and the control unit 127 realize the function of the data restoration means described in the claims.
  • the memory writing section 126 and the control section 127 realize the function of the data writing means described in the claims.
  • data to be updated such as a program, such as a user area 201, a code area 202, a user area 203, a code area 204,.
  • the code area (updatable area) 202 and 204 that holds the data, and the user area (non-updatable area) 201 and 203 that hold the data that is not updated, such as user data, are mixed.
  • the case where the block size is different between the area 202 and the code area 204 is shown.
  • an outline of a data flow at the time of data update will be described.
  • the pre-update data 101 and the post-update data 102 are stored in a continuous data state. That is, as shown in FIG. 1, even if the code areas 202 and 204 are discontinuous in the data storage memory 121 of the terminal device, the plurality of code areas 103 and 104 corresponding to this are not continuous. Stored with the data combined.
  • Each of the code areas 103 and 104 represents a group of blocks of the same size when the pre-update data and the post-update data are stored in the memory.
  • the pre-update data 101 is al to gl. It is assumed that the updated data 102 stores a2 to g2. As described above, the data before update 101, the data after update 102, the combined file 105 of the difference data, and the like are separated in units of blocks.
  • the block is a unit at the time of batch erasing in the data storage memory 121 of the differential data restoration unit 120. It is assumed that the pre-update data 101 and the post-update data 102 are provided from another device or the like.
  • the difference extraction unit 112 extracts a difference between the pre-update data 101 and the post-update data 102 based on the instruction of the control unit 117.
  • the pre-update data 101 and the post-update data 102 stored in the data storage unit 111 are compared with each other by the Block-Move algorithm described above to search for a matching data string.
  • the data string to be copied is copied as it is as Move data from the data before the update to the data after the update, and the data string that does not match is the differential data that includes an instruction to add and write a new data string as Add data.
  • Generate The method of generating the difference data is described in detail in Non-patent Documents 1 and 2. In the present embodiment, an example in which difference data is generated for each block by comparing and referring to a plurality of blocks including before and after an update target block will be described.
  • the difference extraction unit 112 attaches header information to the difference data generated for each block, creates a combined file 105 as transmission data of a predetermined unit, and stores this in the transmission buffer 113. I do.
  • This combined file 105 is a set of differential data a 1 2 to g 1 2 indicating the location of the change from the pre-update data 101 to the post-update data 102. Are combined.
  • the connection file 105 is transmitted from the transmission section 114 via the network 130.
  • the differential data restoring unit 120 the combined file 105 transferred from the differential data generating and transmitting unit 110 is received by the receiving unit 122 and stored in the receiving buffer 123.
  • the restoration unit 124 restores the post-update data with reference to the combined file 1 5 in the reception buffer 123 and the pre-update data in the data storage memory 122.
  • the updated data is restored for each block by referring to a plurality of blocks including before and after the block to be updated. Then, the restoration unit 124 temporarily stores the updated data restored for each block in the restoration buffer 125.
  • the restoration buffer 125 is divided into a plurality of (two in the example shown) areas 125a and 125b, and the size of each area is the largest in the data storage memory 121. Is the same as the size of the block.
  • the restoration buffer 125 is managed by a ring buffer system, and data writing and reading are sequentially performed. The details of the ring buffer are described in detail by Kiyoshi Ishihata, “Algorithms and Data Structures”, Iwanami Koza Software Science, Iwanami Shoten, 1989, pp.46-48.
  • the data storage memory 121 stores pre-update data before data update starts.
  • the restoration unit 124 shifts the reference range in the data storage memory 121 by one block toward the block with the larger address. Then, the memory writing unit 126 writes the restored updated data held in the restoration buffer 125 to the block in the data storage memory 121 that is no longer referred to.
  • the area of the restoration buffer 125 storing the written updated data is released.
  • FIG. 2 (A) shows an example of the contents of the code area information file 1 15.
  • the line number 16 1 is shown for the sake of convenience for ease of explanation, and does not exist in the actual code area information file 115.
  • FIG. 2B illustrates an example of the structure of the data storage memory 121.
  • embedded devices such as terminal devices, such as mobile phones, often use a rewritable nonvolatile memory such as a flash ROM for storing data such as software programs.
  • reading can be referred to only by specifying the address in the same way as ordinary RAM, but data must be changed in a unit called a block, and then erased and written with new data. No. Even within a single device, the block size may differ depending on the address space.
  • Flash ROM the code area for storing codes (programs) and the user area for storing user data are sometimes divided into blocks.
  • 0x1000 force, 0x5000-1 and 0x7000 to 0x8800-1 are code regions 202, 204, and 0x0 force, etc.
  • 0x1000-1 and 0x5000 to 0x7000-1 are user areas 201 and 203.
  • the code area 202 corresponds to four blocks of addresses 0xl000 to 0x5000-l and blocks a to d.
  • the code area 204 corresponds to three blocks of addresses 0x7000 to 0x8800-l and blocks e to g.
  • the user area 201 corresponds to addresses 0 ⁇ 0 to 0 ⁇ 1000-1
  • the user area 203 corresponds to addresses 0x5000 to 0x7000-l.
  • the code area information file 115 shows information on the block arrangement of the code areas 202 and 204.
  • One code area is represented by a range enclosed by curly braces ⁇ following the reserved word codearea representing the code area.
  • curly braces ⁇ the value of each element is specified by the head indicating the start address of the code area, the tail indicating the end address of the code area, and the blocksize indicating the size of each block in the code area. I have.
  • the first code region 202 is shown in the first to fifth lines.
  • the head shows that the start address of the code area is 0x1000.
  • the tail shows that the final address of the code area is 0x5000-1.
  • the block size is all 0x1000 in the code area.
  • the start address force is 0x7000
  • the last address force is 0x8800-1
  • the block size is 0x800.
  • the format of the combined file 105 will be described with reference to FIG.
  • the combined file 105 adds header information to difference data generated by comparing the pre-update data and the post-update data for each block on the data storage memory 121, and combines the data in predetermined units or in whole units.
  • the difference data of each block with header information added is also called a difference file.
  • Figure 3 shows an example of the format of the difference file for one block.
  • the difference file format 170 of one block includes a block data length 171, a rewrite address 1772, and a block difference data 1773.
  • the block data length 17 1 indicates the total length of the difference file for one block.
  • the rewrite address 1772 is generated with reference to the code area information file 115, and indicates the head address of the area where the restored updated data is stored in the data storage memory 121.
  • the block difference data 173 is one block of difference data extracted and generated by the difference extraction unit 112.
  • the difference file contains, as header information added to the difference data, address information indicating the writing range of the restored updated data at the rewrite address 1772, as well as the pre-update data at the time of data restoration. It is also possible to include the address information indicating the reference range and transfer it to the data restoration side.
  • FIG. 4 shows an address and a reference range when the block b of the code area 202 in the data storage memory 121 is restored.
  • the target block and one block before and after the target block are referred to when generating the difference data and restoring the updated data.
  • the reference range 152 on the address 150 of the data storage memory 121 is from block a to block c, that is, 0xl000 to 0x5000-l.
  • the write range 1553 is block b, that is, 0x2000 to 0x3000-l.
  • the rewrite address 15 1 when writing the updated data is the start address of the write range 15 3, that is, 0x2000.
  • the rewrite address 155 is provided before the block difference data 173 in the difference file format 170 as shown in FIG.
  • the difference extracting unit 112 adds based on the code area arrangement information obtained from the defining unit 116.
  • FIG. 5 is a flowchart showing an operation procedure of difference data generation in the difference data generation and transmission unit of the present embodiment.
  • the flowchart in FIG. 5 consists of a double loop consisting of an outer loop for processing all code regions and an inner loop for processing all blocks in each code region.
  • a case will be described in which, when generating the difference data, the target block of the data before update and the data after update and one block before and after the target block, that is, three blocks in total.
  • the outer loop (steps S401 to S402) performs processing for all code areas defined in the code area information file 115.
  • the control unit 117 checks whether or not a code area to be processed remains in the code area information file 115 (Step S401). If no code area remains, the operation ends. If a code area remains, the code area setting unit 116 is instructed to read one code area from the code area information file 115 (step S402). Then, the control unit 117 performs the processing for the one read code area in the next loop from step S 403 to step S 409, and then executes step S 410 Return to and continue execution of the outer loop.
  • the inner norape (steps S403 to S409) performs processing on one code area read in step S402.
  • control unit 117 determines whether or not an unprocessed block remains in the code area being processed (step S403). Here, if there is no unprocessed block, the process returns to step S401 to proceed to the processing of the next code area. If an unprocessed block remains, the flow advances to step S404.
  • the control unit 117 extracts the first block, that is, the block with the smallest start address, from the block of blocks for which difference extraction has not been performed to generate difference data (step S404). Then, the control unit 117 determines whether or not the extracted block is the head in the code area (step S405). Here, if it is the head of the code area, the process proceeds to step S 406, and the difference extraction unit 1 1 2 is configured to perform the difference generation while referring to a total of two blocks, the block being processed and the block immediately after it. Indicate to (Step S406). However, if there is only one block in the code area, only the block being processed is referenced. Next, after the end of step S406, the control unit 117 returns to step S403 and repeats the processing.
  • step S405 determines in step S405 that the block is not the head of the code area
  • the process proceeds to step S407, and determines whether the block being processed is the end of the code area.
  • Step S407 determines whether the block being processed is the end of the code area.
  • it is instructed to the difference extraction unit 112 to generate a difference while referring to a total of two blocks of the previous block and the block being processed (step S4). 0 8).
  • step S408 the control unit 117 returns to step S403 and repeats the processing.
  • the difference extraction unit 112 If the block being processed is not at the end of the code area in step S407, the difference extraction unit 112 generates the difference while referring to the block being processed and a total of three blocks of one block before and after. (Step S409).
  • each of the above outer and inner loops is implemented by a program, it can be implemented by a program showing repetition of a for statement, a while statement, etc. in C language and Java language.
  • step S402 the part enclosed in curly braces following the keyword codearea in the code area information file 115 in FIG. It means reading in order from.
  • the code area following the already read code area is the force remaining in the code area information file 115, or the code area that was read last without remaining Check if there is no data after the end of the file (only insignificant data such as blanks, line feeds, tabs, comments, etc.).
  • the inner loop processes one code region read in step S402 in the outer loop.
  • the code area information file 1 15 indicates the start address, end address, and block size of the code area.
  • the inner loop uses the initial value of one variable as the first address, the value used to determine when to end, the last address, Change with one iteration (repeated) This can be realized by a for statement that uses the value whose number increases as the block size.
  • FIG. 6 is a flowchart showing the operation procedure of the post-update data restoration in the difference data restoration unit of the present embodiment.
  • a difference file is used to refer to the target block of the pre-update data and one block before and after the target block, for a total of three blocks.
  • the control unit 127 extracts the first difference file (corresponding to the first block) from the reception buffer 123 (step S501).
  • This difference file contains difference data for each block and information on the rewrite address (write range).
  • the rewrite address includes information indicating the write range of the restored post-update data. However, the rewrite address may include information indicating the reference range of the pre-update data at the time of data restoration together with the write range.
  • the restoration unit 124 is instructed to restore one block while referring to the reference range of the data storage memory 121 (step S520). Then, the restored updated data is written to the restoration buffer 125 (step S503).
  • step S504 it is determined whether or not the difference file remains in the reception buffer 123 (step S504). If no difference file remains, the process proceeds to step S510, and the contents written in the restoration buffer 125 being processed are transferred to the block indicated by the write destination address of the data storage memory 122. Write (step S510). If a difference file remains, the process proceeds to step S505, in which the first difference file in the reception buffer 123 is extracted (step S505), and the extracted difference file and the data storage memory are stored. The restoration unit 124 is instructed to restore the data of one block while referring to the reference range of 121 (step S506). Thereafter, the restored updated data is written to an empty area of the restoration buffer 125 (step S507).
  • step S5 the updated data written in the restoration buffer 125, which was restored just before, is written to the corresponding block of the data storage memory 121 according to the write destination address of the data (step S5). 0 8).
  • step S5 the area of the restoration buffer 125 referred to in step S508 is released (step S509). Then, returning to step S504, the next difference file Move to the processing of the file.
  • the post-update data a 2 is restored and one area of the restoration buffer 125 (first area) Store in 1 2 5 a.
  • the reference range at this time is a to c, which is the sum of the target block b and the preceding and following blocks a and c.
  • the post-update data b 2 is restored and the other area of the restoration buffer 1 25 (second (Area) Store in 1 2 5 b.
  • the updated data of the block a is written.
  • the writing range at this time is the target block a, and the updated data a2 accumulated in the first area 125a of the restoration buffer 125 is written to the block a of the data storage memory 122.
  • the first area 125a of the restoration buffer 125 storing the updated data a2 that has been written is released.
  • the updated data of block c is restored.
  • the reference range at this time is b to d, which is the sum of the target block c and the preceding and following blocks b and d.
  • the post-update data c2 is restored to restore the first area of the released restoration buffer 125. Store in 1 2 5 a.
  • the updated data of the block b is written.
  • the writing range is the target block b
  • the updated data b 2 accumulated in the second area 125 b of the restoration buffer 125 is written to the block b of the data storage memory 122.
  • the updated The second area 125b of the restoration buffer 125 storing the subsequent data b2 is released.
  • the updated data of the block d is restored.
  • the reference range is c to d, which is the sum of the target block d and the previous block c.
  • the post-update data d2 is restored and stored in the second area 1 25b of the restoration buffer 125. I do.
  • the updated data of the block c is written.
  • the writing range is the target block c
  • the updated data c2 stored in the first area 125a of the restoration buffer 125 is written to the block c of the data storage memory 122.
  • the first area 125a of the restoration buffer 125 storing the updated data c2 having been written is released.
  • the updated data of the block d is written.
  • the writing range is the target block d
  • the updated data d2 accumulated in the second area 125b of the restoration buffer 125 is written to the block d of the data storage memory 122.
  • the difference extraction unit 112 when generating the difference data, performs the difference extraction while referring to the enlarged reference range, and furthermore, the restriction of the reference range in the blocks near the beginning and end of the code area is restricted. Therefore, it is necessary to correct the conditional branch in steps S405 and S407 in FIG.
  • FIG. 9 is a graph showing the relationship between the number of reference blocks and the difference data size when the above-described difference data generation method is applied to a certain embedded device.
  • the data before update and the data after update are each 16 Mbytes (bytes), and the size of one block is 128 bytes.
  • the figure shows the results obtained by calculating the change in the data amount of the difference data with respect to the increase in the number of reference blocks using the sample data obtained.
  • the restoration buffer When restoring one block by referring to only one block, the total amount of differential data is about 6.5 Mbytes, and the compression ratio is about 40%. In this case, the restoration buffer only needs to be one block. Also, when referring to a total of 3 blocks including 1 block before and after, as in the above example, the sum of the data amount of the differential data is reduced to about 3.5 Mbytes, and the compression ratio is about 22%. is there. In this case, the restoration buffer should prepare an area for 2 blocks. When a total of 5 blocks are referenced, including the two blocks before and after, the total amount of differential data is reduced to about 1.7 Mbytes, and the compression ratio is about 11%. In this case, the area of the restoration buffer required is 3 blocks. From Fig.
  • a restoration buffer for 2 blocks may be provided, and when the number of reference blocks is 5, a restoration buffer for 3 blocks may be provided.
  • the difference data generation / transmission unit 110 stores the code area information file 115 corresponding to the code area arrangement information in the data storage memory 121 of the difference data restoration unit 120.
  • a reference range is set based on the code area information file 115, and the addresses are continuous and the same in the data storage memory 121 of the difference data restoration unit 120.
  • the difference between the pre-update data and the post-update data is extracted in block units for each code area of one block size. In other words, the code area addresses of different block sizes are not compared and referenced across the discontinuous code areas, so that the difference data is not generated.
  • a rewrite address is generated based on the code area information file 115, and the rewrite address is added to the difference data as header information to generate a difference file (combined file 105).
  • the rewrite address is address information on the data storage memory 122, including information on a write range for writing the updated data restored using the difference data.
  • the rewrite address includes reference range information for restoring updated data using differential data. You may do it.
  • the difference data restoring unit 120 upon receiving the combined file 105, refers to the specified reference range based on the header information of the combined file 105, and updates the pre-update data and the difference data. After the data can be restored. In this case, processing such as address conversion is not required on the restoration side, and correct updated data can be restored with few simple processing steps.
  • the difference data generation and transmission unit 110 generates difference data by referring to the blocks before and after the block including the target block, and the difference data restoration unit 120 uses this difference data to generate the difference data before and after the block including the target block. Restore the updated data by referring to the block and write it to the restoration buffer 125.
  • the differential processing can be performed. It is possible to reduce the amount of data.
  • the data stored in the data storage memory 121 is no longer referred to during restoration in the updated data accumulated after restoration.
  • the data after updating the block is written sequentially, and the data before updating is rewritten.
  • the data storage memory 121 requires a minimum memory capacity, and can easily and correctly store data with a small amount of hardware resources. Updates can be made.
  • the memory capacity of the restoration buffer 125 can also be reduced by the ring buffer method.
  • the capacity of the data storage memory 121 is limited, and data is rewritten from pre-update data to post-update data in the same block. Even in such a case, store the restoration buffer 125 and the combined file 105, which are twice the size of the maximum block length of this data storage memory 121 (when referencing three blocks before and after restoration).
  • the data in the data storage memory 121 can be updated only by providing the reception buffer 123 on the RAM.
  • Non-patent Document 1 and Non-patent Document 2 described in the prior art.
  • Such data update methods mainly target devices with large-capacity storage devices, such as hard disks, and store the pre-update data area to be referenced during restoration in the storage device and the restored post-update data. It is assumed that the area is different.
  • an embedded device with a limited storage area such as a mobile phone
  • the pre-update data and the post-update data are stored in the flash ROM.However, updating the program by installing twice the flash ROM to store both data is difficult. It is difficult in terms of cost and mounting area.
  • the restored data after update can be expanded on the RAM once, and the expanded data can be written to the flash ROM.However, if the RAM has insufficient capacity, all the updated data cannot be expanded. This is also difficult to achieve. Also, in the case of RAM, there is a major disadvantage that increasing capacity leads to an increase in power consumption.
  • data can be updated with the minimum hardware resources.
  • a code area storing data of a program or the like to be updated and a user area storing user data or the like arbitrarily stored by a user are mixed, and the code area is stored in the data storage memory 1. Even if they are arranged discontinuously on the 2 1, it is possible to correctly restore updated data while referring to a plurality of blocks. Further, since processing can be executed only for the code area while distinguishing between the code area and the user area, it is possible to prevent the user area from being referred to at the time of data restoration or from writing data to the user area by mistake.
  • the code area and the user area are separated. Since the reference range and the write range can be set only at the file or memory location without recognizing them separately, the reference range differs between when generating the difference and when restoring the data, and the data cannot be restored normally. If dummy data is inserted so that it has the same layout as when the pre-update data is expanded on the data storage memory 121, the dummy data is referred to when the difference is generated in a part where the code area is discontinuous. It cannot be restored normally because it is different from the contents of the user area that should be referenced when restoring data.
  • the difference generation and the data restoration can be performed by referring only to the contiguous blocks of the same size in the code area, the updated data can be restored normally. It is. In addition, processing such as address conversion is not required when data is restored at the receiving device, and the updated data can be restored with simple processing steps.
  • FIG. 10 shows an operation at the time of data restoration by a conventional method as a comparative example.
  • This comparative example is described corresponding to the operation in the present embodiment shown in FIG. 7 and FIG.
  • a case is shown in which a user area 602 indicated by oblique lines in the drawing exists between four blocks a to d in the data storage memory 601.
  • the updated data is restored and stored in the restoration buffer 603, and the updated data after restoration is stored.
  • Writing to the block in the writing range of the memory 601 will be performed.
  • the user area 602 is referred to as a reference range, and the data can be restored normally. Can not.
  • a code area to be updated and a user area not to be updated are mixed, and blocks of different sizes are mixed in the same memory.
  • the data can be updated correctly and with a simple calculation procedure. That is, by providing the code area information file and the code area setting means, the data in the rewritable nonvolatile memory in which the code area and the user area are mixed can be rewritten by using only a small amount of memory while referring to a plurality of blocks. The practical effect is great.
  • the present invention is not limited to the above-described embodiment at all, and can be implemented in various modes without departing from the gist thereof.
  • blocks that are continuous in the memory space and have the same size are used as the code area. This is particularly effective when data movement is limited within the code area defined in the definition. It is effective and can generate and restore differences using a simple algorithm. When data is frequently moved between discontinuous blocks in the memory space, the blocks in the range in which the data is moved are treated as one logical code area regardless of the continuity in the memory space. In this way, efficient difference generation and restoration can be performed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Stored Programmes (AREA)

Abstract

本発明の課題は、メモリ上で更新対象のデータを格納する更新可能領域が他の領域が混在するなどして不連続であっても、少ないメモリ容量でデータ更新を正しくかつ単純な計算手順で効率良く実行可能にすることである。差分データ生成送出部(110)において、差分データ復元部(120)のデータ格納メモリ(121)におけるコード領域の配置情報に相当するコード領域情報ファイル(115)を設ける。差分データ復元部(120)では、復元部(124)において、コード領域情報ファイル(115)に基づき生成された書換えアドレスにより指定された参照範囲を参照して、差分データと更新前データとから更新後データを復元する。これにより、他の領域にまたがって参照して復元処理してしまうことを防止でき、復元側でアドレス変換などの処理が不要であり、少ない簡単な処理ステップで正しい更新後データの復元が可能となる。

Description

明 細 書 差分データ生成装置及び方法、 更新後データ復元装置及び方法、 並びにプログラ ム
<技術分野 >
本発明は、 差分データを用いて自装置内のデータを更新するデータ更新方法に 関し、 このデータ更新方法に用いる差分データ生成装置及び方法、 更新後データ 復元装置及び方法、 並びにプログラムに関する。 く背景技術 >
パーソナルコンピュータ、 携帯情報端末 (P D A) 、 携帯電話機など、 所定の プログラムに基づくプロセッサの動作によつて装置動作の少なくとも一部を実行 する端末装置では、 プログラムの改良などのために、 対象のプログラムを含むデ ータのバージョンを更新する、 いわゆるバージョンアップが行われることがある 。 このようなデータのバージョン更新時には、 フラッシュ R O M、 ハードデイス クなどの書換え可能な記録媒体に記録された更新前のソフトウエア等のデータ ( 以下、 更新前データと称する) 力 他のバージョン (一般には新しいバージョン ) のソフ トゥユア等のデータ (以下、 更新後データと称する) に書き換えられる 。 この場合、 単純に更新前データを更新後データに置き換えることもできるが、 更新前データと更新後データとの差分データを生成し、 この差分データを基に更 新前データから更新後データを生成して書き換えることも従来より多く行われて いる。
このようなデータ更新方法の一つとして、 ネットワークなどの通信路を介して 更新用のデータを転送してデータ更新を行うものが提案されている。 この場合、 送信側装置で更新前データと更新後データとを比較して差分を抽出し、 その差分 データのみを転送して、 受信側の端末装置では装置内にある更新前データと転送 されてきた差分データとから更新後データを復元し、 データを更新するような手 順が用いられる (例えば、 特許文献 1参照) 。 上記のような差分データを用いたデータ更新技術を実用に使う際には、 更新前 のデータ全体と更新後のデータ全体とを比較して差分を抽出するのではなく、 全 体をいくつかの部分 (ブロックと称する) に分けて差分を抽出することが行われ ることがある (例えば、 非特許文献 1参照) 。 なお、 上記非特許文献 1における 詳細な差分抽出技術は非特許文献 2に示されている。
ここで、 非特許文献 2に示された差分抽出技術の概要を図 1 1〜図 12を参照 して説明する。 この差分抽出技術は、 Block-Moveアルゴリズムと呼ばれるもので 、 更新前データと更新後データとを比較して一致するデータ列を検索し、 一致す るデータ列はそのまま更新前データから更新後データへ Moveデータとして移動 するようにしてコピーし、 一致しないデータ列は新たなデータ列を Addデータと して追加して書き込むことで、 差分データを生成するものである。
図 11は差分データ抽出に用いる疑似コードを示したものである。 擬似コード 中の(p, q, 1 )は連続したデータの移動の命令であり、 更新前データの p番地 からの 1 (エル) バイトを更新後データの q番地に運べという意味を表す。 p i から p 3は更新前データ中のアドレスを示す。 更新前データがメモリ上にある場 合は、 p 1から; 3はメモリ上のァドレスと更新前データの先頭ァドレスとの差 である。 ファイル上に更新前デ タがある場合は、 p 1から p 3はファイルの先 頭からの距離で表される。 (11から(13は、 更新後データ中のアドレスであり、 意味は更新前データにおける p 1から p 3と同様である。
図 12はデータの一例を示したもので、 図 12 (A) は更新前データ、 図 12 (B) は更新後データ、 図 12 (C) はこれらの差分データをそれぞれ示す図で ある。 図 12 (A) , (B) のような更新前データ及び更新後データの場合、 図 11の疑似コードからの出力は、 図 12 (C) に示すように、 (i> 2, q 2, 2 ) (p 3, q 3, 2) (p l, q l, 3) となる。 この命令を差分データとして 受信側の端末装置に転送し、 端末装置において図 12 (A) の更新前データに対 して適用することにより、 図 12 (B) の更新後データを得ることができる。 上記のようなデータ更新方法を用いることによって、 転送する差分データが小 さくなり、 受信側の端末装置では少量の差分データを基に更新後データを復元生 成してデータを更新することが可能となる。
また、 上記非特許文献 2に示されるように、 差分データを生成する際にデータ 全体を比較するのではなく、 所定単位でデータを分割したプロックごとを比較す ることにより、 差分抽出にかかる時間を短縮できる。 更新前データと更新後デー タの違いが少なく、 更新前データがほとんど更新後データの同じブロック内にあ る場合、 上記のようにブロック単位でデータの一部分のみを参照することで、 差 分抽出のための計算量を大幅に減らすことが可能である。 またこの場合、 プロッ クに分けることによる差分データ量の増大はあまり大きくなく、 差分データを小 さく維持できる。
一方、 ブロック間のデータの移動量が大きく、 1対 1のブロックの比較による 差分抽出のみでは十分に差分データを小さくすることができない場合には、 1対 1ではなく、 前後の複数のブロックと書換えるブロックの更新後データを比較し て差分データを生成し、 更新前データの前後の複数プロックを参照しながら更新 後データを復元する方法も知られている。 この方法は上記非特許文献 1に示され ている。 このように前後ブロックをも参照することによって、 ブロックをまたが つて大きな移動をしているデータについても更新前データから更新後データにコ ピーすることができ、 差分データの量をより減らすことができる。
(特許文献 1 )
特開平 8— 2 5 5 1 0 4号公報 (図 7 )
(非特許文献 1 )
James J. Hunt, iem-Phong Vo, Walter F. Tichy, 「Delta Algorithms: An Empirical Analysis」 , ACM Transactions of Software Engineering and Methodology, ACM (Association for Computing Machinery), 1998年 4月, 第 7 巻, 第 2号, p.192-214
(非特許文献 2 )
Walter F. Tichy, 「The Strmg-to-String Correction Probrem with Block Moves」 , ACM Transactions on Computer Systems, ACM (Association for Computing Machinery), 1984年 11月, 第 2巻, 第 4号, ρ·309·321
しかしながら、 上記従来例におけるデータ更新方法においては、 更新用の差分 データ等を受信してデータ更新を行う端末装置に通常のコンピュータを想定して おり、 メモリ等のハードウェア資源に制約の多い携帯電話機、 携帯情報端末など の組込み系機器での使用が考慮されていない。 携帯電話機などの組込み系機器では、 下記のような特殊性が存在する。
( 1 ) プログラムを更新する際に、 ワーキング領域やデータ格納領域として用い られる R AMゃフラッシュ R OM等のメモリにおいて、 更新前データを保持しな がら、 更新前データが格納されているのとは違う領域に更新後データを格納しよ うとしても、 すべての更新後データを格納するために十分なメモリ領域が確保で きない場合が多い。
( 2 ) 最近の機器では、 フラッシュ R OM等の書換え可能不揮発性メモリ上に、 装置プログラム等の更新すべきデータを保持する領域 (更新可能領域、 コード領 域とも称する) と、 ユーザが使用時に格納したデータ等を保持する領域でデータ 更新の際に書換え対象としない領域 (更新不可領域、 ユーザ領域とも称する) と が混在することがある。
このような特殊性を持つ機器で、 上記従来例のようなデータ更新方法をそのま ま用いようとすると、 下記のような不都合が生じる。
第 1に、 メモリ上に更新前データと更新後データの双方を格納する領域が十分 にないため、 更新の際に更新後データを保存できない。 また、 更新後データの復 元と並行して更新前データが格納されている領域に更新後データを書き込もうと すると、 差分データを用いて復元時に参照する更新前データの内容が変わってし まい、 正しい復元をすることができない。
図 1 3は更新後データの復元と書き込みを並行して行う場合の問題点を説明す る図である。 ここでは、 上記のように書換え可能不揮発性メモリ 5 0 0において 更新不可領域であるユーザ領域 5 0 1 , 5 0 3と更新可能領域であるコード領域 5 0 2 , 5 0 4とが混在している状態でのデータ更新動作を説明する。 図示のよ うに、 コード領域 5 0 2, 5 0 4のブロック a〜gを更新することとする。 この場合、 データ更新を行う際に、 メモリのアドレス 5 1 0上の書換えァドレ ス 5 1 1を先頭とする参照範囲 5 1 2 (図示例ではプロック b ) の更新前データ を参照して、 差分データを基に更新後データを復元するとともに、 この更新後デ ータを書き込み範囲 5 1 3 (プロック b ) に書き込むことになる。 このとき、 参 照範囲 5 1 2と書き込み範囲 5 1 3とが重なっており、 復元及び書き込みの動作 中にも参照範囲 5 1 2のデータが変化してしまい、 更新後データの復元ができな くなる。 また、 フラッシュ R OMへのデータ書き込みの際には、 1つのブロック全体を 消去してデータを書き込む必要があり、 この点からも、 同一ブロック内を参照し ながらの復元は困難である。
更新前データと更新後データとの比較によって抽出した差分データを用いて更 新後データを復元する際には、 変化のない更新前データの参照が必要である。 コ ンピュータ上でデータ更新を行う場合のように、 更新前データの領域とは別の領 域に更新後データを復元して格納する場合は、 上記問題は生じないが、 図 1 3の ようにメモリ容量等の制約があり同一の領域において更新前データから更新後デ ータへ書き換える必要がある場合は、 上記従来例のようなデータ更新方法をその まま適用することができない。
第 2に、 従来の技術で述べたような前後の複数プロックを参照して更新後デー タを復元するようにした場合は、 更新不可領域であるユーザ領域と更新可能領域 であるコード領域とが混在してコード領域が不連続であったり、 コード領域にお いてプロックサイズが異なるプロックが混在していると、 正しい復元をすること ができない。
現在の組込み機器は大規模化、 複雑化しており、 そのメモリ配置、 使用法が上 記のような不連続コ一ド領域、 不均一なブロックサイズを含むことがある。
1つのプロックごとの比較のみではなく前後の複数のプロックを比較して復元 データを生成する際に、 同一サイズのブロックが連続していない場合は、 差分抽 出手段がデータ更新する領域が連続していると解釈して差分を抽出してしまう。 データ復元時にこの差分データを基に前後の複数プロックを参照して更新後デー タを復元すると、 差分抽出時とは別のデータを参照してしまうことがあり、 デー タ復元を正常に行えないおそれがある。
図 1 4は更新可能領域であるコード領域が不連続である場合の問題点を説明す る図である。 ここでは、 図 1 3と同様に書換え可能不揮発性メモリ 5 0 0におい て更新不可領域であるユーザ領域 5 0 1 , 5 0 3と更新可能領域であるコード領 域 5 0 2 , 5 0 4とが混在している状態における、 コード領域 5 0 2, 5 0 4の ブロック a〜gのデータ更新動作を説明する。
図 1 4 (A) に示すように、 更新前データ 5 4 0を従来の方法に従って均一か つ連続なブロックサイズに分けて、 複数ブロックを比較して差分抽出を行う場合 、 更新前データ 5 4 0のファイル中の位置 5 5 0において、 ブロック bについて は参照範囲 5 5 1を、 ブロック dについては参照範囲 5 5 2を更新前データと更 新後データとで比較参照することになる。 更新後データの復元時には、 図 1 4 ( B ) に示すように、 書換え可能不揮発性メモリ 5 0 0のアドレス 5 1 0上におい て、 ブロック bについては参照範囲 5 3 1を、 ブロック dについては参照範囲 5 3 2を参照することとなる。 このとき、 ブロック dについてはユーザ領域 5 0 3 を参照してしまい、 差分抽出時と復元時とで参照先の内容が食い違う部分 5 3 3 , 5 5 3が生じ、 正しくデータを復元することができない。 また、 この場合、 ュ 一ザ領域とコード領域の区別を認識していないので、 ユーザ領域にもデータを書 き込んでしまう可能性がある。
上記のようなデータ復元時の参照範囲の位置の相違を避けるために、 図 1 5 ( A) , ( B ) に示すように更新前データを書換え可能不揮発性メモリ 5 0 0上に 展開したときと同じ配置になるように、 ユーザ領域部分にダミーデータ 5 6 1, 5 6 2を揷入して展開し、 この展開した更新前データ 5 6 0によって差分抽出す ることも考えられる。 この場合、 更新前データ 5 6◦のメモリ上のアドレス 5 7 0において、 プロック bについては参照範囲 5 7 1を、 プロック dについては参 照範囲 5 7 2を更新前データと更新後データとで比較参照することになる。
この方法では、 ブロック dについては、 差分抽出時にはダミーデータ 5 6 2を 参照し、 更新後データの復元時にはダミーデータ 5 6 2とは異なるユーザ領域 5 0 3を参照してしまうため、 やはり参照先の内容が食い違う部分 5 3 3, 5 7 3 が生じ、 データ復元を正しく行うことができない。
このように、 携帯電話機などの組込み系機器は、 上記 (1 ) 、 (2 ) のような 特殊性を有し、 ハードウェア的な制約が大きいため、 従来のようなデータ更新方 法をそのまま用いることは困難であった。 このため、 より少ないハードウェア資 源で更新後データの復元、 書き込みを実行可能にして、 更新すべきデータを正し く更新し、 更新しないデータを変化させないデータ更新方法が求められている。 本発明は、 上記課題を解決するためになされたもので、 メモリ容量等のハード ウェア資源に制約のある機器であっても、 メモリ上の同じ領域においてプロダラ ム等のデータを更新前データから更新後データに書き換えて更新できるようにし た差分データ生成装置及び方法、 更新後データ復元装置及び方法、 並びにプログ ラムを提供することを目的とする。
また、 本発明は、 メモリ上で更新不可領域と更新可能領域が混在して更新前デ 一タゃ更新後データの格納領域が不連続であったり、 異なるプロックサイズの格 納領域が混在する場合であっても、 データ更新を正しく、 かつ単純な計算手順で 効率良く実行できるようにした差分データ生成装置及び方法、 更新後データ復元 装置及び方法、 並びにプロダラムを提供することを目的とする。
<発明の開示 >
本発明は、 第 1に、 更新前データから更新後データへデータを書き換えるため の差分データを生成する差分データ生成装置であって、 前記更新前データ及び前 記更新後データに関する、 データ復元側のデータ格納手段における記憶領域の配 置情報を含む記憶領域情報を基に、 差分抽出時の更新前データの参照範囲を設定 する領域設定手段と、 前記更新後データと、 前記設定された参照範囲の前記更新 前データとを比較参照して差分データを生成する差分抽出手段と、 前記生成した 差分データに、 前記データ復元側のデータ格納手段におけるデータ復元時の対象 データのアドレス情報を含むヘッダ情報を付加した差分ファイルを生成する差分 フアイル生成手段と、 を備えた差分データ生成装置を提供する。
これにより、 例えばデータ復元側のデータ格納手段において更新対象のデータ を格納する更新可能領域とユーザデータなどを格納する更新不可領域とが混在し て更新可能領域が不連続になっている場合であっても、 差分抽出手段では記憶領 域情報を基に連続した一つの更新可能領域のみを参照して差分データを生成する ことが可能となる。 また、 復元側の装置においても、 差分ファイル中のヘッダ情 報を基に連続した一つの更新可能領域のみを参照して更新前データと差分データ とから更新後データを正常に復元することが可能である。
また、 第 2に、 前記記憶領域情報を保持する記憶領域情報保持手段を備え、 前 記データ復元側の前記データ格納手段が、 前記更新前データまたは前記更新後デ ータをプロック単位で格納する記憶領域を有する場合に、 前記記憶領域情報は、 前記データ復元側のデータ格納手段における前記更新前データ及び前記更新後デ ータを格納する記憶領域のァドレス情報を含むものであって、 前記更新前データ または前記更新後データをプロック単位で格納する記憶領域において、 前記デー タ格納手段上のァドレスが連続し、 かつ同一のプロックサイズの一つまたは複数 のブロックからなる記憶領域を一つの更新可能領域とし、 この更新可能領域ごと の開始ア ドレス、 終了ア ドレス、 及ぴブロックサイズを含むものとする。
これにより、 更新前データ及び更新後データが複数のブロックからなり、 プロ ック単位で差分データの生成を行う場合において、 記憶領域情報を基に連続した 一つの更新可能領域のみを参照して差分データを生成することが可能となり、 他 の領域にまたがって参照して差分データを生成してしまうような不具合を防止可 能である。
また、 第 3に、 前記領域設定手段は、 前記更新前データ及び前記更新後データ がデータ復元側のデータ格納手段の記憶領域に対応して複数のプロックに分割さ れている場合に、 前記差分抽出時の更新前データの参照範囲として、 前記記憶領 域情報に基づいて対象のプロックとその前後の一つまたは複数のプロックとを合 わせた複数のプロックを参照するように前記参照範囲を設定し、 前記対象のプロ ックから求めた前記参照範囲が前記更新可能領域に収まらない場合は、 前記参照 範囲内であり、 かつ前記更新可能領域内である領域を新たに前記参照範囲として 設定するものとする。
これにより、 更新前データ及び更新後データが複数のプロックからなり、 対象 プロックとその前後のプロックを合わせた複数のプロックを参照して差分データ の生成を行う場合において、 記憶領域情報を基に他の領域にまたがることなく、 連続した一つの更新可能領域のみを参照して差分データを生成することが可能で ある。 またこの場合、 複数のブロックを参照することで、 差分データのデータ量 を削減可能である。 したがって、 復元側の装置では、 データ格納手段の更新可能 領域が不連続であっても、 複数のプロックを参照しながら正常にデータの復元を 行うことが可能となる。
また、 第 4に、 前記ヘッダ情報は、 前記データ復元側のデータ格納手段におけ るデータ復元時の更新後データの書き込み範囲を示すァドレス情報を含むものと する。
また、 第 5に、 前記ア ドレス情報は、 前記データ復元側のデータ格納手段にお けるデータ復元時の更新前データの参照範囲を含むものとする。
これにより、 復元側の装置では、 ヘッダ情報を利用して、 差分データと更新前 データの参照による更新後データの復元処理と、 復元した更新後データの書き込 み処理とを適切に実行でき、 復元時に他の領域にまたがって参照してしまったり 、 まだ参照範囲にあるプロックに更新後データを書き込んでしまうような不具合 を防止可能である。 このため、 正常に更新前データから更新後データへの書き換 えが可能となる。 また、 それらの動作を記憶領域情報を必要とせずに実行可能で ある。
本発明は、 第 6に、 更新前データから更新後データへデータを書き換えるため の差分データを生成する差分データ生成方法であって、 前記更新前データ及び前 記更新後データに関する、 データ復元側のデータ格納手段における記憶領域の配 置情報を含む記憶領域情報を基に、 差分抽出時の更新前データの参照範囲を設定 する領域設定ステップと、 前記更新後データと、 前記設定された参照範囲内の前 記更新前データとを比較参照して差分データを生成する差分抽出ステップと、 前 記生成した差分データに、 前記データ復元側のデータ格納手段におけるデータ復 元時の対象データのアドレス情報を含むヘッダ情報を付加した差分ファイルを生 成する差分ファイル生成ステップと、 を有する差分データ生成方法を提供する。 これにより、 例えばデータ復元側のデータ格納手段において更新対象のデータ を格納する更新可能領域とユーザデータなどを格納する更新不可領域とが混在し て更新可能領域が不連続になっている場合であっても、 記憶領域情報を基に連続 した一つの更新可能領域のみを参照して差分データを生成することが可能となる 。 また、 復元側の装置においても、 記憶領域情報を基に連続した一つの更新可能 領域のみを参照して更新前データと差分データとから更新後データを正常に復元 することが可能である。
また、 第 7に、 前記データ復元側の前記データ格納手段が、 前記更新前データ または前記更新後データをブロック単位で格納する記憶領域を有する場合であり 、 前記記憶領域情報は、 前記データ復元側のデータ格納手段における前記更新前 データ及び前記更新後データを格納する記憶領域のァドレス情報を含むものであ つて、 前記更新前データまたは前記更新後データをプロック単位で格納する記憶 領域において、 前記データ格納手段上のアドレスが連続し、 かつ同一のブロック サイズの一つまたは複数のプロックからなる記憶領域を一つの更新可能領域とし 、 この更新可能領域ごとの開始アドレス、 終了アドレス、 及びブロックサイズを 含むものである場合に、 前記領域設定ステップにおいて、 前記更新前データ及び 前記更新後デ タがデータ復元側のデータ格納手段の記憶領域に対応して複数の プロックに分割されている場合に、 前記差分抽出時の更新前データの参照範囲と して、 前記記憶領域情報に基づいて対象のプロックとその前後の一つまたは複数 のプロックとを合わせた複数のプロックを参照するように前記参照範囲を設定し 、 前記対象のブロックから求めた前記参照範囲が前記更新可能領域に収まらない 場合は、 前記参照範囲内であり、 かつ前記更新可能領域内である領域を新たに前 記参照範囲として設定することとする。
これにより、 更新前データ及び更新後データが複数のブロックからなり、 対象 プロックとその前後のプロックを合わせた複数のプロックを参照して差分データ の生成を行う場合において、 記憶領域情報を基に他の領域にまたがることなく、 連続した一つの更新可能領域のみを参照して差分データを生成することが可能で ある。 またこの場合、 複数のプロックを参照することで、 差分データのデータ量 を削減可能である。 したがって、 復元側の装置では、 データ格納手段の更新可能 領域が不連続であっても、 複数のブロックを参照しながら正常にデータの復元を 行うことが可能となる。
本発明は、 第 8に、 上記第 6または第 7に記載の差分データ生成方法の手順を コンピュータにより実行するためのプログラムを提供する。
このプログラムの実行により、 復元側のデータ格納手段上で更新不可領域と更 新可能領域が混在して更新前データや更新後データの格納領域が不連続であった り、 異なるブロックサイズの格納領域が混在する場合であっても、 データ更新を 正しく、 かつ単純な計算手順で効率良く実行することが可能となる。
本発明は、 第 9に、 通信手段を介して受信した差分データを用いて、 更新前デ ータから更新後データを復元してデータを書き換える更新後データ復元装置であ つて、 前記更新前データ及び前記更新後データを格鈉するデータ格納手段と、 前 記通信手段を介して送られてきた差分データ及びデータ復元時の前記データ格納 手段における対象データのァドレス情報を受信する受信手段と、 前記ァドレス情 報に基づき指定される前記データ格納手段における参照範囲の更新前データを参 照して、 この更新前データと前記差分データとから更新後データを復元するデー タ復元手段と、 前記復元した更新後データを保持するバッファ手段と、 前記保持 した更新後データを前記ァドレス情報に基づき指定される前記データ格納手段に おける書き込み範囲に書き込むデータ書き込み手段と、 を備えた更新後データ復 元装置を提供する。
これにより、 例えばデータ格納手段において更新対象のデータを格納する更新 可能領域とユーザデータなどを格納する更新不可領域とが混在して更新可能領域 が不連続になっている場合であっても、 データ復元手段ではァドレス情報に基づ き連続した一つの更新可能領域のみを参照して更新後データを復元することが可 能となる。 この場合、 復元時にア ドレス変換等の処理が不要であり、 少ない簡単 な手順で復元処理が可能である。
また、 第 1 0に、 前記ア ドレス情報は、 前記差分データを生成する差分データ 生成装置において、 前記更新前データ及ぴ前記更新後データに関する前記データ 格納手段における記憶領域の配置情報を含む記憶領域情報が保持され、 この記憶 領域情報を基に生成されるものであって、 前記データ格納手段におけるデータ復 元時の更新後データの書き込み範囲を含むものとする。
また、 第 1 1に、 前記ア ドレス情報は、 前記データ格納手段におけるデータ復 元時の更新前データの参照範囲を含むものとする。
これにより、 アドレス情報に基づき、 差分データと更新前データの参照による 更新後データの復元処理と、 復元した更新後データの書き込み処理とを少量のメ モリにおいて適切に実行でき、 復元時に他の領域にまたがって参照してしまった り、 まだ参照範囲にあるブロックに更新後データを書き込んでしまうような不具 合を防止可能である。 このため、 一つのデータ格納メモリ上において正常に更新 前データから更新後データへの書き換えが可能となる。
また、 第 1 2に、 前記データ格納手段は、 前記更新前データをブロック単位で 複数のプロックに分割して格納するもので、 このデータ格納手段の記憶領域につ いて、 前記差分データ生成装置に保持された記憶領域情報によって、 前記データ 格納手段上のァドレスが連続し、 かつ同一のプロックサイズの一つまたは複数の プロックからなる記憶領域が一つの更新可能領域として定義されており、 前記デ ータ復元手段は、 前記ァドレス情報に基づいて前記データ格納手段における対象 のブロックとその前後の一つまたは複数のプロックとを合わせた複数のプロック を前記参照範 Hとして参照して前記更新後データを復元し、 前記対象のプロック から求めた前記参照範囲が前記更新可能領域に収まらない場合は、 前記参照範囲 内であり、 かつ前記更新可能領域内である領域を新たに前記参照範囲として参照 して復元するものとする。
これにより、 更新前データ及ぴ更新後データが複数のブロックからなり、 対象 プロックとその前後のプロックを合わせた複数のプロックを参照して更新データ の復元を行う場合に、 データ格納手段の更新可能領域が不連続であっても、 アド レス情報を基に他の領域にまたがることなく、 連続した一つの更新可能領域のみ を参照して正常にデータの復元を行うことが可能となる。
また、 第 1 3に、 前記バッファ手段は、 リングバッファ方式のバッファにより 構成され、 前記ブロックごとに復元された更新後データをそれぞれ保持する複数 の領域を有しており、 前記データ書き込み手段は、 前記バッファ手段に保持され た更新後データの前記データ格納手段における書き込み範囲が、 前記データ復元 手段によるデータ復元時の参照範囲から外れた場合に、 該当する更新後データを 前記バッファ手段から前記データ格納手段に書き込み、 その後前記バッファ手段 における書き込み完了した更新後データの保持領域の開放を指示するものとする これにより、 リングバッファ方式のバッファ手段を用いることで、 データ格納 手段を最小限のメモリ容量として、 更新後データの復元処理と、 復元した更新後 データの書き込み処理とを簡単かつ適切に実行でき、 一つのデータ格納メモリ上 において正常に更新前データから更新後データへの書き換えが可能となる。 また 、 バッファ手段についても、 メモリ容量を削減できる。 例えば、 バッファ手段の 各領域のサイズは、 データ格納手段における最大ブロックサイズとすればよい。 また、 バッファ手段の領域数 (ブロック数) nは、 復元時に参照するブロック数 を kとすると、 k = 2 n— 1の関係が成り立つため、 ブロック数 n = ( k + 1 ) ノ 2の領域を設けるようにすれば十分である。
本発明は、 第 1 4に、 通信手段を介して受信した差分データを用いて、 更新前 データから更新後データを復元してデータを書き換える更新後データ復元方法で あって、 前記通信手段を介して送られてきた差分データ及び前記更新前データを 格納するデータ格納手段におけるデータ復元時の対象データのァドレス情報を受 信する受信ステップと、 前記アドレス情報に基づき指定される前記データ格納手 段における参照範囲の更新前データを参照して、 この更新前データと前記差分デ ータとから更新後データを復元するデータ復元ステップと、 前記復元した更新後 データを保持するバッファリングステップと、 前記保持した更新後データを前記 ァドレス情報に基づき指定される前記データ格納手段における書き込み範囲に書 き込むデータ書き込みステップと、 を有する更新後データ復元方法を提供する。 これにより、 例えばデータ格納手段において更新対象のデータを格納する更新 可能領域とユーザデータなどを格納する更新不可領域とが混在して更新可能領域 が不連続になっている場合であっても、 ァドレス情報に基づき連続した一つの更 新可能領域のみを参照して更新後データを復元することが可能となる。 この場合 、 復元時にアドレス変換等の処理が不要であり、 少ない簡単な手順で復元処理が 可能である。
また、 第 1 5に、 前記アドレス情報は、 前記差分データを生成する差分データ 生成装置において、 前記更新前データ及び前記更新後データに関する前記データ 格納手段における記憶領域の配置情報を含む記憶領域情報が保持され、 この記憶 領域情報を基に生成されるものであって、 前記データ格納手段におけるデータ復 元時の更新後データの書き込み範囲を含むものであり、 前記データ格納手段が、 前記更新前データをプロック単位で複数のプロックに分割して格納するもので、 このデータ格納手段の記憶領域について、 前記差分データ生成装置に保持された 記憶領域情報によって、 前記データ格納手段上のアドレスが連続し、 かつ同一の プロックサイズの一つまたは複数のプロックからなる記憶領域が一つの更新可能 領域として定義されている場合に、 前記データ復元ステップにおいて、 前記アド レス情報に基づいて前記データ格納手段における対象のプロックとその前後の一 つまたは複数のプロックとを合わせた複数のプロックを前記参照範囲として参照 して前記更新後データを復元し、 前記対象のプロックから求めた前記参照範囲が 前記更新可能領域に収まらない場合は、 前記参照範囲内であり、 かつ前記更新可 能領域内である領域を新たに前記参照範囲として参照して復元することとする。 また、 第 1 6に、 前記アドレス情報は、 前記データ格納手段におけるデータ復 元時の更新前データの参照範囲を含むものとする。
これにより、 更新前データ及び更新後データが複数のブロックからなり、 対象 ブロックとその前後のブロックを合わせた複数のプロックを参照して更新データ の復元を行う場合に、 データ格納手段の更新可能領域が不連続であっても、 アド レス情報を基に他の領域にまたがることなく、 連続した一つの更新可能領域のみ を参照して正常にデータの復元を行うことが可能となる。
また、 第 1 7に、 前記バッファリングステップにおいて、 リングバッファ方式 のバッファにより構成され複数の領域を有するバッファ手段を用いて、 前記プロ ックごとに復元された更新後データを前記バッファ手段の複数の領域のうちの一 つに保持し、 前記デ タ書き込みステップにおいて、 前記バッファ手段に保持さ れた更新後データの前記データ格納手段における書き込み範囲が、 前記データ復 元ステップにおけるデータ復元時の参照範囲から外れた場合に、 該当する更新後 データを前記バッファ手段から前記データ格納手段に書き込み、 その後前記バッ ファ手段における書き込み完了した更新後データの保持領域の開放を指示するこ ととする。
これにより、 リングバッファ方式のバッファ手段を用いることで、 データ格納 手段を最小限のメモリ容量として、 更新後データの復元処理と、 復元した更新後 データの書き込み処理とを簡単かつ適切に実行でき、 一つのデータ格納メモリ上 において正常に更新前データから更新後データへの書き換えが可能となる。
本発明は、 第 1 8に、 上記第 1 4〜第 1 7のいずれかに記載の更新後データ復 元方法の手順をコンピュータにより実行するためのプログラムを提供する。
このプログラムの実行により、 復元側のデータ格納手段上で更新不可領域と更 新可能領域が混在して更新前データや更新後データの格納領域が不連続であった り、 異なるブロックサイズの格納領域が混在する場合であっても、 データ更新を 正しく、 かつ単純な計算手順で効率良く実行することが可能となる。
<図面の簡単な説明 >
図 1は、 本発明の実施形態に係るデータ更新方法を実現するデータ更新装置の 機能的構成を示すプロック図であり、
図 2は、 本実施形態に係るコード領域情報ファイルの内容とデータ格納メモリ の構造の一例を示した図で、 (A) はコード領域情報ファイルの内容、 (B ) は データ格納メモリの構造をそれぞれ示した図であり、
図 3は、 本実施形態に係る結合ファイルにおける 1つのブロックに対する差分 ファイルのフォーマツトの一例を示す図であり、
図 4は、 本実施形態に係るデータ格納メモリ内のコード領域のプロック bを復 元する際のァドレス及び参照範囲を示す図であり、
図 5は、 本実施形態の差分データ生成送出部における差分データ生成の動作手 順を示すフローチャートであり、
図 6は、 本実施形態の差分データ復元部における更新後データ復元の動作手順 を示すフローチヤ一トであり、
図 7は、 図 6に示した更新後データ復元アルゴリズムによるデータ復元時の動 作の具体例をステップ毎に示した図であり、
図 8は、 図 6に示した更新後データ復元アルゴリズムによるデータ復元時の動 作の具体例をステップ毎に示した図であり、
図 9は、 本実施形態に係る差分データ生成方法を適用した場合の参照プロック 数と差分データサイズとの関係を示したグラフであり、
図 1 0は、 本実施形態に対する比較例として、 従来の方法によるデータ復元時 の動作の具体例をステップ毎に示した図であり、
図 1 1は、 差分データ抽出に用いる疑似コードを示す図であり、
図 1 2は、 データ更新を行う際のデータの一例を示したもので、 (A) は更新 前データ、 (B ) は更新後データ、 (C ) はこれらの差分データをそれぞれ示す 図であり、
図 1 3は、 従来のデータ更新方法を用いて一つの書換え可能不揮発性メモリに おいてデータ更新を行う際に、 更新後データの復元と書き込みを並行して行う場 合の問題点を説明する図であり、
図 1 4は、 従来のデータ更新方法を用いて一つの書換え可能不揮発性メモリに おいてデータ更新を行う際に、 更新可能領域であるコード領域が不連続である場 合の問題点を説明する図であり、
図 1 5は、 従来のデータ更新方法を用いて一つの書換え可能不揮発性メモリに おいてデータ更新を行う際に、 データ復元時の参照範囲の位置の相違を避けるた めにダミーデータを揷入した場合の問題点を説明する図である。
なお、 図中の符号、 1 0 1は更新前データ、 1 0 2は更新後デ一夕、 1 0 5は 結合ファイル、 1 1 0は差分データ生成送出部、 1 1 1はデータ格納部、 1 1 2 は差分抽出部、 1 1 3は送信バッファ、 1 1 4は送信部、 1 1 5はコード領域情 報ファイル、 1 1 6はコード領域設定部、 1 1 7は制御部、 1 1 8は領域情報記 憶部、 1 2 0は差分データ復元部、 1 2 1はデータ格納メモリ、 1 2 2は受信部 、 1 2 3は受信バッファ、 1 2 4は復元部、 1 2 5は復元バッファ、 1 2 6はメ モリ書き込み部、 1 2 7は制御部、 1 3 0はネッ トワーク、 1 5 1は書換えァド レス、 1 5 2は参照範囲、 1 5 3は書き込み範囲、 2 0 1 , 2 0 3はユーザ領域 、 2 0 2 , 2 0 4はコード領域である。
<発明を実施するための最良の形態〉
以下、 図面を参照して本発明の実施形態を説明する。
図 1は本発明の実施形態に係るデータ更新方法を実現するデータ更新装置の機 能的構成を示すブロック図である。 本実施形態では、 データ更新装置の一例とし て、 携帯電話機等の端末装置に格納されている動作プログラム等を含むデータの バージョンを更新する場合の構成及び動作の例を説明する。
本実施形態のデータ更新装置は、 サーバ装置において設けられる差分データ生 成送出部 1 1 0と、 携帯電話機等の端末装置において設けられる差分データ復元 部 1 2 0とが通信用の有線または無線のネットワーク 1 3 0を介して接続されて 構成されている。 このデータ更新装置は、 例えば、 移動体通信システムの無線通 信網によるネットワークを介して、 差分データをサーバ装置から端末装置へ転送 することによって、 通信回線経由で端末装置内のデータを更新する場合などに用 いられる。
差分データ生成送出部 1 1 0は、 更新前データ 1 0 1及び更新後データ 1 0 2 を格納するハードディスク等からなるデータ格納部 1 1 1と、 更新前データ 1 0 1と更新後データ 1 0 2との差分を抽出して差分データを生成する差分抽出部 1 1 2と、 生成した差分データを結合した送信用の結合ファイル 1 0 5を格納する 送信バッファ 1 1 3と、 結合ファイル 1 0 5等のデータをネットワーク 1 3 0を 経由して差分データ復元部 1 2 0に対して送信する送信部 1 1 4とを備えている 。 また、 受信側の端末装置のメモリにおけるコード領域 (更新可能領域) のプロ ック配置情報を含むコード領域情報ファイル 1 1 5を記憶する領域情報記憶部 1 1 8と、 コード領域情報ファイル 1 1 5の内容に基づき差分抽出時の参照範囲を 設定して差分抽出部 1 1 2に対して指示するコード領域設定部 1 1 6と、 各部の 制御を行う制御部 1 1 7とを備えている。
ここで、 コード領域設定部 1 1 6、 領域情報記憶部 1 1 8及び制御部 1 1 7が 特許請求の範囲に記載の領域設定手段の機能を実現する。 また、 コード領域情報 ファイル 1 1 5が特許請求の範囲に記載の記憶領域情報に相当し、 領域情報記憶 部 1 1 8が特許請求の範囲に記載の記憶領域情報保持手段に相当する。 また、 差 分抽出部 1 1 2及び制御部 1 1 7が特許請求の範囲に記載の差分抽出手段の機能 を実現する。 また、 差分抽出部 1 1 2、 送信バッファ 1 1 3及び制御部 1 1 7が 特許請求の範囲に記載の差分ファイル生成手段の機能を実現する。
差分データ復元部 1 2 0は、 更新するプログラム等のデータを格納する書換え 可能不揮発メモリ (フラッシュ R OMなど) 等によるデータ格納メモリ 1 2 1を 備えている。 また、 差分データ生成送出部 1 1 0から送られた結合ファイル 1 0 5等のデータを受信する受信部 1 2 2と、 受信した結合ファイル 1 0 5を格納す る受信バッファ 1 2 3と、 結合ファイル 1 0 5とデータ格納メモリ 1 2 1内の更 新前データとを参照しながらブロック毎に更新後データを復元する復元部 1 2 4 と、 復元された更新後データを一旦保持する復元バッファ 1 2 5と、 復元バッフ ァ 1 2 5に格納された更新後データをデータ格納メモリ 1 2 1に対して書き込む メモリ書き込み部 1 2 6と、 各部の制御を行う制御部 1 2 7とを備えている。 ここで、 データ格納メモリ 1 2 1が特許請求の範囲に記載のデータ格納手段に 相当し、 復元バッファ 1 2 5が特許請求の範囲に記載のバッファ手段に相当する 。 また、 受信部 1 2 2及ぴ受信バッファ 1 2 3が特許請求の範囲に記載の受信手 段の機能を実現する。 また、 復元部 1 2 4及ぴ制御部 1 2 7が特許請求の範囲に 記載のデータ復元手段の機能を実現する。 また、 メモリ書き込み部 1 2 6及び制 御部 1 2 7が特許請求の範囲に記載のデータ書き込み手段の機能を実現する。 本実施形態では、 データ格納メモリ 1 2 1において、 ユーザ領域 2 0 1、 コー ド領域 2 0 2、 ユーザ領域 2 0 3、 コード領域 2 0 4…のように、 プログラム等 の更新対象のデータを保持するコード領域 (更新可能領域) 2 0 2, 2 0 4と、 ユーザデータ等の更新しないデータを保持するユーザ領域 (更新不可領域) 2 0 1 , 2 0 3とが混在し、 かつ、 コード領域 2 0 2とコード領域 2 0 4でプロック サイズが異なる場合を示す。 次に、 データ更新時のデータの流れについて概略を説明する。 差分データ生成 送出部 1 1 0のデータ格納部 1 1 1において、 更新前データ 1 0 1及び更新後デ ータ 1 0 2はそれぞれ連続したデータの状態で格納される。 すなわち、 図 1のよ うに端末装置のデータ格納メモリ 1 2 1においてコード領域 2 0 2, 2 0 4が不 連続であっても、 これに対応する複数のコード領域 1 0 3 , 1 0 4のデータが結 合された状態で格納される。 それぞれのコード領域 1 0 3, 1 0 4は、 更新前デ ータ及び更新後データをメモリ上に格納した時の連続する同じサイズのプロック 群を示している。
ここでは、 端末装置のデータ格納メモリ 1 2 1におけるコード領域のプロック a, b, c, d, e, f , gにそれぞれ対応する複数ブロックのデータとして、 更新前データ 1 0 1は a l〜g l、 更新後データ 1 0 2は a 2〜g 2を格納する ものとする。 このように更新前データ 1 0 1、 更新後データ 1 0 2、 差分データ の結合ファイル 1 0 5などはブロックという単位で区切られている。 プロックは 、 差分データ復元部 1 2 0のデータ格納メモリ 1 2 1における一括消去時の単位 である。 なお、 更新前データ 1 0 1及び更新後データ 1 0 2は、 他の装置などか ら提供されるものとする。
差分抽出部 1 1 2は、 制御部 1 1 7の指示に基づき、 更新前データ 1 0 1と更 新後データ 1 0 2との差分を抽出する。 このとき、前述した Block-Moveアルゴリ ズムにより、 データ格納部 1 1 1に格納された更新前データ 1 0 1と更新後デー タ 1 0 2とを比較して一致するデータ列を検索し、 一致するデータ列はそのまま 更新前データから更新後データへ Moveデータとして移動するようにしてコピー し、 一致しないデータ列は新たなデータ列を Addデータとして追加して書き込む ことを指示する命令を含む差分データを生成する。 この差分データの生成方法に ついては、 前記非特許文献 1及び非特許文献 2に詳しく記載されている。 本実施 形態では、 更新対象のブロックの前後を含めた複数ブロックを比較参照すること により、 プロック毎に差分データを生成する場合の例を説明する。
そして、 差分抽出部 1 1 2は、 ブロック毎に生成した差分データにヘッダ情報 を付け、 所定単位の送信用データとしてまとめた結合ファイル 1 0 5にして、 こ れを送信バッファ 1 1 3に格納する。 この結合ファイル 1 0 5は、 更新前データ 1 0 1から更新後データ 1 0 2への変更箇所を示した差分データ a 1 2〜g 1 2 を結合したものとなる。 そして、 送信部 1 1 4より結合フアイル 1 0 5をネット ワーク 1 3 0を介して送信する。
差分データ復元部 1 2 0では、 差分データ生成送出部 1 1 0から転送された結 合ファイル 1 0 5を受信部 1 2 2で受信し、 受信バッファ 1 2 3に格納する。 復 元部 1 2 4は、 受信バッファ 1 2 3中の結合ファイル 1◦ 5とデータ格納メモリ 1 2 1中の更新前データとを参照しながら更新後データを復元する。 本実施形態 では、 更新対象のプロックの前後を含めた複数プロックを参照することにより、 ブロック毎に更新後データを復元する場合の例を説明する。 そして、 復元部 1 2 4は、 ブロック毎に復元した更新後データを復元バッファ 1 2 5に一時的に格納 して蓄積する。
復元バッファ 1 2 5は、 複数 (図示例では 2つ) の領域 1 2 5 a, 1 2 5 bに 分かれた構成となっており、 それぞれの領域のサイズはデータ格納メモリ 1 2 1 中の最大のブロックのサイズと同じとする。 この復元バッファ 1 2 5は、 リング バッファ方式で管理され、 データの書き込み、 読み出しが順次行われる。 リング バッファについては、 (石畑清著、 「アルゴリズムとデータ構造」 、 岩波講座ソ フトウェア科学、 岩波書店、 1989年、 p.46-48) が詳しい。
データ格納メモリ 1 2 1は、 データの更新が始まる前は更新前データを格納し ている。 復元部 1 2 4は、 1つのプロックの復元が終わると、 データ格納メモリ 1 2 1中の参照する範囲をァドレスが大きいプロックの側に 1ブロック分ずらす 。 そして、 メモリ書き込み部 1 2 6は、 データ格納メモリ 1 2 1中のもう参照し ないプロックに対して、 復元バッファ 1 2 5に保持された復元済みの更新後デー タを書き込んでいく。 データ格納メモリ 1 2 1への更新後データの書き込みが終 わると、 書き込んだ更新後データが格納されていた復元バッファ 1 2 5の領域を 開放する。
次に、 図 2を参照してコード領域情報ファイル 1 1 5の内容と、 データ格納メ モリ 1 2 1の構造について説明する。
図 2 (A) はコード領域情報ファイル 1 1 5の内容の一例を示したものである 。 なお、 この図示例において、 行番号 1 6 1は説明を容易にするために便宜的に 示したものであり、 実際のコード領域情報ファイル 1 1 5内には存在しない。 図 2 ( B ) はデータ格納メモリ 1 2 1の構造の一例を示したものである。 現在の端末装置等の組込み機器、 例えば携帯電話機では、 ソフトウェアプログ ラム等のデータ格納のためにフラッシュ R OMなどの書換え可能不揮発メモリを 用いていることが多い。 フラッシュ R OMは、 読み出しは通常の R AMと同様に アドレスの指定のみで参照できるが、 データの変更は、 ブロックと呼ばれる単位 で一度に消去した後に、 新たなデータを書き込むという方式を取らなければなら ない。 一つの機器の中でも、 アドレス空間の部分によってプロックのサイズが異 なることがある。 またフラッシュ R OMを利用する際に、 コード (プログラム) を格納するコード領域とユーザデータを格納するユーザ領域とを、 プロック単位 で分けることがある。
図 2 ( B )の例では、メモリ上のァドレス 1 5 0において、 0x1000力、ら 0x5000- 1 、 及び 0x7000から 0x8800-1まではコード領域 2 0 2 , 2 0 4であり、 0x0力、ら 0x1000-1、 及び 0x5000から 0x7000-1まではユーザ領域 2 0 1 , 2 0 3である。 コード領域 2 0 2は、 アドレス 0xl000〜0x5000-l、 ブロック a 〜 dの 4ブロッ クに相当する。 コード領域 2 0 4は、 アドレス 0x7000〜0x8800-l、 プロック e 〜 gの 3ブロックに相当する。また、ユーザ領域 2 0 1はァドレス 0χ0〜0χ1000- 1 、 ユーザ領域 2 0 3はァドレス 0x5000〜0x7000-lにそれぞれ相当する。
コード領域情報ファイル 1 1 5は、 コード領域 2 0 2, 2 0 4のプロック配置 に関する情報を示している。 一つのコード領域は、 コード領域を表す予約語 codeareaに続く中括弧 { } によって囲まれた範囲によって表現される。 中括弧 { } の中には、 コード領域の開始アドレスを示す head、 コード領域の最終アド レスを示す tail、 コード領域内の各プロックの大きさを示す blocksizeにより各要 素の値が指定されている。
図 2 (A) の例では、 最初のコード領域 2 0 2が 1行目から 5行目に示されて いる。 headよりコード領域の開始アドレスが 0x1000であることが分かる。 また 、 tailよりコード領域の最終アドレスが 0x5000-1であることが分かる。 さらに、 blocksizeよりそのコード領域内ではプロックのサイズがすべて 0x1000であるこ とが分かる。 6行目から 1 0行目に示される 2番目のコード領域 2 0 4について も同様に、 開始アドレス力 0x7000、 最終アドレス力 0x8800- 1、 プロックサイズ が 0x800であることが分かる。
また、 図 3を参照して結合ファイル 1 0 5のフォーマットについて説明する。 結合ファイル 1 0 5は、 データ格納メモリ 1 2 1上の各プロック毎に更新前デー タと更新後データとを比較して生成された差分データにヘッダ情報を付け、 所定 単位ごとまたは全体を結合したファイルとしたものである。 なお、 このような各 プロックの差分データにヘッダ情報を付加したものを差分ファイルとも呼ぶ。 図 3は 1つのブロックに対する差分ファイルのフォーマツ トの一例を示したも のである。 1プロックの差分ファイルフォーマツト 1 7 0は、 ブロックデータ長 1 7 1、 書換えァドレス 1 7 2、 プロック差分データ 1 7 3より構成される。 ブ 口ックデータ長 1 7 1は、 1つのプロックに対する差分ファイルの全体の長さを 示す。 書換えアドレス 1 7 2は、 コード領域情報ファイル 1 1 5を参照して生成 されるもので、 復元した更新後データがデータ格納メモリ 1 2 1上に格納される 領域の先頭ァドレスを示す。 プロック差分データ 1 7 3は、 差分抽出部 1 1 2に よって抽出、 生成された 1ブロックの差分データである。 なお、 差分ファイルに は、 差分データに付加するヘッダ情報として、 上記書換えアドレス 1 7 2におい て、 復元した更新後データの書き込み範囲を示すアドレス情報の他に、 データ復 元時の更新前データの参照範囲を示すアドレス情報を含めるようにして、 データ 復元側へ転送することも可能である。
さらに、 図 4を参照して、 図 2 ( B ) に示したデータ格納メモリ 1 2 1の構造 と図 3に示した差分ファイルフォーマツトとの関係を説明する。 図 4はデータ格 納メモリ 1 2 1内のコード領域 2 0 2のブロック bを復元する際のァドレス及び 参照範囲を示したものである。 ここでは、 差分データの生成及び更新後データの 復元の際に対象のプロックとその前後の 1プロックの計 3プロックを参照する場 合の例を示す。
プロック bを復元する際には、 このプロック bと前後 1プロック a , cを参照 する。 このため、 データ格納メモリ 1 2 1のアドレス 1 5 0上での参照範囲 1 5 2はブロック aからブロック c、 すなわち 0xl000〜0x5000- lとなる。 一方、 復 元した更新後データは同じプロック b へ書き込むので、 書き込み範囲 1 5 3はブ ロック b、 すなわち 0x2000〜0x3000-lとなる。 更新後データを書き込む際の書 換えアドレス 1 5 1は、 書き込み範囲 1 5 3の先頭ア ドレス、 すなわち 0x2000 となる。 この書換えアドレス 1 5 1は、 図 3に示したように差分ファイルフォ マット 1 7 0においてブロック差分データ 1 7 3の前に設けられ、 コード領域設 定部 1 1 6から得たコード領域の配置情報に基づき、 差分抽出部 1 1 2が付加す る。
次に、 差分データ生成送出部 1 1 0の動作について、 図 5を参照しながら説明 する。 図 5は本実施形態の差分データ生成送出部における差分データ生成の動作 手順を示すフローチャートである。 図 5のフローチャートは、 すべてのコード領 域について処理するための外側のループと、 それぞれのコード領域中のすべての ブロックを処理するための内側のループとの二重のループからなる。 なお、 ここ では差分データを生成する際に更新前データ及び更新後データの対象のプロック とその前後の 1プロックの計 3プロックを参照する場合を説明する。
外側のループ (ステップ S 4 0 1〜S 4 0 2 ) は、 コード領域情報ファイル 1 1 5中に定義されているすべてのコード領域について処理を行う。
制御部 1 1 7は、 コード領域情報フアイル 1 1 5中に処理すべきコ一ド領域が 残っているか否かを確認する (ステップ S 4 0 1 ) 。 ここで、 コード領域が残つ ていなければ動作を終了する。 コード領域が残っている場合は、 次にコード領域 設定部 1 1 6に、 コード領域情報ファイル 1 1 5からコード領域を 1つ読込むよ う指示する (ステップ S 4 0 2 ) 。 そして、 制御部 1 1 7は、 読込んだ 1つのコ 一ド領域に関する処理を次のステップ S 4 0 3からステップ S 4 0 9の内側のル ープで行った後、 ステップ S 4 0 1に戻って外側のループの実行を続ける。
内側のノレープ (ステップ S 4 0 3〜S 4 0 9 ) は、 ステップ S 4 0 2で読込ん だ 1つのコード領域について処理を行う。
まず、 制御部 1 1 7は、 処理中のコード領域の中に、 処理していないブロック が残っているか否かを判断する (ステップ S 4 0 3 ) 。 ここで、 未処理プロック が残っていなければステップ S 4 0 1に戻り、 次のコード領域の処理に移る。 未 処理プロックが残っている場合はステップ S 4 0 4に進む。
次に、 制御部 1 1 7は、 差分抽出を行って差分データを生成していないプロッ ク群の中から先頭の、 つまり一番開始アドレスの小さいブロックを取り出す (ス テツプ S 4 0 4 ) 。 そして、 制御部 1 1 7は、 取り出したブロックがコード領域 内の先頭か否かを判断する (ステップ S 4 0 5 ) 。 ここで、 コード領域の先頭で あれば、 ステップ S 4 0 6に進み、 処理中のブロックとその 1つ後ろのブロック の計 2ブロックを参照しながら差分生成を行うよう、 差分抽出部 1 1 2に指示す る (ステップ S 4 0 6 ) 。 ただし、 コード領域中にブロックが一つしかない場合 は、 処理中のブロックのみを参照する。 次いで、 制御部 1 1 7はステップ S 4 0 6の終了後、 ステップ S 4 0 3に戻り処理を繰り返す。
また、 制御部 1 1 7がステップ S 4 0 5でコード領域の先頭ではないと判断し た場合はステップ S 4 0 7に進み、 処理中のブロックがコード領域の最後である か否かを判断する (ステップ S 4 0 7 ) 。 ここで、 コード領域の最後である場合 は、 1つ前のブロックと処理中のブロックの計 2プロックを参照しながら差分生 成を行うよラ差分抽出部 1 1 2に指示する (ステップ S 4 0 8 ) 。 次いで、 制御 部 1 1 7はステップ S 4 0 8の終了後、 ステップ S 4 0 3に戻り処理を繰り返す 。
また、 ステップ S 4 0 7において処理中のプロックがコード領域の最後でない 場合は、 処理中のプロックと前後の 1ブロックの計 3プロックを参照しながら差 分生成を行うよう差分抽出部 1 1 2に指示する (ステップ S 4 0 9 ) 。
上記外側と内側のそれぞれのループは、 プログラムで実現する場合は、 C言語 、 Java言語における for文、 while文などの繰り返しを示すプログラムで実現する ことができる。
外側のループにおいて、 ステップ S 4 0 2では、 図 2 (A) におけるコード領 域情報ファイル 1 1 5の中の、 キーワード codeareaとそれに続く中括弧で囲まれ た部分を、 1つのコード領域として先頭から順に読み込むことを意味している。 また、 ステップ S 4 0 1では、 既に読み込んだコード領域の次に続くコード領域 がコード領域情報ファイル 1 1 5の中に残っている力、 あるいは、 残っておらず に、 最後に読み込んだコード領域の後ろにはファイルの最後まで何もデータが入 つていない (空白、 改行、 タブ、 注釈などの意味を持たないデータしか入ってい ない) かを判断する。
内側のループでは、 外側のループにおけるステップ S 4 0 2で読み込んだ 1つ のコード領域を処理する。 図 2 (A) のように、 コード領域情報ファイル 1 1 5 中には、 コード領域の先頭アドレス、 最終アドレス、 ブロックサイズが示されて いる。 例えば、 C言語、 Java言語などを用いてプログラムで内側のループを実現 する場合には、 内側のループは、 1つの変数の初期値を先頭アドレス、 終了する ときの判断に用いる値を最終アドレス、 一回のィテレーシヨン (繰り返し) で変 数が増加する値をプロックサイズとした for文で実現することができる。
次に、 差分データ復元部 1 2 0の動作について、 図 6を参照しながら説明する 。 図 6は本実施形態の差分データ復元部における更新後データ復元の動作手順を 示すフローチャートである。 なお、 ここでは更新後データを復元する際に差分フ アイルを用いて更新前データの対象のプロックとその前後の 1プロックの計 3プ 口ックを参照する場合を説明する。
制御部 1 2 7は、 受信バッファ 1 2 3の中から先頭の差分ファイル (先頭の 1 ブロック分に相当する) を取り出す (ステップ S 5 0 1 ) 。 この差分ファイルに は、 プロック毎の差分データと書換えアドレス (書き込み範囲) の情報が含まれ ている。 なお、 書換えアドレスには、 復元した更新後データの書き込み範囲を示 す情報が含まれるが、 この書き込み範囲と共にデータ復元時の更新前データの参 照範囲を示す情報を含めるようにしても良い。 次に、 データ格納メモリ 1 2 1の 参照範囲を参照しながら、 1プロックの復元を行うよう復元部 1 2 4に指示する (ステップ S 5 0 2 ) 。 そして、 復元した更新後データを復元バッファ 1 2 5に 書き込む (ステップ S 5 0 3 ) 。
次に、 差分フアイルが受信バッファ 1 2 3中に残っているか否かを判断する ( ステップ S 5 0 4 ) 。 ここで、 差分ファイルが残っていない場合は、 ステップ S 5 1 0に進み、 処理中の復元バッファ 1 2 5に書かれている内容をデータ格納メ モリ 1 2 1の書き込み先ァドレスが指すプロックに対して書き込む (ステップ S 5 1 0 ) 。 また、 差分ファイルが残っている場合は、 ステップ S 5 0 5に進み、 受信バッファ 1 2 3の中の先頭の差分ファイルを取り出す (ステップ S 5 0 5 ) そして、 取り出した差分ファイルとデータ格納メモリ 1 2 1の参照範囲を参照 しながら、 1ブロック分のデータ復元を行うよう復元部 1 2 4に指示する (ステ ップ S 5 0 6 ) 。 その後、 復元した更新後データを復元バッファ 1 2 5の空いて いる領域に書き込む (ステップ S 5 0 7 ) 。 次に、 1回前に復元して復元バッフ ァ 1 2 5に書き込まれている更新後データを、 そのデータの書き込み先ァドレス に従ってデータ格納メモリ 1 2 1の該当プロックに対して書き込む (ステップ S 5 0 8 ) 。 次いで、 ステップ S 5 0 8で参照した復元バッファ 1 2 5の領域を開 放する (ステップ S 5 0 9 ) 。 その後、 ステップ S 5 0 4に戻り、 次の差分ファ ィルの処理に移る。
ここで、 図 6に示したアルゴリズムによるデータ復元時の動作を図 7及ぴ図 8 を参照して具体的に説明する。 ここでは簡単のため、 データ格納メモリ 1 2 1に おいて連続した 4つのブロック a〜dからなるコード領域に適用した場合を示す まず図 7 (A) に示すように、 ブロック aの更新後データの復元を行う。 この とき、 ブロック aがコード領域の先頭であるため、 参照範囲は対象のブロック a と後ろのプロック bとを合わせた a〜bとなる。 この参照範囲のプロック a〜b の更新前データ a 1, b 1と差分データ a 1 2とに基づき、 更新後データ a 2を 復元して復元バッファ 1 2 5の一方の領域 (第 1領域) 1 2 5 aに格納する。 次いで図 7 ( B ) に示すように、 プロック bの更新後データの復元を行う。 こ のときの参照範囲は、 対象のプロック bと前後のプロック a , cとを合わせた a 〜cとなる。 この参照範囲のブロック a〜 cの更新前データ a 1, b 1 , c lと 差分データ b 1 2とに基づき、 更新後データ b 2を復元して復元バッファ 1 2 5 の他方の領域 (第 2領域) 1 2 5 bに格納する。
そして図 7 ( C ) に示すように、 ブロック aの更新後データの書き込みを行う 。 このときの書き込み範囲は、 対象のブロック aであり、 復元バッファ 1 2 5の 第 1領域 1 2 5 aに蓄積された更新後データ a 2をデータ格納メモリ 1 2 1のブ ロック aに書き込む。 その後、 図 7 (D ) に示すように、 書き込み完了した更新 後データ a 2が格納されていた復元バッファ 1 2 5の第 1領域 1 2 5 aを開放す る。
次に、 図 7 ( E ) に示すように、 ブロック cの更新後データの復元を行う。 こ のときの参照範囲は、 対象のブロック cと前後のブロック b , dとを合わせた b 〜dとなる。 この参照範囲のブロック b〜dの更新前データ b 1, c l , d lと 差分データ c 1 2とに基づき、 更新後データ c 2を復元して前記開放された復元 バッファ 1 2 5の第 1領域 1 2 5 aに格納する。
そして図 7 ( F ) に示すように、 プロック bの更新後データの書き込みを行う 。 このときの書き込み範囲は、 対象のプロック bであり、 復元バッファ 1 2 5の 第 2領域 1 2 5 bに蓄積された更新後データ b 2をデータ格納メモリ 1 2 1のブ ロック bに書き込む。 その後、 図 8 (A) に示すように、 書き込み完了した更新 後データ b 2が格納されていた復元バッファ 1 2 5の第 2領域 1 2 5 bを開放す る。
次に、 図 8 ( B ) に示すように、 プロック dの更新後データの復元を行う。 こ のとき、 プロック dがコード領域の最後であるため、 参照範囲は対象のブロック dと前のブロック cとを合わせた c〜dとなる。 この参照範囲のブロック c〜 d の更新前データ c l, d 1と差分データ d 1 2とに基づき、 更新後データ d 2を 復元して復元バッファ 1 2 5の第 2領域 1 2 5 bに格納する。
そして図 8 ( C ) に示すように、 ブロック cの更新後データの書き込みを行う 。 このときの書き込み範囲は、 対象のブロック cであり、 復元バッファ 1 2 5の 第 1領域 1 2 5 aに蓄積された更新後データ c 2をデータ格納メモリ 1 2 1のプ ロック cに書き込む。 その後、 図 8 (D ) に示すように、 書き込み完了した更新 後データ c 2が格納されていた復元バッファ 1 2 5の第 1領域 1 2 5 aを開放す る。
次に、 図 8 ( E ) に示すように、 プロック dの更新後データの書き込みを行う 。 このときの書き込み範囲は、 対象のプロック dであり、 復元バッファ 1 2 5の 第 2領域 1 2 5 bに蓄積された更新後データ d 2をデータ格納メモリ 1 2 1のプ ロック dに書き込む。
なお、 上述した実施形態では、 処理中の対象のブロック及びその前後のブロッ クを参照しながら差分データの生成と更新後データの復元を行う例を示したが、 参照するブロックをさらに增やすことも可能である。 この場合、 差分データ生成 時には差分抽出部 1 1 2が拡大された参照範囲を参照しながら差分抽出を行うこ とになり、 さらにコード領域の先頭付近及び最終付近のプロックでの参照範囲の 制限が変わってくるため、 図 5のステップ S 4 0 5、 S 4 0 7における条件分岐 を修正する必要がある。
このように複数のブロックを参照することによって、 プロックをまたがって大 きな移動をしているデータについても更新前データから更新後データにコピーす ることができ、 差分データの量をより減らすことができる。 図 9は、 ある組込み 機器に上記差分データ生成方法を適用した場合の参照ブロック数と差分データサ ィズとの関係を示したグラフである。 この図 9は、 更新前データ、 更新後データ をそれぞれ 1 6 Mバイ ト (bytes) 、 1つのプロックのサイズを 1 2 8バイトとし たサンプルデータを用いて、 参照プロック数の増加に対する差分データのデータ 量の変化を演算により求めた結果を示したものである。
1つのブロックのみを参照して 1つのプロックを復元する場合は、 差分データ のデータ量の総和は約 6 . 5 Mバイトとなり、 圧縮率は 4 0 %程度である。 この 場合には復元バッファは 1ブロック分のみでよい。 また、 上述した例のように前 後 1プロックも含めて合計 3プロックを参照した場合は、 差分データのデータ量 の総和は約 3 . 5 Mバイトまで小さくなり、 圧縮率は 2 2 %程度である。 この場 合には、 復元バッファは 2プロック分の領域を用意すればよい。 また、 前後 2ブ ロックを含めて合計 5ブロックを参照した場合は、 差分データのデータ量の総和 は約 1 . 7 Mバイトまで小さくなり、 圧縮率は 1 1 %程度である。 この場合に必 要な復元バッファの領域は 3プロック分である。 なお、 図 9より、 参照するブロ ックを 5ブロック以上増やしても、 圧縮率はあまり上がらないことが分かる。 ここで、 必要となる復元バッファの領域 (プロック数) nは、 参照するブロッ ク数を kとすると、 k = 2 n— 1の関係があるため、 必要復元バッファブロック 数 n = ( k + 1 ) / 2となる。 例えば、 上記のように参照ブロック数が 3のとき は 2プロック分、 5のときは 3プロック分の復元バッファを設ければよい。
このように本実施形態では、 差分データ生成送出部 1 1 0において、 差分デー タ復元部 1 2 0のデータ格納メモリ 1 2 1におけるコード領域の配置情報に相当 するコード領域情報ファイル 1 1 5を設けている。 データ更新用の差分データを 生成する際には、 コード領域情報ファイル 1 1 5を基に参照範囲を設定し、 差分 データ復元部 1 2 0のデータ格納メモリ 1 2 1においてァドレスが連続しかつ同 一ブロックサイズである 1つのコード領域ごとにブロック単位で更新前データと 更新後データとの差分を抽出する。 すなわち、 異なるプロックサイズのコード領 域ゃァドレスが不連続のコード領域にまたがって比較参照を行って差分データを 生成することのないようにする。 またこのとき、 コード領域情報ファイル 1 1 5 を基に書換えァドレスを生成し、 これをヘッダ情報として差分データに付加して 差分ファイル (結合ファイル 1 0 5 ) を生成する。 この書換えアドレスは、 差分 データを用いて復元した更新後データを書き込むための書き込み範囲の情報を含 む、 データ格納メモリ 1 2 1上のアドレス情報である。 なお、 書換えアドレスに は、 差分データを用いて更新後データを復元するための参照範囲の情報を含める ようにしても良い。
これにより、 結合ファイル 1 0 5を受信した差分データ復元部 1 2 0では、 結 合ファイル 1 0 5のヘッダ情報に基づき指定された参照範囲を参照して、 更新前 データと差分データとから更新後データを復元することができる。 この場合、 復 元側でアドレス変換などの処理が不要であり、 少ない簡単な処理ステップで正し い更新後データの復元が可能である。
また、 差分データ生成送出部 1 1 0では対象のブロックを含む前後のブロック を参照して差分データを生成し、 差分データ復元部 1 2 0ではこの差分データを 用いて対象のプロックを含む前後のプロックを参照して更新後データを復元し、 復元バッファ 1 2 5に書き込むようにする。 このようにブロック毎に分割して差 分データの生成及び更新後データの復元を行うことで、 演算処理の効率を上げる ことができ、 これに加えて、 複数のプロックを参照することによって、 差分デー タのデータ量を削減することが可能である。
また、 復元バッファ 1 2 5としてリングバッファ方式のバッファを用いて、 復 元後の蓄積した更新後データのうち、 データ格納メモリ 1 2 1において復元時に 参照されなくなった (参照範囲から外れて不要となった) ブロックの更新後デー タを順次書き込み、 更新前データを書き換えるようにする。 これにより、 更新前 データと更新後データをそれぞれ格納するメモリを設けたりする必要がなく、 デ ータ格納メモリ 1 2 1は最小限のメモリ容量で済み、 少ないハードウェア資源で 容易に正しくデータの更新を行うことが可能である。 また、 復元バッファ 1 2 5 についても、 リングバッファ方式によりメモリ容量を小さくできる。
上記のような本実施形態の構成及び動作により、 以下のような効果が得られる 第 1に、 データ格納メモリ 1 2 1の容量に制約があり、 同一プロックにおいて 更新前データから更新後データに書き換えるような場合であっても、 このデータ 格納メモリ 1 2 1の最大ブロック長の 2倍のサイズ (復元時に前後 3ブロックを 参照する場合) の復元バッファ 1 2 5と結合ファイル 1 0 5を格納する受信バッ ファ 1 2 3とを R AM上に設けるだけで、 データ格納メモリ 1 2 1上のデータを 更新することができる。
例えば従来の技術に記載した非特許文献 1、 非特許文献 2に開示されているよ うなデータ更新方法では、 主に、 ハードディスクなどの大容量の記憶装置を持つ 機器を対象とし、 記憶装置において復元時に参照する更新前データを格納してい る領域と、 復元した更新後データを格納する領域とが異なっている場合を想定し ている。 これに対し、 携帯電話機のような記憶領域の限られた組込み機器では、 復元した更新後データを更新前データとは別の領域に格納する余裕がない。 本実 施形態ではフラッシュ R OM上に更新前データ及ぴ更新後データを格納すること としているが、 両方のデータを格納するためにフラッシュ R O Mを 2倍搭載して プログラムの更新をすることは、 コスト的にも実装面積的にも困難である。 また 、 復元した更新後データを一旦 R AM上に展開し、 展開したものをフラッシュ R OMに書き込む方式も考えられるが、 R AMの容量に余裕がないと更新後データ をすベて展開できないため、 これも実現が困難である。 また、 R AMの場合には 容量向上が消費電力の増大を招くことも大きなデメリットである。
これに対し、 本実施形態では、 最小限のハードウェア資源によってデータの更 新が可能である。
第 2に、 更新対象のプログラム等のデータが格納されているコード領域と、 ュ 一ザが任意に格納するユーザデータ等が格納されているユーザ領域とが混在し、 コード領域がデータ格納メモリ 1 2 1上で不連続に配置されている場合であって も、 複数のプロックを参照しながら正しく更新後データの復元を行うことができ る。 また、 コード領域とユーザ領域とを区別してコード領域のみに対して処理を 実行できるため、 データ復元時にユーザ領域を参照したり、 誤ってユーザ領域に データを書き込んでしまうことを防止できる。
コード領域とユーザ領域とが混在している場合、 プログラムのバージョンアツ プの際には、 コード領域のデータのみが 1つのファイルに結合されて提供される ことが多い。 図 1 4や図 1 5に示した従来例のように、 コ ド領域とユーザデー タ領域が混在している場合に従来の差分生成、 復元方法を用いると、 コード領域 とユーザ領域とを区別して認識せず、 単にファイルやメモリ上の位置でしか参照 範囲や書き込み範囲を設定できないため、 差分生成時とデータ復元時とで参照範 囲が異なってしまい、 正常に復元することができない。 また、 更新前データをデ タ格納メモリ 1 2 1上に展開したときと同じ配置になるようにダミーデータを 挿入した場合は、 コード領域が不連続な部分では差分生成時にダミーデータを参 照してしまい、 データ復元時に参照すべきユーザ領域の内容と異なるため、 正常 に復元することができない。
これに対し、 本実施形態では、 コード領域中の同じサイズの連続したブロック 内のみを参照して差分生成及びデータ復元を行えるようにしているため、 正常に 更新後データの復元を行うことが可能である。 また、 受信側の機器においてデー タ復元時にァドレス変換などの処理が不要であり、 簡単な処理ステップで更新後 データを復元することができる。
図 1 0は比較例として、 従来の方法によるデータ復元時の動作を示したもので ある。 この比較例は、 図 7及び図 8に示した本実施形態における動作に対応して 記載したものである。 ここでは、 データ格納メモリ 6 0 1において 4つのブロッ ク a〜dの間に図中斜線で示すユーザ領域 6 0 2が存在する場合を示す。
データ復元の際には、 参照範囲のプロックの更新前データと差分データとに基 づき、 更新後データを復元して復元バッファ 6 0 3に格納し、 復元後の更新後デ ータをデータ格納メモリ 6 0 1の書き込み範囲のプロックに書き込んでいくこと になる。 この比較例においては、 図 1 0 ( E ) に示すように、 ブロック cの更新 後データの復元を行う際に、 参照範囲としてユーザ領域 6 0 2を参照してしまい 、 正常に復元することができない。
上述したように、 本実施形態によれば、 書換え可能不揮発性メモリ上にデータ を置き、 更新対象のコード領域とデータ更新しないユーザ領域が混在し、 異なる サイズのブロックが同じメモリ内で混在する場合であっても、 データ更新を正し く、 かつ単純な計算手順で実行することができる。 すなわち、 コード領域情報フ アイル及ぴコード領域設定手段を備えることにより、 複数プロックを参照しつつ 、 少ないメモリの利用のみで、 コード領域とユーザ領域の混在する書換え可能不 揮発メモリ上のデータを書換えることができ、 その実用的効果は大きい。
なお、 本発明は上述した実施形態に何ら限定されるものではなく、 その要旨を 逸脱しない範囲において種々の態様で実施し得るものである。
上記実施形態では、 メモリ空間上で連続しており、 かつサイズが同じプロック 群をコード領域として用いているが、 これはその定義におけるコード領域の範囲 内にデータの移動が限られている時に特に有効であり、 単純なアルゴリズムを用 いて差分生成、 復元を行うことができる。 メモリ空間上で不連続なプロック間でデータの移動が頻繁に行われる においては、 データの移動が行われる範囲のブロック群をメモリ空間上の連続性 に関わりなく 1つの論理的なコード領域として扱うことによって、 効率の良い差 分生成、 復元を行うことも可能である。
本発明を詳細にまた特定の実施態様を参照して説明したが、 本発明の精神と範 囲を逸脱することなく様々な変更や修正を加えることができることは当業者にと つて明らかである。
本出願は、 2003年 1月 31日出願の日本特許出願 No.2003-024412に基づくもの であり、 その内容はここに参照として取り込まれる。 ぐ産業上の利用可能性 >
以上説明したように本発明によれば、 メモリ容量等のハードウエア資源に制約 のある機器であっても、 メモリ上の同じ領域においてプログラム等のデータを更 新前データから更新後データに書き換えて更新することができる。 また、 メモリ 上で更新不可領域と更新可能領域が混在して更新前データや更新後データの格納 領域が不連続であったり、 異なるプロックサイズの格納領域が混在する場合であ つても、 データ更新を正しく、 かつ単純な計算手順で効率良く実行することがで きる。

Claims

請 求 の 範 囲
1 . 更新前データから更新後データへデータを書き換えるための差分デー タを生成する差分データ生成装置であって、
前記更新前データ及び前記更新後データに関する、 データ復元側のデータ格納 手段における記憶領域の配置情報を含む記憶領域情報を基に、 差分抽出時の更新 前データの参照範囲を設定する領域設定手段と、
前記更新後データと、 前記設定された参照範囲の前記更新前データとを比較参 照して差分データを生成する差分抽出手段と、
前記生成した差分データに、 前記データ復元側のデータ格納手段におけるデー タ復元時の対象データのアドレス情報を含むへッダ情報を付加した差分フアイル を生成する差分フアイル生成手段と、
を備えた差分データ生成装置。
2 . 前記記憶領域情報を保持する記憶領域情報保持手段を備え、 前記データ復元側の前記データ格納手段が、 前記更新前データまたは前記更新 後データをブロック単位で格納する記憶領域を有する場合に、
前記記憶領域情報は、 前記データ復元側のデータ格納手段における前記更新前 データ及び前記更新後データを格納する記憶領域のァドレス情報を含むものであ つて、 前記更新前データまたは前記更新後データをブロック単位で格納する記憶 領域において、 前記データ格納手段上のアドレスが連続し、 かつ同一のブロック サイズの一つまたは複数のプロックからなる記憶領域を一つの更新可能領域とし 、 この更新可能領域ごとの開始アドレス、 終了アドレス、 及ぴプロックサイズを 含むものである請求の範囲第 1項に記載の差分データ生成装置。
3 . 前記領域設定手段は、 前記更新前データ及び前記更新後データがデー タ復元側のデータ格納手段の記憶領域に対応して複数のプロックに分割されてい る場合に、 前記差分抽出時の更新前データの参照範囲として、 前記記憶領域情報 に基づいて対象のブロックとその前後の一つまたは複数のプロックとを合わせた 複数のプロックを参照するように前記参照範囲を設定し、 前記対象のプロックから求めた前記参照範囲が前記更新可能領域に収まらない 場合は、 前記参照範囲内であり、 かつ前記更新可能領域内である領域を新たに前 記参照範囲として設定するものである請求の範囲第 2項に記載の差分データ生成
4 . 前記ヘッダ情報は、 前記データ復元側のデータ格納手段におけるデー タ復元時の更新後データの書き込み範囲を示すァドレス情報を含むものである請 求の範囲第 1項または第 2項に記載の差分データ生成装置。
5 . 前記アドレス情報は、 前記データ復元側のデータ格納手段におけるデ ータ復元時の更新前データの参照範囲を含むものである請求の範囲第 4項に記載 の差分データ生成装置。
6 . 更新前データから更新後データへデータを書き換えるための差分デー タを生成する差分データ生成方法であって、
前記更新前データ及び前記更新後データに関する、 データ復元側のデータ格納 手段における記憶領域の配置情報を含む記憶領域情報を基に、 差分抽出時の更新 前データの参照範囲を設定する領域設定ステツプと、
前記更新後データと、 前記設定された参照範囲内の前記更新前データとを比較 参照して差分データを生成する差分抽出ステップと、
前記生成した差分データに、 前記データ復元側のデータ格納手段におけるデー タ復元時の対象データのァドレス情報を含むへッダ情報を付加した差分ファイル を生成する差分ファイル生成ステップと、
を有する差分データ生成方法。
7 . 前記データ復元側の前記データ格納手段が、 前記更新前データまたは 前記更新後データをプロック単位で格納する記憶領域を有する場合であり、 前記記憶領域情報は、 前記データ復元側のデータ格納手段における前記更新前 データ及び前記更新後データを格納する記憶領域のアドレス情報を含むものであ て、 前記更新前データまたは前記更新後データをプロック単位で格納する記憶 領域において、 前記データ格納手段上のア ドレスが連続し、 かつ同一のブロック サイズの一つまたは複数のプロックからなる記憶領域を一つの更新可能領域とし 、 この更新可能領域ごとの開始ア ドレス、 終了ア ドレス、 及びブロックサイズを 含むものである場合に、
前記領域設定ステップにおいて、 前記更新前データ及び前記更新後データがデ ータ復元側のデータ格納手段の記憶領域に対応して複数のプロックに分割されて いる場合に、 前記差分抽出時の更新前データの参照範囲として、 前記記憶領域情 報に基づいて対象のプロックとその前後の一つまたは複数のプロックとを合わせ た複数のプロックを参照するように前記参照範囲を設定し、
前記対象のブロックから求めた前記参照範囲が前記更新可能領域に収まらない 場合は、 前記参照範囲内であり、 かつ前記更新可能領域内である領域を新たに前 記参照範囲として設定することとした請求の範囲第 6項に記載の差分データ生成 方法。
8 . 請求の範囲第 6項または第 7項に記載の差分データ生成方法の手順を コンピュータにより実行するためのプログラム。
9 . 通信手段を介して受信した差分データを用いて、 更新前データから更 新後データを復元してデータを書き換える更新後データ復元装置であって、 前記更新前データ及ぴ前記更新後データを格納するデータ格納手段と、 前記通信手段を介して送られてきた差分データ及ぴデータ復元時の前記データ 格納手段における対象データのァ ドレス情報を受信する受信手段と、
前記ァドレス情報に基づき指定される前記データ格納手段における参照範囲の 更新前データを参照して、 この更新前データと前記差分データとから更新後デー タを復元するデータ復元手段と、
前記復元した更新後データを保持するパッファ手段と、
前記保持した更新後データを前記ァドレス情報に基づき指定される前記データ 格納手段における書き込み範囲に書き込むデータ書き込み手段と、
を備えた更新後データ復元装置。
1 0 . 前記ァドレス情報は、 前記差分データを生成する差分データ生成装 置において、 前記更新前データ及び前記更新後データに関する前記データ格納手 段における記憶領域の配置情報を含む記憶領域情報が保持され、 この記憶領域情 報を基に生成されるものであって、
前記データ格納手段におけるデ タ復元時の更新後データの書き込み範囲を含 むものである請求の範囲第 9項に記載の更新後データ復元装置。
1 1 . 前記ァドレス情報は、 前記データ格納手段におけるデータ復元時の 更新前データの参照範囲を含むものである請求の範囲第 1 0項に記載の更新後デ ータ復元装置。
1 2 . 前記データ格納手段は、 前記更新前データをプロック単位で複数の プロックに分割して格納するもので、 このデータ格納手段の記憶領域について、 前記差分データ生成装置に保持された記憶領域情報によって、 前記データ格納手 段上のア ドレスが連続し、 かつ同一のプロックサイズの一つまたは複数のブロッ クからなる記憶領域が一つの更新可能領域として定義されており、
前記データ復元手段は、 前記ァドレス情報に基づいて前記データ格納手段にお ける対象のブロックとその前後の一つまたは複数のプロックとを合わせた複数の プロックを前記参照範囲として参照して前記更新後データを復元し、
前記対象のプロックから求めた前記参照範囲が前記更新可能領域に収まらない 場合は、 前記参照範囲内であり、 かつ前記更新可能領域内である領域を新たに前 記参照範囲として参照して復元するものである請求の範囲第 1 0項または第 1 1 項に記載の更新後データ復元装置。
1 3 . 前記バッファ手段は、 リングバッファ方式のバッファにより構成さ れ、 前記プロックごとに復元された更新後データをそれぞれ保持する複数の領域 を有しており、
前記データ書き込み手段は、 前記パッファ手段に保持された更新後データの前 記データ格納手段における書き込み範囲が、 前記データ復元手段によるデータ復 元時の参照範囲から外れた場合に、 該当する更新後データを前記バッファ手段か ら前記データ格納手段に書き込み、 その後前記バッファ手段における書き込み完 了した更新後データの保持領域の開放を指示するものである請求の範囲第 1 2項 に記載の更新後データ復元装置。
1 4 . 通信手段を介して受信した差分データを用いて、 更新前データから 更新後データを復元してデータを書き換える更新後データ復元方法であって、 前記通信手段を介して送られてきた差分データ及び前記更新前データを格納す るデータ格納手段におけるデータ復元時の対象データのア ドレス情報を受信する 受信ステップと、
前記ァドレス情報に基づき指定される前記データ格納手段における参照範囲の 更新前データを参照して、 この更新前データと前記差分データとから更新後デー タを復元するデータ復元ステップと、
前記復元した更新後データを保持するバッファリングステップと、
前記保持した更新後データを前記ァドレス情報に基づき指定される前記データ 格納手段における書き込み範囲に書き込むデータ書き込みステップと、
を有する更新後データ復元方法。
1 5 . 前記ァドレス情報は、 前記差分データを生成する差分データ生成装 置において、 前記更新前データ及び前記更新後データに関する前記データ格納手 段における記憶領域の配置情報を含む記憶領域情報が保持され、 この記憶領域情 報を基に生成されるものであって、
前記データ格納手段におけるデータ復元時の更新後データの書き込み範囲を含 むものであり、
前記データ格納手段が、 前記更新前データをブロック単位で複数のブロックに 分割して格納するもので、 このデータ格納手段の記憶領域について、 前記差分デ ータ生成装置に保持された記憶領域情報によって、 前記データ格納手段上のァド レスが連続し、 かつ同一のブロックサイズの一つまたは複数のプロックからなる 記憶領域が一つの更新可能領域として定義されている場合に、
前記データ復元ステップにおいて、 前記ァドレス情報に基づいて前記データ格 納手段における対象のプロックとその前後の一つまたは複数のプロックとを合わ せた複数のプロックを前記参照範囲として参照して前記更新後データを復元し、 前記対象のプロックから求めた前記参照範囲が前記更新可能領域に収まらない 場合は、 前記参照範囲内であり、 かつ前記更新可能領域内である領域を新たに前 記参照範囲として参照して復元することとした請求の範囲第 1 4項に記載の更新 後データ復元方法。
1 6 . 前記アドレス情報は、 前記データ格納手段におけるデータ復元時の 更新前データの参照範囲を含むものである請求の範囲第 1 5項に記載の更新後デ ータ復元方法。
1 7 . 前記バッファリングステップにおいて、 リングバッファ方式のバッ ファにより構成され複数の領域を有するバッファ手段を用いて、 前記プロックご とに復元された更新後データを前記バッファ手段の複数の領域のうちの一つに保 持し、
前記データ書き込みステップにおいて、 前記バッファ手段に保持された更新後 データの前記データ格納手段における書き込み範囲が、 前記データ復元ステップ におけるデータ復元時の参照範囲から外れた場合に、 該当する更新後データを前 記バッファ手段から前記データ格納手段に書き込み、 その後前記バッファ手段に おける書き込み完了した更新後データの保持領域の開放を指示することとした請 求の範囲第 1 5項または第 1 6項に記載の更新後データ復元方法。
1 8 . 請求の範囲第 1 4〜1 7項のいずれかに記載の更新後データ復元方 法の手順をコンピュータにより実行するためのプログラム。
PCT/JP2003/013383 2003-01-31 2003-10-20 差分データ生成装置及び方法、更新後データ復元装置及び方法、並びにプログラム WO2004068348A1 (ja)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP03756702A EP1589430A1 (en) 2003-01-31 2003-10-20 Differential data creating device and method, updated data recovery device and method, and program
AU2003303838A AU2003303838A1 (en) 2003-01-31 2003-10-20 Differential data creating device and method, updated data recovery device and method, and program
US10/543,967 US20060200502A1 (en) 2003-01-31 2003-10-20 Differential data creating device and method, updated data recovery device and method, and program

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2003024412A JP4153324B2 (ja) 2003-01-31 2003-01-31 差分データ生成装置及び方法、更新後データ復元装置及び方法、並びにプログラム
JP2003-24412 2003-01-31

Publications (1)

Publication Number Publication Date
WO2004068348A1 true WO2004068348A1 (ja) 2004-08-12

Family

ID=32820762

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2003/013383 WO2004068348A1 (ja) 2003-01-31 2003-10-20 差分データ生成装置及び方法、更新後データ復元装置及び方法、並びにプログラム

Country Status (6)

Country Link
US (1) US20060200502A1 (ja)
EP (1) EP1589430A1 (ja)
JP (1) JP4153324B2 (ja)
CN (1) CN1742262A (ja)
AU (1) AU2003303838A1 (ja)
WO (1) WO2004068348A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1949761B (zh) * 2005-10-13 2010-09-15 腾讯科技(深圳)有限公司 一种数据同步方法及其差分编码方法

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7617226B1 (en) * 2006-02-10 2009-11-10 Google Inc. Document treadmilling system and method for updating documents in a document repository and recovering storage space from invalidated documents
US8185751B2 (en) * 2006-06-27 2012-05-22 Emc Corporation Achieving strong cryptographic correlation between higher level semantic units and lower level components in a secure data storage system
JP5103807B2 (ja) * 2006-06-30 2012-12-19 富士通株式会社 制御プログラム、制御方法、情報処理装置及び情報処理システム
JP4907380B2 (ja) * 2007-02-21 2012-03-28 株式会社Access データ生成方法、データ復元方法、データ生成装置およびデータ復元装置
CN100454265C (zh) * 2007-06-07 2009-01-21 华为技术有限公司 镜像恢复方法、存储设备及网络系统
JP5347657B2 (ja) * 2009-03-31 2013-11-20 富士通株式会社 データ記憶プログラム、方法、及び情報処理装置
US8316057B2 (en) * 2010-12-17 2012-11-20 International Business Machines Corporation Restoring deduplicated data objects from sequential backup devices
JP5653259B2 (ja) * 2011-03-08 2015-01-14 クラリオン株式会社 更新差分データ作成装置、データ更新システムおよび更新差分データ作成プログラム
CN102693168B (zh) * 2011-03-22 2014-12-31 中兴通讯股份有限公司 一种数据备份恢复的方法、系统和服务节点
US9871698B2 (en) * 2012-11-02 2018-01-16 Nec Corporation Information processing device
JP6155769B2 (ja) * 2013-03-29 2017-07-05 富士通株式会社 ストレージ制御装置、制御プログラム及び制御方法
WO2015194027A1 (ja) * 2014-06-20 2015-12-23 株式会社日立製作所 計算機システム、データ更新方法、および仮想化サーバ
EP3252605B1 (en) * 2015-01-26 2022-04-06 Hitachi Astemo, Ltd. Vehicle-mounted control device, program writing device, program generating device and program
EP3358465B1 (en) * 2015-09-29 2024-04-17 Hitachi Astemo, Ltd. In-vehicle control device, program update system, and program update software
JP6609508B2 (ja) * 2016-04-27 2019-11-20 日立オートモティブシステムズ株式会社 車両用電子制御装置、プログラム更新方法
WO2018159691A1 (ja) * 2017-02-28 2018-09-07 日本電信電話株式会社 通信処理装置、情報処理装置、及び、通信処理装置の制御方法
JP7013918B2 (ja) * 2018-02-16 2022-02-01 トヨタ自動車株式会社 車両制御装置、プログラム更新方法およびプログラム
CN108647116A (zh) * 2018-04-13 2018-10-12 深圳大普微电子科技有限公司 数据恢复方法和存储设备
JP7265120B2 (ja) * 2019-01-10 2023-04-26 富士通株式会社 データ収集プログラム、データ収集装置およびデータ収集方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02168321A (ja) * 1988-12-22 1990-06-28 Nec Corp プログラム差分抽出方式
JPH06274384A (ja) * 1993-03-22 1994-09-30 N T T Data Tsushin Kk 実行ファイル差分抽出/更新装置及び実行ファイル差分抽出方法
JPH09204326A (ja) * 1996-01-29 1997-08-05 Nec Software Ltd 画像データ格納制御装置
JP2003337723A (ja) * 2002-03-11 2003-11-28 Fujitsu Ltd 差分転送方法、プログラム及びシステム

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3516362B2 (ja) * 1995-03-01 2004-04-05 富士通株式会社 共有データ処理装置及び共有データ処理システム
US5832520A (en) * 1996-07-03 1998-11-03 Miller, Call, Plauck And Miller Automatic file differencing and updating system
US6775423B2 (en) * 2000-05-03 2004-08-10 Microsoft Corporation Systems and methods for incrementally updating an image in flash memory
US6925467B2 (en) * 2002-05-13 2005-08-02 Innopath Software, Inc. Byte-level file differencing and updating algorithms

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02168321A (ja) * 1988-12-22 1990-06-28 Nec Corp プログラム差分抽出方式
JPH06274384A (ja) * 1993-03-22 1994-09-30 N T T Data Tsushin Kk 実行ファイル差分抽出/更新装置及び実行ファイル差分抽出方法
JPH09204326A (ja) * 1996-01-29 1997-08-05 Nec Software Ltd 画像データ格納制御装置
JP2003337723A (ja) * 2002-03-11 2003-11-28 Fujitsu Ltd 差分転送方法、プログラム及びシステム

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1949761B (zh) * 2005-10-13 2010-09-15 腾讯科技(深圳)有限公司 一种数据同步方法及其差分编码方法

Also Published As

Publication number Publication date
EP1589430A1 (en) 2005-10-26
CN1742262A (zh) 2006-03-01
JP2004234503A (ja) 2004-08-19
JP4153324B2 (ja) 2008-09-24
US20060200502A1 (en) 2006-09-07
AU2003303838A1 (en) 2004-08-23

Similar Documents

Publication Publication Date Title
JP4153324B2 (ja) 差分データ生成装置及び方法、更新後データ復元装置及び方法、並びにプログラム
CN108027753B (zh) 车载控制装置、程序更新系统以及保存有程序更新软件的存储介质
US8418167B2 (en) Methods and systems for updating content including a compressed version
US8200886B2 (en) Efficient system and method for updating a memory device
KR102319657B1 (ko) 저장된 데이터 유닛들의 동작 관리
US20170336992A1 (en) Method, device, and program for managing a flash memory for mass storage
US8561049B2 (en) Method and system for updating content stored in a storage device
JP2007241576A (ja) 不揮発性記憶装置およびそのデータ書込み方法
US9043680B2 (en) Method and system for in-place updating content stored in a storage device
EP3834082B1 (en) Memory optimized block-based differential update algorithm
US8578359B2 (en) Method and apparatus for reliable in-place update
US9577666B2 (en) Method and system
US8689207B2 (en) Performing an in-place update of an operating storage device
JP5100500B2 (ja) データ書き換えシステム及び新版データ作成装置及び差分データ作成装置及び新版データ作成プログラム及び差分データ作成プログラム
JP7317609B2 (ja) 電子制御装置
JP2006004177A (ja) プログラムのダウンロード方法
CN113986126A (zh) 基于固态硬盘的tcg数据删除方法、装置及计算机设备
JP2003018017A (ja) Biosプログラムの圧縮方法及び更新方法

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE EG ES FI GB GD GE GH GM HR HU ID IL IN IS KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SY TJ TM TN TR TT TZ UA UG US UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 20038A92227

Country of ref document: CN

WWE Wipo information: entry into national phase

Ref document number: 10543967

Country of ref document: US

WWE Wipo information: entry into national phase

Ref document number: 2003756702

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 2003756702

Country of ref document: EP

WWW Wipo information: withdrawn in national office

Ref document number: 2003756702

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 10543967

Country of ref document: US