Data base access process using a user-friendly menu

Abstract: Data base administrator (10) creates program communi­ cation blocks (11), and programmer (12) writes programs (13) using the program communication blocks (PCBs11) to store data in bulk storage device (14). A user (15) not having data processing skills or experience is enabled to access data in bulk storage device (14) via the PCBs (11). The system first reads the data base descriptions (DBDs) and PCB source statements and constructs a data directory, consolidating access paths into entry data bases which are displayed to the user (15) as a menu. The system then evaluates all possible access paths that will satisfy a user query, weights them according to their efficiency, and selects the best.

Description: This invention relates to a data base management system, and more particularly to a data base access process which allows a user without data processing skills or experience to easily access data in the data base with the aid of a user-friendly menu. For information on database systems, the book by C.J. DATE entitled "An introduction to database systems", Vol 1, third edition, published by Addison-Wesley Publishing C°, 1981, can be consulted. As background for the subject invention, it can be referred to Part 3 of this book comprising chapters 15 to 22 which describe the hierarchical approach to database management, which is used as environment of the invention. For the sake of example data Language I (DL/I) is a data processing language developed by the International Business Machines Corp. for data processing applications. DL/I uses program communication blocks (PCBs) as a means of controlling both storing and accessing data in bulk storage. A data base administrator creates the PCBs the number and character of which vary depending on end user requirements. PCBs may be added or updated on a periodic basis by the data base administrator. A programmer writes a program or programs which use the PCBs to store or access data in a bulk storage device such as a disk pack. Assume that the business for which the system is designed is a manufacturer of parts for appliances. A number of people within the business may have need to access the data base. The plant manager will need to know inventory levels and orders to determine what and how many parts to make. The plant foreman will need to know what the level of activity is at each manufacturing location to determine when machines can be shut down for maintenance and when a machine operator can have time off. A query posed by the user of the data base management system usually requires more than one of the PCBs in order to access the information. It is therefore the responsibility of the programmer to write programs which anticipate the queries that may be posed by any of a variety of users of the data base management system. Obviously, the programmer can not anticipate all possible queries, and when a user wants access to information in a manner not provided for by the existing programs, it is necessary to have the programmer write a new program that will accommodate the user's query. This can be both expensive and time consuming and in the case of time sensitive information, may provide no solution at all. It is therefore an object of the present invention to provide an improved data base access process which allows a user to easily access data even though a specific program has not been written using the PCBs required for the data access. The subject invention as set out in claim 1 accomplishes this by first automatically displaying a data directory of entry data bases and then in response to a specific query, automatically selecting the best access path to an item. More specifically, the invention relates to a process that first constructs automatically from definitions of database descriptions and program communication blocks (PCB) a set of entry data bases relating to the different access paths which can be used to access desired information in response to a user query, each of the entry data bases which is based upon physical relationships or logically defined relationships of the data consisting of a single hierarchical structure that shows every physical and logical path accessible from one physical root segment with duplicate logical and physical paths consolidated. The entry data bases are displayed to the query user as a menu from which segment fields and PCB's which have been used to construct the entry data bases can be selected by the user. Then, all possible access paths are automatically evaluated to the segments to be retrieved in the query, and the optimum access path is automatically selected according to weighted priorities resulting from the key values affected to the segments of each path. It must be noted that, when a selection criterion in a query refers to a field that has a DL/I secondary index, the DL/I hierarchical structure and PCB to be used are different from the usual case. Similarly, when a query refers to the key of a logical parent, a different structure and PCB must be used. The invention hides these problems from the query user, who may not understand them, by evaluating all possible access paths to the DL/I segments to be retrieved in a query. The invention will now be described in reference to the drawings wherein : Figure 1 is a pictorial illustration of the functional application of DL/I and the improvement according to the present invention. Figures 2A, 2B and 2C are simplified illustrations of three PCBs that might be generated for a parts manufacturing business. Figure 3 is a flow diagram for producing the entry data base according to the invention. Figure 4 is a flow diagram for making the PCB selection in the data base query according to the invention. Figure 1 illustrates a functional application of Data language I(DL/I) wherein PCB's 11 are created by a data base administrator 10 and a programmer 12 writes a program 13 using the PCB's to store or access data in a bulk storage device 14 such as a disc pack. Figures 2A, 2B and 2C illustrate in simplified form three of many PCBs that might be generated by the data base administrator for this business. In Figure 2A, the hierarchy of the PCB begins with the part identification which may typically be an alphanumeric character. From the part identification, it is possible to access information on the inventory or stock on hand, engineering change notices that may have been generated for that stock number, and the location or locations where the parts are manufactured. Taking it one step further, in addition to inventory, it is also possible with this PCB to access information on the location of the inventory, and in addition to the engineering change notices, it is also possible to determine the engineers who wrote the change notices. Some of this information may be protected and not accessible by all users, and while restricted access is a feature of DL/I, it is not germane to the subject invention and therefore will not be discussed further. Still with reference to Figure 2A, it will be appreciated that the PCB is an indexing scheme. Each level of that scheme is referred to as a segment. Figure 2B shows another PCB, this one beginning with place of manufacture and leading to the part identification. In other words, with this PCB it is possible to determine what parts are being manufactured at each location. For a small business, the place of manufacture may be a machine tool station within the plant and for a large business, it may be a different geographical location altogether. The PCB shown in figure 2B can be considered to be an inverted subset of the PCB of figure 2A. The third example of a PCB is shown in figure 2C which begins with inventory location from which it is possible to access information about both the stock on hand and the corresponding part identification. In addition, it is possible to access delivery information such as scheduling, destination and carrier. Other PCBs might typically include personnel records allowing access to shift assignments, vacation schedules and the like. The subject invention now allows a user 15 (Figure 1) not having data processing skills or experience to access data in bulk storage 14 via PCBs 11. This is accomplished automatically with in two operations. The system allows both logical and physical connection of the PCBs in order to access information in response to the user query. The physical connection of the segments is implicit in the PCBs illustrated in figures 2A and 2B. Figure 2C illustrates a logical connection. In this PCB, the place of manufacture is not physically connected to the stock/part identification segment ; rather, it is logically connected to that segment. This logical connection makes possible a connection to other PCBs such as for example the PCB shown in figure2A. In this way, a number of paths may be constructed to access the desired information in response to a user query. In the first operation, the system reads the DL/I physical data base description (DBD), the logical DBD and the PCB source statements, all of which are also used by DL/I. Using this information, the system constructs a data directory and consolidates the several possible access paths into entry data bases. The next operation is performed on-line. The system evaluates all possible access paths that will satisfy a query, weights them according to their efficiency, and selects the best. The first operation performed by the system is illustrated by the flow diagram of figure 3. In the first step represented by block 20, all physical DBDs are read and then in block 21, one entry data base is set up per each physical DBD. An entry data base is described by a member (a named major item) in the data directory. Each segment and field is described by a line in a member. The next step in block 22 is to read all secondary index DBDs, locating the indexed fields, in the entry data base members and in block 23, saving the index target segment against the definition of the indexed field. In block 24, all logical DBDs are read and the physical source entry data base for each one is located. By this is meant that the physical data base whose root is the source of the root of the logical data base is located. The system now must make a decision as represented by decision block 25. For each segment in the logical DBD, its source may or may not be in the entry data base. If it is, an extra line is added following the physical segment line as indicated in block 26. Otherwise, a new segment is entered at the correct hierarchical position as indicated in block 27. Two segments with a common source are treated together, with two successive lines. Concatenated segments are treated as distinct from their two parts. For every logical segment so added, the source segment in another entry data base is found, and the fields are copied from there as indicated by block 28. Next in block 29, all program specification blocks (PSBs ; a PSB contains several PCBs) and the PCBs that they contain are read to find the entry data base and segments to which each one refers. Then in block 30, the PCB identification is recorded against each segment. The PCB identification is the PSB name plus the PCB number. If several PCBs reference one segment, either physical or logical, new segment lines are created, one per segment and PCB. If a PCB uses a secondary processing sequence (secondary index), that fact is recorded in a segment PCB line and the PCB identification is recorded against the indexed field as indicated by block 31. At this point, all entry data bases are scanned and those segments referenced by no PCBs and those entry data bases containing no referenced segments are eliminated as indicated by block 32. Finally, a set of field cross-reference members is produced, one member for every field in the data directory as indicated by block 33. Each member produced shows every entry data base, segment and PCB identification by which the field can be found. The second operation performed by the system is shown in figure 4, but before proceeding with a discussion of that figure, certain definitions must be made. The invention provides menus to enable a user to select entry data bases, segments an fields. When the user identifies a segment, he identifies the first of a set of equivalent segments placed together in the entry data base operation described above. Each of these equivalent segments is identified internally by segment name and PCB identification. In fact, this combination defines a path of segments from the root to the named segment. If two segment name/PCB identification combinations are equivalent in this way, the defined paths are said to be congruent. A sub-path of a path has the same PCB identification and the same segment names, from the root down, as the path but is shorter. Two paths are said to overlap if there exists a sub-path common to both of them. If the paths share a common physical source throughout, but their corresponding segments are in the opposite order, they are said to be opposite. For the purposes of this definition, (a) all fields used in one path must be present in the other, (b) paired segments are considered to be the same unless their logical parent is the same as their physical parent, and (c) one or both of the paths can be in a secondary data structure associated with a secondary index. This relationship between paths is paramount. Any logical path or secondary index path, to be useful for accessing efficiency, must have its root key field identified by the user in a selection criterion. If, therefore, the user has identified its root key, the identified path will contain a segment sourced on that root, segment ; otherwise, it will not. Turning now to figure 4, in block 40, for each segment identified by the user, the defined path is considered and each sub-path so defined is consolidated into the longest path. Then in block 41, for each field identified by the user, all possible access paths are found using the field cross-reference members. These are the candidate paths. Then in decision block 42, if a candidate path is not opposite but is a sub-path of an opposite path, it is extended to be opposite as indicated in block 43 ; otherwise, it is not. All candidate paths except for those that are either congruent or opposite to a path identified by the user are eliminated as indicated by block 44. At this point in the operation, for each identified path, all candidates are considered congruent or opposite. In block 45, weights are assigned to each candidate depending on whether it uses a primary physical key, primary logical key or secondary index with an equality or range relationship. Next, in priority is congruence over oppositeness. Finally, weight is given to the identified path above the other candidates. Each of the above factors is give half as much weight as its predecessor. To select a PSB, the weights accorded to the candidate paths contained in each PSB are summed in block 46 and in block 47, the highest PSB is chosen. All candidates not in this PSB are eliminated. In block 47, a consistency check is performed to ensure that any paths identified as overlapping still overlap with the chosen PSB ; if not, that PSB is rejected and the next best is taken. The user is notified if no satisfactory PSB is available and processing terminates at decision block 48. For each identified path, the single best congruent path and the single best opposite (if any) path are determined as indicated in block 49. The congruent and identified path can be same. If the query, as defined by the user, requires counting, totaling or other accumulating that depends on the hierarchical order of segments in an identified path, and if that path overlaps no other in the query, then a high priority opposite path will be retrieved instead of the identified path. This is known as "path inversion" and is indicated by the sequence of blocks 50, 51 and 52 in figure 4. If one or both of those conditions is false and a high priority opposite path is available, it will be retrieved in order to obtain root keys of the identified path or of the congruent path. These are used to retrieve only those occurrences that can possibly satisfy the selection criteria. This option, less efficient than path inversion, is termed root key recovery and is indicated by block 53. Even though less efficient, it is still far better than a complete search of the data base. In summary, the invention is a process improving a data base management system, that reads both physical and logical DBDs and all PCBs to develop a data directory. This data directory describes entry data bases which are displayed as menus on-line to a user. In response to the selection criteria of the user, access paths are determined from the data directory.

