Method for sorting and storing data employing dynamic sort tree reconfiguration in volatile memory
First Claim
Patent Images
1. A method of sorting and storing data in a computer system, the computer system including a Central Processor Unit (CPU), nonvolatile memory accessible by the CPU, and working memory associated with the CPU, the nonvolatile memory including a plurality of data records stored therein, comprising the steps of:
- reading said data records from said nonvolatile memory and storing them in said volatile working memory;
assigning a unique data record identifier to each data record in said volatile memory;
creating and initializing a sort tree in said volatile memory, said sort tree including a plurality of nodes allocated to locations in said volatile memory, said nodes including a plurality of exterior nodes, a plurality of interior nodes, and a root node;
initializing said sort tree in combination with entry of said data record identifiers into said sort tree so as to add nodes to the sort tree in accordance with a number of data records added, so that the sort tree is initialized to the extent that it is only large enough to hold the data records entered;
sorting said data record identifiers by comparing said data record identifiers throughout said sort tree to said root node; and
reading said data records from said volatile memory and storing them in said nonvolatile memory in the order of said sorted record identifiers.
0 Assignments
0 Petitions
Accused Products
Abstract
In a computer system, data records stored in nonvolatile memory are read into a volatile memory and operated on in a sorting operation. A tournament-type sort is applied, with the tree size dynamically reconfigured within the volatile memory as a function of the number of data records to be sorted. The memory space occupied is reduced by the reconfigured tree and sort speed is augmented.
44 Citations
7 Claims
-
1. A method of sorting and storing data in a computer system, the computer system including a Central Processor Unit (CPU), nonvolatile memory accessible by the CPU, and working memory associated with the CPU, the nonvolatile memory including a plurality of data records stored therein, comprising the steps of:
-
reading said data records from said nonvolatile memory and storing them in said volatile working memory;
assigning a unique data record identifier to each data record in said volatile memory;
creating and initializing a sort tree in said volatile memory, said sort tree including a plurality of nodes allocated to locations in said volatile memory, said nodes including a plurality of exterior nodes, a plurality of interior nodes, and a root node;
initializing said sort tree in combination with entry of said data record identifiers into said sort tree so as to add nodes to the sort tree in accordance with a number of data records added, so that the sort tree is initialized to the extent that it is only large enough to hold the data records entered;
sorting said data record identifiers by comparing said data record identifiers throughout said sort tree to said root node; and
reading said data records from said volatile memory and storing them in said nonvolatile memory in the order of said sorted record identifiers. - View Dependent Claims (2, 3, 4)
serially initializing exterior nodes and serially introducing said data record identifiers into said external nodes as the data record identifiers are entered, the first of said data record identifiers being introduced into the first created external node and subsequent data record identifiers being associated with consecutive created external nodes;
initializing internal nodes directly above said exterior nodes;
associating initialization values with said internal nodes; and
assigning a node to point to the root node which is redefined as exterior nodes are added.
-
-
4. A method as set out in claim 1, wherein said initialized sort tree height is determined by said initializing step.
-
5. A computer program product comprising:
- a computer usable medium having computer readable code embodied therein for causing sorting of data records, the computer program product comprising;
computer readable program code devices configured to cause a computer to effect reading said data records from a nonvolatile memory and store storing them in said volatile working memory;
computer readable program code devices configured to cause a computer to effect assigning a unique data record identifier to each data record in said volatile memory;
computer readable program code devices configured to cause a computer to effect creating a sort tree in said volatile memory, said sort tree including a plurality of nodes allocated to locations in said volatile memory, said nodes including a plurality of exterior nodes, a plurality of interior nodes, and a root node, said nodes being initialized in combination with entry of said data record identifiers into said sort tree so as to add nodes to the sort tree as data records are added;
computer readable program code devices configured to cause a computer to effect sorting said data record identifiers by comparing said data record identifiers through said sort tree to said root node; and
computer readable program code devices configured to cause a computer to effect reading said data records from said volatile memory and storing them in said nonvolatile memory in the order of said sorted record identifiers. - View Dependent Claims (6, 7)
- a computer usable medium having computer readable code embodied therein for causing sorting of data records, the computer program product comprising;
Specification