A computer device for logging changes to a user preference includes two log files, and a first and second file. The changes are written to the first file. The changes are then flushed to the log file with a marker. The marker is moved to the other log file before the changes are written to the second file. If the changes are successfully written, the changes are loaded from the second file into short term memory (RAM). If there is a transient error but there are no more changes after the error, the changes flushed to the log file are loaded into RAM. If the transient error occurs and there are further changes, all changes (before and after the error) are flushed to the log file with the marker, after which the marker is moved to the other log file before the changes are written to the second file.
|
4. A method for logging changes made to a user preference in a computer device, comprising:
writing the changes made to the user preference into a configuration file in a short term memory of the computer device;
in response to a first flush operation, writing the changes made to the user preference from the configuration file in the short term memory of the computer device to a log file of a pair of log files in a long term memory of the computer device, wherein each log file of the pair of log files in the long term memory comprises a header section divided into two subdivisions, each subdivision containing an identifier, and a time stamp section containing a time when either the identification operation or a flush operation occurred, a dirty vector section containing information that identifies the location of the changes made to the user preference written to the configuration file in the short term memory, a plurality of data sections, each data section containing the changes made to the user preference written from corresponding data sections of the configuration file in the short term memory; and
in response to a first write operation after the completion of the first flush operation, writing the changes made to the user preference from the configuration file in the short term memory of the computer device to a configuration file in the long term memory of the computer device.
1. A computer device for logging changes made to a user preference, wherein the computer device includes a processor and comprises:
a configuration file in a short term memory to write changes made to the user preference;
in response to a flush operation, writing the changes made to the user preference from the configuration file in the short term memory to a log file of a pair of log files in a long term memory, the flush operation including an identification operation that sets a marker that identifies the log file of the pair of log files, wherein each log file of the pair of log files in the long term memory comprises a header section divided into two subdivisions, each subdivision containing an identifier, and a time stamp section containing a time when either the identification operation or a flush operation occurred, a dirty vector section containing information that identifies the location of the changes made to the user preference written to the configuration file in the short term memory, a plurality of data sections, each data section containing the changes made to the user preference written from corresponding data sections of the configuration file in the short term memory; and
in response to a write operation after a completion of the flush operation, writing the change made to the user preference from the configuration file in the short term memory to a configuration file in the long term memory.
15. A method for logging changes made to a user preference in a computer device, comprising:
writing the changes made to the user preference in a registry hive file in a short term memory of the computer device;
in response to a flush operation, writing the changes made to the user preference from the registry hive file in the short term memory of the computer device to a hive log file of a pair of hive log files in a long term memory of the computer device, wherein the hive log file is identified by setting a marker associated with the hive log file before writing the changes, wherein each hive log file of the pair of hive log files in the long term memory comprises a header section divided into two subdivisions, each subdivision containing an identifier, and a time stamp section containing a time when either the identification operation or a flush operation occurred, a dirty vector section containing information that identifies the location of the changes made to the user preference written to the configuration file in the short term memory, a plurality of data sections, each data section containing the changes made to the user preference written from corresponding data sections of the configuration file in the short term memory; and
in response to a write operation after the completion of the flush operation, (i) setting the marker from the hive log file of the pair of hive log files to another hive log file of the pair of hive log files in the long term memory; and (ii) writing the changes made to the user preference from the registry hive file in the short term memory of the computer device to a hive primary file in the long term memory of the computer device.
2. A computer device for logging changes made to the user preference as claimed in
a header section divided into two subdivisions, each subdivision containing an identifier; and
a plurality of data sections, each data section containing the changes made to the user preference written to the configuration file in the short term memory.
3. A computer device for logging changes made to the user preference as claimed in
a header section divided into two subdivisions, each subdivision containing an identifier;
a time stamp section containing the time of a write operation; and
a plurality of data sections, each data section containing the changes made to the user preference written from corresponding data sections of the configuration file in the short term memory.
5. A method for logging changes made to the user preference as claimed in
writing a same identifier to both subdivisions of a pair of subdivisions of a header section of the configuration file in the short term memory followed by writing the changes made to the user preference in one or more data sections of the configuration file in the short term memory.
6. A method for logging changes made to the user preference as claimed in
matching the identifiers in both subdivisions of the pair of subdivisions of the header section of the configuration file in the short term memory;
after matching the identifiers, identifying the log file of the pair of log files by setting a marker associated with the log file;
after setting the marker, writing the identifiers in both subdivisions of a pair of subdivisions of a header section of the log file of the pair of log files that match the identifiers in both subdivisions of the pair of subdivisions of the header section of the configuration file in the short term memory;
after writing the identifiers to both subdivisions of the pair of subdivisions of the header section of the log file of the pair of log files, writing a time of the first flush operation in a time stamp section of the log file of the pair of log files;
after writing the time of the first flush operation, writing information identifying a location of the changes to the user preference written in one or more data sections of the configuration file in the short term memory in a dirty vector section of the log file of the pair of log files; and
after writing the information identifying the location of the changes, writing the changes made to the user preference from the configuration file in the short term memory to one or more data sections of the log file of the pair of log files, the one or more data sections corresponding to the data sections of the configuration file in the short term memory where changes made to the user preference are written.
7. A method for logging changes made to the user preference as claimed in
mismatching the identifiers in both subdivisions of the pair of subdivisions of the header section of the configuration file in the short term memory;
after mismatching the identifiers, writing the identifiers in both subdivisions of a pair of subdivisions of a header section of the configuration file in the long term memory to match the mismatched identifiers in both subdivisions of the pair of subdivisions of the header section of the configuration file in the short term memory;
after writing the mismatched identifiers in both subdivisions of the pair of subdivisions of the header section of the configuration file in the long term memory, writing a time of the first write operation in a time stamp section of the configuration file in the long term memory;
after writing the time of the first write operation, identifying another log file of the pair of log files on the hard disk by setting the marker from the log file of the pair of log files to the other log file of the pair of tog files;
after setting the marker, writing a time of setting the marker in a time stamp section of the other log file of the pair of log files; and
after writing the time of setting the marker, writing the changes made to the user preference from the configuration file in the short term memory to one or more data sections of the configuration file in the long term memory, the one or more data sections corresponding to the data sections of the configuration file in the short term memory where changes made to the user preference are written.
8. A method for logging changes made to the user preference as claimed in
matching the identifiers in both subdivisions of the pair of subdivisions of the header section of the configuration file in the long term memory; and
loading the changes made to the user preference from the configuration file in the long term memory into short term memory when the computer device is turned on a next time.
9. A method for logging changes made to the user preference as claimed in
loading the changes made to the user preference from the log file of the pair of log files into short term memory when the computer device is turned on a next time.
10. A method for logging changes made to the user preference as claimed in
if a second flush operation does not occur after the first transient error, loading the changes made to the user preference from the log file of the pair of log files into short term memory when the computer device is turned on a next time; and
if the second flush operation occurs after the first transient error:
matching the identifiers of the pair of subdivisions of the header section of the configuration file in short term memory;
after matching the identifiers, writing the identifiers in both subdivisions of a pair of subdivisions of a header section of the other log file of the pair of log files that match the identifier in the subdivisions of the header section of the configuration file in the short term memory;
after writing the identifier to the pair of subdivisions of the header section of the other log file of the pair of log files, writing a time of the second flush operation in a time stamp section of the other log file of the pair of log files;
after writing the time of the second flush operation, writing information identifying a location of the changes to the user preference written in one or more data sections of the configuration file in short term memory in a dirty vector section of the other log file of the pair of log files; and
after writing the location information, writing the changes made to the user preference from the configuration file in short term memory to one or more data sections of the other log file of the pair of log files, the one or more data sections corresponding to the data sections of the configuration file in short term memory where changes made to the user preference are written.
11. A method for logging changes made to the user preference as claimed in
mismatching the identifiers of the pair of subdivisions of the header section of the configuration file in short term memory;
after mismatching the identifiers, writing the identifiers in both subdivisions of the pair of subdivisions of the header section of the configuration file in the long term memory to match the mismatched identifiers of the pair of subdivisions of the header section of the configuration file in short term memory;
after writing the mismatched identifiers in the pair of subdivisions of the header section of the configuration file in the long term memory, writing a lime of the second write operation in the time stamp section of the configuration file in the long term memory;
after writing the time of the second write operation, re-identifying the log file of the pair of log files in the long term memory by setting the marker from the other log file of the pair of log files to the log file of the pair of log files;
after re-identifying the log file, writing a time of setting the marker in the time stamp section of the log file of the pair of log files; and
after writing the time of setting the marker, writing the changes made to the user preference from the configuration file in the short term memory to one or more data sections of the configuration file in the long term memory, the one or more data sections corresponding to the data sections of the configuration file in the short term memory where changes made to the user preference are written.
12. A method for logging changes made to the user preference as claimed in
matching the identifiers of the pair of subdivisions of the header section of the configuration file in long term memory; and
loading the changes made to the user preference from the configuration file in the long term memory into short term memory when the computer device is turned on a next time.
13. A method for logging changes made to the user preference as claimed in
loading the changes made to the user preference from the other log file of the pair of log files into short term memory when the computer device is turned on a next time.
14. A method for logging changes made to the user preference as claimed in
if a third flush operation does not occur after the second transient error, loading the changes made to the user preference from the other log file of the pair of log files into short term memory when the computer device is turned on a next time.
16. A method for logging changes made to a user preference as claimed in
17. A method for logging changes made to a user preference as claimed in
18. A method of logging changes made to a user preference as claimed in
19. A method of logging changes made to a user preference as claimed in
|
Current computer device operating systems store configuration data in a configuration file located in long term, frequently called permanent, memory. Computer devices include, but are not limited to, desktop and laptop personal computer, personal digital assistant (PDA), cellular telephone, etc. Configuration data includes file associations, hardware, operating system and installed application settings, display, printer, and other connected peripheral settings, performance data, etc. (collectively, hereinafter “user preference”). When changes are made to the user preference, the changes (or dirty data) are written in a configuration file in a computer device memory located in short-term memory, frequently called Random Access Memory (RAM).
At regular time intervals, the dirty data is flushed from the short term memory to a log file located in long term memory before the dirty data is written to the configuration file located in long term memory. Long term memory includes the hard drive of a desktop or laptop computer or the flash memory of a PDA or cellular telephone, for example.
Every time the computer device is turned on, the operating system loads the user preference stored in the configuration file located in long term memory into short term memory for applications to execute according to the changes made to the user preference. For example, in a computer device that includes a Windows® type operating system, a configuration file stored on a hard disk is called a hive primary file (hereinafter HPF), a configuration file stored in memory, e.g., RAM, is called a registry hive file or an in-memory hive file (hereinafter, HMF), and a log file stored on the hard disk is called a hive log file (hereinafter, HLF). Accordingly, when user preference changes are made, the changes are written to the HMF before the changes are flushed from the HMF to the HLF and subsequently written from the HMF to the HPF. Windows® loads the contents of the HPF into RAM for applications to execute according to the changes made to the user preference. Maintaining the user preference stored in the configuration file on the hard disk (i.e., the HPF) current as user preference changes are made is critical if applications are to execute according to the latest changes made to the user preference. The user preference stored in the configuration file on the hard disk (i.e., the HPF) may not be current, i.e., may not include changes made to the user preference if a computer device “crashes” or a transient error occurs while writing from the configuration file in memory (i.e., the HMF) to the configuration file on the hard disk, (i.e., the HPF). Since the configuration file in memory, the HMF, is deleted when the computer device is shut down, as usually occurs when a computer device “crashes”, the “dirty data” stored in the log file, i.e., the HLF, is loaded into memory when the computer device is turned on the next time. Dirty data comprises changes made to the user preference not yet transferred to the HPF. In the case of a transient error, while changes to the user preference continue to be written to the configuration file in memory (which is deleted when the computer device is shut down), the operating system prevents the dirty data from being written to the configuration file on the hard disk or flushed to the log file. As a result, the incomplete dirty data in the log file is loaded into memory when the computer device is next turned on.
Returning to
HLFo 205 also includes data sections 208, 209, 210, . . . shown as located below the dirty vector section 207. Similar to HMFo 200, the data sections of HLFo 205 change in size and number depending on the amount of dirty data to be written from HMFo 200 to HLFo 205. In this example, data sections 209 and 210 of HLFo 205 contain dirty data written from data sections 203 and 204, respectively, of HMFo 200. The dirty data (written at block 107 in
Returning to
Returning to
Returning to
If the computer crashes before all of the dirty data is written from HMFo to HPFo (the “YES IF CRASH” branch from block 112), at block 114, the user preference from HLFo is loaded into memory when the computer device is turned on the next time. The flow cycles back to block 101. If a transient error occurs before all of the dirty data is written from HMFo to HPFo (the “YES IF TE” branch from block 112), a further check is made at block 113 to determine if HMFo needs flushing. More specifically, the further check is made to determine if the user has made further changes to the user preference written to HMFo since the last flush operation at block 103. If the further check fails (the “NO” branch from block 113), no more dirty data was written to HMFo after the last flush operation. In this situation, even though the transient error occurred before all of the dirty data was written to HPFo, the dirty data in HLFo is valid. If the further check fails, at block 114, the user preference from HLFo is loaded into memory when the computer device is turned on the next time. The flow cycles back to block 101.
Returning to
Even though most current computer devices use a log file of the type generally described above to log changes made to a user preference, some systems that control several computer devices use dual copies of the log file. The dual copies are stored on two different computer devices in an effort to ensure that both copies are not impacted by a “crash” or transient error in one computer device. Since the content of the dual copies is identical before the “crash” or transient error occurs, changes made to the user preference after the “crash” or transient error cannot be written to the configuration file of the computer device experiencing the “crash” or transient error. This means that user applications running on the computer device experiencing the “crash” or transient error will not execute according to all changes made to the user preference, until a system administrator matches the dual copies of the log file.
As will be appreciated from the foregoing discussion, current operating systems that use a log file or dual copies of a log file may not always write all changes made to a user preference before a “crash” or after a transient error. Since most users are unaware of the transient error, most users will not realize that changes made to a user preference were not written until an application does not execute according to the changes made to the user preference. As a result, users are required to redo the changes made to the user preference prior to when the computer device “crashed” or the transient error occurred, that were not written to the user preference before the crash or transient error.
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This summary is not intended to identify key features of the claimed subject matter, nor is it intended to be used as an aid in determining the scope of the claimed subject matter.
A method for logging changes made to a user preference in a computer device is provided. The computer device includes two log files located in long term memory for logging the user preference. The computer device also includes a first configuration file located in short term memory and a second configuration file located in long term memory. When changes are made to the user preference, the changes (dirty data) are written to the first configuration file. At regular time intervals or when a user initiates a flush operation, the dirty data is flushed from the first configuration file to one of the log files. The log file to which the dirty data is flushed is marked (i.e., identified as the recipient of the flushed dirty data). The other log file (to which dirty data is not flushed) is not marked. When the dirty data is ready to be written from the first configuration file to the second configuration file, the marker is moved from the marked log file to the unmarked log file before the dirty data is written to the second configuration file. If all of the dirty data is successfully written from the first configuration file to the second configuration file, the dirty data from the second configuration file is loaded by the operating system of the computer device into RAM when the computer device is next turned on. If the computer device “crashes” before all of the dirty data is written from the first configuration file to the second configuration file, the dirty data flushed to the log file (the log file currently without the marker) is loaded by the operating system into RAM when the computer device is next turned on. If there is a transient error (an error that allows changes made to the user preference to be written to the first configuration file yet prohibits dirty data to be written to the second configuration file) before all of the dirty data is written from the first configuration file to the second configuration file, and there are no more changes made to the user preference after the last flush operation, the dirty data flushed to the log file (the log file currently without the marker) is loaded by the operating system into RAM when the computer device is next turned on. If the transient error occurs before all of the dirty data is written from the first configuration file to the second configuration file and there are changes made to the user preference after the last flush operation, all of the dirty data (changes made to the user preference before and after the transient error) is flushed to the log file with the marker at the next scheduled flush operation or if the user initiates a flush operation. When the dirty data is ready to be written from the first configuration file to the second configuration file, the marker is moved from the marked log file to the unmarked log file before the dirty data is written to the second configuration file. The dirty data written to the second configuration file is loaded by the operating system into RAM when the computer device is next turned on.
Having two log files insures that when changes are made to the user preference before a “crash” or after an transient error occurs, all of the dirty data is either flushed to one of the two log files or written to the second configuration file from where the changes can be loaded into memory when the computer device is next turned on. As a result, applications execute according to the changes made to the user preference without a user being required to redo any changes made to the user preference before a “crash” or after a transient error occurs.
The foregoing aspects and many of the attendant advantages of the disclosed subject matter will become more readily appreciated as the same become better understood by reference to the following detailed description, when taken in conjunction with the accompanying drawings, wherein:
The following description includes numerous specific details intended to provide a thorough description of exemplary embodiments of the disclosed subject matter. It will be apparent, however, to one skilled in the art that the disclosed subject matter may be practiced without these specific details. In other instances, well known features have not been described in detail so as not to obscure the disclosed subject matter.
A method for logging changes made to a user preference in a computer device is disclosed. As mentioned above, a user preference is a collection of configuration data of the computer device that includes file associations, preferences for a current user, settings for hardware, operating system and installed applications, settings for display, printers, and other peripherals connected, performance data, etc. While the disclosed subject matter is described in a computer device controlled by a Windows® type operating system, it is to be understood that this exemplary embodiment should be construed as exemplary and not limiting since the disclosed subject matter may also find use in computer devices employing other operating systems.
In accordance with the disclosed subject matter, the computer device includes two hive log files (i.e., HLFs) labeled HLF1 and HLF2 located in the long term memory, such as a hard disk, of the computer device. As more fully described below, HLF1 and HLF2 are used to log the user preference. It is to be understood that the labels HLF1 and HLF2 should be construed as illustrative and so not limiting. In this regard, the labels can be interchanged or given some other name without departing from the scope of the disclosed subject matter.
The computer device also includes an in-memory hive file (i.e., an HMF) labeled HMFn, and a hive primary file (i.e., an HPF) labeled HPFn. Again, it is to be understood that the labels HMFn and HPFn should be construed as illustrative and not as limiting. In this regard, the labels can be given some other name without departing from the scope of the disclosed subject matter. Further, as noted above, even though the disclosed subject matter is described in a computer device controlled by a Windows® type operating system, it is to be understood that the disclosed subject matter is independent of the type of operating system since the disclosed subject matter can be practiced in computer devices controlled by other types of operating systems.
Returning to
The difference between the time stamp section of prior art hive log files and the time stamp section of HLF1 and HLF2 lies in the use of the time stamp. The time stamp in HLF1 and HLF2 is used to select the correct log file instead of validating the hive log file as in prior art computer devices. Illustrated as located below the time stamp section 409 is a dirty vector 410. Dirty vector 410 contains information that describes the location of the dirty data in the data sections of HMFn 400. More specifically, comparing
Returning to
HPFn 415 also includes data sections 418, 419, 420, 421, . . . illustrated as located below the time stamp section 417. Data sections 419 and 421 contain dirty data (illustrated by a sequence of Xs) that corresponds to the dirty data written from data sections 403 and 405 of HMFn 400 at block 317 of
Returning to
Returning to
Returning to
Returning to
Returning to
Turning to
Returning to
Returning to
Returning to
While an illustrative embodiment has been illustrated and described, it will be appreciated that various changes can be made therein without departing from the spirit and scope of the disclosed subject matter. Thus, while a preferred embodiment of the computer device for logging user preference is described herein, it is to be understood that the embodiment is not limited to the described computer device but rather by the following claims and their full scope of equivalents. In this regard, it is also to be understood that the pictorial diagrams and the description of sections being “below” other sections is for illustration only and does not describe any limiting physical relationship.
Jung, Kenneth M, Sambotin, Dragos C
Patent | Priority | Assignee | Title |
8479062, | Dec 03 2010 | GLOBALFOUNDRIES U S INC | Program disturb error logging and correction for flash memory |
Patent | Priority | Assignee | Title |
4878167, | Jun 30 1986 | International Business Machines Corporation | Method for managing reuse of hard log space by mapping log data during state changes and discarding the log data |
5307497, | Jun 25 1990 | LENOVO SINGAPORE PTE LTD | Disk operating system loadable from read only memory using installable file system interface |
5577222, | Dec 17 1992 | International Business Machines Corporation | System for asynchronously duplexing remote data by sending DASD data grouped as a unit periodically established by checkpoint based upon the latest time value |
5745686, | Jun 07 1995 | Fuji Xerox Co., Ltd. | Information tracing system and information tracing method |
5828821, | Jun 19 1995 | Kabushiki Kaisha Toshiba | Checkpoint restart method and apparatus utilizing multiple log memories |
6321234, | Sep 18 1996 | SYBASE, INC | Database server system with improved methods for logging transactions |
6732124, | Mar 30 1999 | Fujitsu Limited | Data processing system with mechanism for restoring file systems based on transaction logs |
6751606, | Dec 23 1998 | Microsoft Technology Licensing, LLC | System for enhancing a query interface |
7035964, | Mar 17 1999 | Robert Bosch GmbH | Method and device for securing data when altering the storage contents of control units |
20030135524, | |||
20040030703, | |||
20040045016, |
Executed on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Jun 28 2006 | JUNG, KENNETH M | Microsoft Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 018055 | /0780 | |
Jun 28 2006 | SAMBOTIN, DRAGOS C | Microsoft Corporation | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 018055 | /0780 | |
Jun 30 2006 | Microsoft Corporation | (assignment on the face of the patent) | / | |||
Oct 14 2014 | Microsoft Corporation | Microsoft Technology Licensing, LLC | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 034542 | /0001 |
Date | Maintenance Fee Events |
Dec 09 2009 | ASPN: Payor Number Assigned. |
Mar 18 2013 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
May 11 2017 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Jul 12 2021 | REM: Maintenance Fee Reminder Mailed. |
Dec 27 2021 | EXP: Patent Expired for Failure to Pay Maintenance Fees. |
Date | Maintenance Schedule |
Nov 24 2012 | 4 years fee payment window open |
May 24 2013 | 6 months grace period start (w surcharge) |
Nov 24 2013 | patent expiry (for year 4) |
Nov 24 2015 | 2 years to revive unintentionally abandoned end. (for year 4) |
Nov 24 2016 | 8 years fee payment window open |
May 24 2017 | 6 months grace period start (w surcharge) |
Nov 24 2017 | patent expiry (for year 8) |
Nov 24 2019 | 2 years to revive unintentionally abandoned end. (for year 8) |
Nov 24 2020 | 12 years fee payment window open |
May 24 2021 | 6 months grace period start (w surcharge) |
Nov 24 2021 | patent expiry (for year 12) |
Nov 24 2023 | 2 years to revive unintentionally abandoned end. (for year 12) |