Claims: A data base access process for simplifying the task of accessing desired information in response to a user query and using Data Language/I (DL/I) in a hierarchical data base management system, of the type requiring user specified selection criteria in association with corresponding program communication blocks (PCB) (11) created by a data base administrator for any hierarchical data structure to be used, said process being characterized by the steps of: constructing automatically a data directory from descriptions of an original database (14) and PCB statements, major items or entries of said data directory consisting in entry data bases, said entry data bases being set up by the steps of : reading (20) the physical and logical data base descriptions (DBD) and the PCB data, setting up (21) one entry data base per physical DBD, locating (24) the entry data base comprising the root segment for each logical DBD, and finding (25-31) the entry data base and segments to which each PCB statement refers, thereby producing a set of cross-reference entry data bases constituting said data directory and each consisting of a single hierarchical structure that shows every physical and logical path accessible from one physical root segment with duplicate logical and physical paths being consolidated, displaying said entry data bases to the query user (15) as a menu from which segments fields, and PCBs which have been used to construct said entry data bases can be selected by the user, in response to a user query, listing (41, 42, 44) automatically possible access paths to the segments to be retrieved, and selecting (45-49) automatically the optimum access path according to weighted priorities resulting from key values assigned to the segments of each path. The process according to claim 1 wherein said step of constructing a data directory formed of entry data bases further comprises the step of eliminating (32) those segments referenced by no PCBs and those entry data bases containing no referenced segments. The process according to recited claim 1 or 2 wherein the step of listing comprises the steps of : identifying (41, 42) candidate paths as possible paths to access said desired information for each segment selected by the user, and eliminating (44) all candidate paths but those paths comprising segments from the root segment to a named segment which are called congruent, and those paths sharing a common root segment but having segments in the opposite order which are called opposite. The process according to claim 1, 2 or 3 wherein the step of selecting comprises the steps of : assigning (45) a weight to each possible access path depending on whether it uses a primary physical key, a primary logical key, a secondary index, and is congruent, and summing (46) the weights accorded to the possible access paths with the program specification block comprising one or more PCBs having the highest weighted sum being chosen. The process according to claim 4 wherein the weights assigned decrease by powers of two for each factor in succession. The process according to claim 4 or 5 wherein the step of selecting further comprises the steps of : performing a consistency check to ensure that any paths identified as overlapping still overlap with a chosen PSB, rejecting (47, 48) the chosen PSB and taking the next if an overlap is not found and then for each candidate path determining (49) the best congruent path and the single best opposite (if any) path, if the query, as defined by the user, requires counting, totaling or other accumulating that depends on the hierarchical order of segments in an identified path, and if that path overlaps no other in the query, retrieving (51, 52) a high priority opposite path when available instead of the identified path, but if one or both of these conditions is false and a high priority opposite path is available, retrieving (53) said high priority opposite path to obtain root keys of the identified path so that those occurrences that can possibly satisfy the selection criteria can be retrieved.

Inventors: KNAPMAN JOHN M, KNAPMAN, JOHN M.
Applicants: IBM, INTERNATIONAL BUSINESS MACHINES CORPORATION
Application year: 1983
Main classification: G06F17
IPC codes: G06F7, G06F17, G06F12