Patent ID: 8176369

Claim:
A count data recording device which records count data pieces in memory areas, the count data pieces representing counting values which vary monotonously at a predetermined width from a predetermined value, the device comprising: a storage unit that includes N memory areas respectively storing the count data pieces, where N is an integer equal to or greater than 4; a data writing unit that writes a count data piece to said storage unit; a data reading unit that reads the count data piece from said storage unit; and a data restoring unit that detects a corruption in the count data piece stored in said storage unit and restores the corruption, wherein said data writing unit records the count data piece in said storage unit by: defining a range of a minor loop by selecting M memory areas out of the N memory areas according to a predetermined order, where M is an integer equal to or greater than 3 and smaller than N, the predetermined order defining an order of the memory areas used for recording the count data piece; recording the count data piece using the memory area included in the range of the minor loop according to the predetermined order; and shifting the range of the minor loop backward according to the predetermined order after recording the count data piece using a last memory area within the range of the minor loop and setting a new range of the minor loop and wherein said data restoring unit: derives a sorted count data sequence by sorting count data pieces in the N memory areas so that values of the count data pieces change monotonously; derives a count data difference value sequence by obtaining difference values between adjacent count data pieces in the sorted count data sequence; and detects and restores the corruption in the count data pieces stored in the N memory areas based on the sorted count data sequence and the count data difference value sequence.