This invention relates to a method for retrieving hierarchical data.
Hierarchical data is often presented to a user in the form of a tree. Often such trees form part of web pages in which their structure is defined using dynamic hypertext mark up language (DHTML). However, we have found that it can take a significant amount of time to retrieve the data required to construct the tree. Furthermore, this data must be stored locally on the computer which is displaying the web page, and thus the memory requirements of the browser software are large for large trees.
In accordance with one aspect of the present invention, there is provided an hierarchical data retrieval method for retrieving an hierarchy of data from a first store, the hierarchy of data comprising one or more items of data of a first level, at least one of which is associated with one or more items of data of a second level, the method comprising:
The invention thus overcomes the problems associated with the prior art by only downloading the items of data as they are required to be displayed to a user. This results in the first level data of the tree being displayed more quickly, and usually reduces the memory requirements of the browser software as it is not necessary to load all the hierarchical data unless the user specifically requests to see all the data.
Normally, the items of data retrieved in steps (i) and (iii) are stored in a second store, and typically this second store is a solid state memory device.
In a preferred embodiment, the method further comprises discarding from the second store the items of data from the second level associated with one of the items of data from the first level in response to a user request indicating that item of data of the first level. However, it is not essential to discard the items of data from the second level. Instead, they may simply be hidden from the user, but retained in the second store, in response to the user request indicating the associated item of data of the first level.
Typically, the first store is situated on a remote server, and the first store may be a database.
Normally, the data retrieved in steps (i) and (iii) are retrieved via a network, such as the Internet.
In one embodiment, the method further comprises comparing, in response to a user command, any items of data retrieved in steps (i) and (iii) with corresponding items in the first store to determine if the items in the first store have been updated since the items of data of steps (i) and (iii) were retrieved, and if there are any differences, retrieving the corresponding items from the first store and replacing the items of data of steps (i) and (iii) with these.
In accordance with a second aspect of the present invention, a computer program comprises computer program code means adapted to perform the steps of the first aspect of the invention when said program is run on a computer.
In accordance with a third aspect of the present invention, a computer program product comprises computer program code means adapted to perform the steps of any of claims 1-9 when said program is run on a computer.
An embodiment of the invention will now be described with reference to the accompanying drawings, in which:—
a-2d show examples of hierarchical data;
The database 2 stores a set of hierarchical data that are shown in
The operation of the invention will now be described with reference to
The process then proceeds in step 12 to await user input. In this example, the user may be interested in seeing the second level data associated with the continent of Europe and he may provide the necessary user input for stage 12 by selecting the continent of Europe from the displayed first level data, thereby indicating that he wishes to expand the tree to show the countries of Europe.
The user input is detected by a decision stage 13 and this determines that the lower level data associated with the data item (i.e. Europe) selected by the user has not yet been downloaded. As a result, processing proceeds to stage 14. In stage 14, the data representing the countries of Europe, as shown in
Processing then proceeds from stage 15 to stage 12 where further user input is awaited. At this stage, the user may indicate that he wishes to retrieve further second level data relating to the continent of North America which is displayed in the first level of hierarchical data shown in
The user may then decide that he wishes to retrieve third level hierarchical data associated with the country of Canada. In response to this user input, decision stage 13 determines, in the same way as before, that it is desired to expand the tree, and processing proceeds to stage 14 where the third level data associated with the second level data item of Canada is retrieved from the database 2 connected to server 1 via the Internet 4, and stored in the memory in client 3. The retrieved third level data, shown in
It should be apparent that the hierarchical data may contain an extremely large number of levels, each level being associated with a data item of a higher level.
Having displayed all this data to the user, it may be that the user requires to contract the levels and he may indicate this by selecting one of the already expanded items, for example the province of British Columbia in
In this case, decision stage 13 determines that the lower level data associated with the selected data item (i.e. British Columbia) have already been downloaded. As a result, decision stage 13 passes control to stage 16 which hides the fourth level data of
In fact, stage 17 is optional since it is not essential to discard the hidden data. Instead, they may be retained in the memory in client 3 in case they are required again by the user. In this case, they are simply hidden in stage 16 from which processing proceeds to stage 12, as before.
It will be apparent from the foregoing discussion that initially only the first level data is downloaded and displayed on the client 3 and that subsequent levels of the hierarchical data are only downloaded on request, and then may be discarded when no longer required. As such, the download of hierarchical data may be made very much quicker, and the memory requirements are significantly lower.
The embodiment of
In this embodiment, processing in stages 10 to 12 is identical to that of the embodiment of
As an alternative, if the user issues a refresh command, instead of proceeding to the comparison stage 14a, the client 3 may simply issue a request to the server 1 to replace all the data that has previously been downloaded with new versions.
If the user has not issued a refresh command then processing proceeds from decision stage 13a to decision stage 13. If the user has issued a request for further data (i.e. to expand the tree) then processing proceeds from stage 13 to stage 14a. As previously described, stage 14a compares the previously downloaded hierarchical data with those stored on database 2. If there are any differences between these then replacement data are downloaded in stage 14 along with any new data indicated by the user. The replacement and indicated data are displayed in stage 15 before processing reverts to stage 12.
The processing stages 16 and 17 are executed if the user indicates that he wishes to contract the tree, and are identical with those already described with reference to
It is important to note that while the present invention has been described in a 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 a particular type of signal bearing media actually used to carry out distribution. Examples of computer readable media include recordable-type media such as floppy disks, a hard disk drive, RAM and CD-ROMs as well as transmission-type media such as digital and analogue communications links.
Number | Date | Country | Kind |
---|---|---|---|
0412883.1 | Jun 2004 | GB | national |