1. Technical Field
The present invention relates to an improved data processing system and in particular to a method and apparatus for processing data. Still more particularly, the present invention relates to a method, apparatus, and computer instructions for an automated, incremental versioning, backup and restore mechanism for data elements within a computer system.
2. Description of Related Art
Data storage components, variables, collections, and multi-dimensional collections are used throughout all computer applications. During the execution of an application, the contents of these types of data storage elements will change or evolve. These changes occur due to modifications or updates to the data. These changes may be made by user input or through programmatic means. As the program logic of an application progresses, situations often arise in which the program state and the content of the data storage elements need to be reset to a prior state. This state may be an arbitrary state selected by the user or programmatically by an application. Mechanisms for incrementally saving and resetting data to a prior known state are present in many applications.
Currently available mechanisms are found in applications, such as word processors, for resetting or rolling back to a previous state. A word processor may allow a user to undo changes to a document, such as deletions, insertions, or formatting changes.
A significant problem with existing mechanisms is that they are prone to inefficiencies and require explicit management by the application programmer or end user. Therefore, it would be advantageous to have an improved method, apparatus, and computer instructions for data versioning and recovery management.
The present invention provides a method, apparatus, and computer instructions for managing data. An application requests a data element from the memory management subsystem (MMS). The MMS allocates space for the data element and returns a reference (memory address) to the requesting application. The requested data element has a number of dimensions that represent data elements accessible by the application for storing application data. When the MMS allocates the requested space, it also creates an extra dimension on each data element, only accessible by the MMS that it uses to maintain versioning data. The MMS stores application data into the data element in response to a configurable event. All application data is restored to a requested state using the data structure in response to a user request from a user interface to restore the data to a prior state.
The novel features believed characteristic of the invention are set forth in the appended claims. The invention itself, however, as well as a preferred mode of use, further objectives and advantages thereof, will best be understood by reference to the following detailed description of an illustrative embodiment when read in conjunction with the accompanying drawings, wherein:
With reference now to the figures and in particular with reference to
Referring to
Peripheral component interconnect (PCI) bus bridge 214 connected to I/O bus 212 provides an interface to PCI local bus 216. A number of modems may be connected to PCI local bus 216. Typical PCI bus implementations will support four PCI expansion slots or add-in connectors. Communications links to other data processing systems may be provided through modem 218 and network adapter 220 connected to PCI local bus 216 through add-in connectors.
Additional PCI bus bridges 222 and 224 provide interfaces for additional PCI local buses 226 and 228, from which additional modems or network adapters may be supported. In this manner, data processing system 200 allows connections to multiple network computers. A memory-mapped graphics adapter 230 and hard disk 232 may also be connected to I/O bus 212 as depicted, either directly or indirectly.
Those of ordinary skill in the art will appreciate that the hardware in
The present invention provides an improved method, apparatus, and computer instructions for data versioning and recovery management. The mechanism of the present invention can be implemented in various ways. For example, the mechanism of the present invention may be implemented within an operating system or a virtual machine.
In these illustrative examples, a virtual machine is a self-contained operating environment that behaves as if it were a separate computer from other operating environments on a particular data processing system. For example, applets, such as Java applets run on a Java virtual machine, which has no access to the host operating system in the data processing system. In these illustrative examples, a virtual machine has no contact with the operating system providing for insulation from the operating system and reduces the possibility of applications running on a virtual machine from damaging other files or applications belonging to the operating system or other virtual machines. A Java virtual machine in these examples is the software that converts the Java intermediate language, bytecodes, into machine language and executes those machine language instructions. A Java virtual machine is a Java interpreter in these examples. A Java virtual machine may be incorporated into a web browser to execute the Java applets. Additionally, a Java virtual machine also may be installed on a web server to execute server side Java programs. A Java virtual machine also may be installed on the client to run stand-alone Java applications.
In these illustrative examples, one or more applications may be associated with a Java virtual machine. When data versioning occurs, the data versioning occurs for all data associated with a particular Java virtual machine. Thus, if versioning and recovery management is desired for individual applications, each application is associated with a separate Java virtual machine in these illustrative examples.
With reference now to
In addition to creating the data elements as requested by the application, an additional dimension is added to data elements 312 and 314. This additional dimension is visible only to memory management subsystem 310 in these examples. The user does not see the data in the application. Only memory management subsystem 310 accesses or manages this additional dimension. In this example, data stack 316 is associated with data element 312 and data element 314. Data stack 316 contains a snapshot of all of the memory handled by memory subsystem 310 in Java virtual machine 300. An index into the data stack identifies a snapshot of the memory. The index may be based on different criteria. For example, in one illustrative embodiment, the index may take the form of time stamps. In another example, the index may be numerical or even based on a user event.
By indexing through the added dimension, memory management subsystem 310 is able to restore data elements 312 and 314 to a prior version from data stack 316. In these illustrative examples, the user restores all of the memory for Java virtual machine 300 to any prior indexed state stored in data stack 316. As a result, both data elements are restored to the same point when a restoration of data occurs.
Data stack 316 may be located in a number of different locations depending on the implementation. For example, this data stack may be located on a hard disc locally on the data processing system on which the Java virtual machine is located or on a remote storage device on a network connected to the data processing system. In this manner, a user is afforded the ability to restore data elements associated with an application, such as application 302 and application 304 associated with data elements 312 and 314 to any prior data state. In these examples, this change of versioning may occur through user input to user interface 318.
For example, memory management subsystem 310 may restore data element 312 to a prior state using the data stored within the data stack 316. An index, such as a time stamp or other numerical value may be used to identify the version of data within data stack 316 that is to be used to replace the data in data element 312. Other parameters and even functions may be used as an index within data stack 316. In this manner, the individual data elements may be restored to prior states using memory management subsystem 310.
Applications 302 and 304 do not need to provide any functionality or support for the data versioning and recovery management in these illustrative examples. As a result, a user may restore all of the data elements, such as data element 312 and data element 314, for Java virtual machine 300 to the prior state through the user interface 318.
In these examples, data for application 308 is stored in data element 320. This data may be independently stored with respect to the data in data elements 312 and 314. Each time application 308 stores or alters data in data element 320, memory management subsystem 322 stores a snapshot of all the memory managed by memory management subsystem 322 in data stack 324. Data element 320 may be restored to a prior state through user input to user interface 326. Memory management subsystem 322, manages all of the memory accessed by Java applications.
This restoring of data occurs for all of the memory managed by memory management subsystem 322. In this manner, different applications may be restored to different states through associating the applications with different Java virtual machines. Depending upon the particular implementation, the mechanism of the present invention also may be implemented with any host operating system instead of or in addition to virtual machines.
Turning now to
Although specific changes are shown in
The contents visible to the user and the spreadsheet are shown in column 408 and the contents that are visible only to the mechanism of the present invention are shown in columns 410, 412 and 414. Entry 400 shows the original content of the spreadsheet in column 408. As can be seen, the spreadsheet contains four cells. Index 1 in this entry is the information stored in a data stack, such as data stack 316 in
Next, in entry 402 a first revision is made to the cell in position (1, 1) as can be seen in column 408. The number 5 has changed to a number 3. This new data is provided with a second index as can be seen in column 408. The first index data is now managed by the data versioning system as can be seen in column 410 of entry 402.
Next, a second revision is made to the spreadsheet in cell (2, 2). As can be seen in column 408 for entry 404, the value 9 has changed to a 1. This revision is given a third index number. The first two index versions are managed by the data versioning system as can be seen in columns 410 and 412 of entry 404.
A third revision is made to cell (1, 1). In this case, the number 3 is now changed to a number 8. These contents are visible to the user and are assigned a fourth index. The first three index versions are now managed by the data versioning system and they are not seen by the user in columns 410, 412, and 414 of entry 406.
Turning now to
Table 500 is a specific example of data in memory that may be stored in snapshots in a data stack, such as data stack 316 in
From table 500, the current information from the table is populated with the contents corresponding to the cells. Entries 502, 504, 506, and 508 show the original contents of the spreadsheet illustrated in
In these examples, numerical indexes are used in table 500. These indexes could easily be replaced with timestamps to allow a user to identify a particular time for restoring data to a prior state. To return the contents of the spreadsheet to its original state, the user sends a request to the memory management subsystem with the appropriate index. In this case, the index number is 1. At that time, the memory management subsystem returns the spreadsheet to that original state from the current state. If the user wants the data after the first revision, the user would request a restoration corresponding to number 2.
Additionally, the memory may be updated when the user leaves the data element that has been changed with the added dimension being incremented and populated with the contents of the memory managed by the memory management subsystem at that time. This update to the table in
Turning now to
The process begins by detecting a request for a data element (step 600). This request may be received from an application, such as application 302 in
Next, a determination is made as to whether the data element has changed (step 606). If the data element has not changed, the process returns back to the step and continues to make this determination until a change occurs. If the data element has changed, the data stack is updated to include the new version of the data (step 608) with the process then returning to step 606. This update involves copying all of the content in the memory managed by the memory management subsystem. In step 608, the changed version of the data is associated with an index allowed for locating prior versions of the data in the data stack. In other words, an index is associated with the contents or snapshot of the memory.
In step 604, in creating the data stack, the current version or contents visible to a user are stored in the data stack in association with an index. This index may take various forms. First, index numbers may be used. Additionally, time stamps also may be used for the index.
Turning now to
The process begins by receiving a user input to restore a prior version of data (step 700). An index is identified from the request (step 702) and this index is used to identify the data (step 704). In these examples, the data is a copy of the content in the memory managed by the memory management subsystem. Other data for other programs may be located in this copy. The identified data is then restored (step 706) with the process terminating thereafter. Step 706 restores the data for all of the data that was present in the memory at the time the content was copied or stored in association with the index.
Thus, the present invention provides an improved method, apparatus, and computer instructions for data versioning and recovery management. The mechanism of the present invention adds an additional dimension for any n-dimensional storage element or array. As a result, the mechanism of the present invention may be applied to any type of data element regardless of the number of dimensions in this element. In storing and indexing the version data, a user input may be received independently of any applications to restore the data to a prior version or state.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
It is important to note that while the present invention has been described in the context of a fully functioning data processing system, those of ordinary skill in the art will appreciate that the processes of the present invention are capable of being distributed in the form of a computer readable medium of instructions and a variety of forms and that the present invention applies equally regardless of the particular type of signal bearing media actually used to carry out the distribution. Examples of computer readable media include recordable-type media, such as a floppy disk, a hard disk drive, a RAM, CD-ROMs, DVD-ROMs, and transmission-type media, such as digital and analog communications links, wired or wireless communications links using transmission forms, such as, for example, radio frequency and light wave transmissions. The computer readable media may take the form of coded formats that are decoded for actual use in a particular data processing system.
The description of the present invention has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the invention in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. For example, although the illustrative embodiments use a Java virtual machine, the mechanism of the present invention may be applied to any virtual machine or operating system to provide the data versioning and data recovery. The embodiment was chosen and described in order to best explain the principles of the invention, the practical application, and to enable others of ordinary skill in the art to understand the invention for various embodiments with various modifications as are suited to the particular use contemplated.
The present invention is related to the following patent applications: entitled “Method and Apparatus for Data Versioning and Recovery Using Delta Content Save and Restore Management”, Ser. No. ______, attorney docket no. AUS920040638US1; entitled “Platform Infrastructure to Provide an Operating System Based Application Programming Interface Undo Service”, Ser. No. ______, attorney docket no. AUS920040639US1; entitled “Virtual Memory Management Infrastructure for Monitoring Deltas and Supporting Undo Versioning in a Paged Memory System”, Ser. No. ______, attorney docket no. AUS920040640US1; entitled “Infrastructure for Device Driver to Monitor and Trigger Versioning for Resources”, Ser. No. ______, attorney docket no. AUS920040641US1; entitled “Method and Apparatus for Managing Versioning Data in a Network Data Processing System”, serial no. AUS920040642US1, attorney docket no. ______; entitled “Heap Manager and Application Programming Interface Support for Managing Versions of Objects”, Ser. No. ______, attorney docket no. AUS920040643US1; entitled “Method and Apparatus for Marking Code for Data Versioning”, Ser. No. ______, attorney docket no. AUS920040644US1; and entitled “Object Based Access Application Programming Interface for Data Versioning”, Ser. No. ______, attorney docket no. AUS920040645US1 filed even date hereof, assigned to the same assignee, and incorporated herein by reference.