Abstract:
A dynamic data buffer method, includes providing a system for accessing a database having a plurality of fields of data potentially used by applications, analyzing an application&#39;s structure to identify at least one field of data from the plurality of fields of data in the database used by the application, performing a field-wise select for selecting only the identified at least one field of data and creating a dynamic data buffer for storing only the identified at least one field of data.

Description:
BACKGROUND 
       [0001]    1. Technical Field 
         [0002]    The present disclosure relates generally to data buffers and, more particularly, to a method and apparatus for dynamic data buffers. 
         [0003]    2. Description of the Related Art 
         [0004]    Business objects are database entries (objects) containing one or more fields that are used to represent an entity of business practice. The types of business objects an enterprise stores in their database may depend on the business endeavour of the enterprise. For example, a business engaged in the purchasing and selling of goods may store business objects such as purchase orders, invoices, sales orders, etc. The amount of data being stored these days is immense. For example, business objects may have complex structures often with huge numbers of attributes and very often, huge number of records. 
         [0005]    The time necessary to access a database is constantly decreasing. However, database access times are still often much longer than buffer memory access times. Accordingly, in order to minimize the number of database accesses required when an application such as a business application performs is a process requiring data from a database, an object can be retrieved from the database and stored locally in buffer memory. If the data is then needed again, it can be accessed from the buffer memory so that it is not necessary to again access the database for the data. 
         [0006]    Each object contains attributes which are used for some particular business process. In present systems, when an object is requested and loaded into memory for performing some type of calculation, for example, the entire data set is loaded into a buffer. That is, fields used for performing the business process are loaded into buffer in addition to those fields not used in the business process. This leads to the use of unnecessarily large buffer memory. 
         [0007]    Different approaches can be used to load objects. One approach is to store data in small application-specific tables as attribute sets. Although this approach may provide certain advantages, these are far outweighed by the disadvantages of the approach. For example, when the same attributes are used in different data sets, new data sets may need to be created or complex code changes may be required. 
         [0008]    A second approach is to store all data in one large table. One of the biggest disadvantages of this approach is that to be implemented properly, requires a large amount of buffer memory. 
         [0009]      FIG. 2  shows an example of the second approach. In the example shown in  FIG. 2 , in the database /APO/MATKEY, vertical columns represent fields in the database. Horizontal rows in the database represent a line of attributes. In this example, an application request is for “select MATID, MATNR, MEINS for MATID=“1”, “4”, “5”, “6”. In SCM Master Data Layer, for example, the system will select the data from the data base APO/MATKEY and store the data in the buffer BUFFER table-wise using an instruction such as: 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 Select * FROM /apo/matkey 
               
               
                   
                  INTO buffer 
               
               
                   
                  WHERE matid (‘1”, “4”, “5”, “6”) 
               
               
                   
                   
               
             
          
         
       
     
         [0010]    Advantages of this approach are that there is no need for an artificial table split. In addition, it is able to serve all possible requests for attributes. However, disadvantages of this approach include the large use of memory for the buffer, more roundtrips per database select for data transport and unnecessary data (for this application) being read and stored. 
       SUMMARY 
       [0011]    This application describes tools (in the form of methodologies, apparatuses, and systems) for dynamic data buffers. The tools may be embodied in one or more computer programs stored on a computer readable medium or program storage device and/or transmitted in the form of a computer data signal in one or more segments via a computer network or other transmission medium. 
         [0012]    A dynamic data buffer method, includes providing a system for accessing a database having a plurality of fields of data potentially used by applications, analyzing an application&#39;s structure to identify at least one field of data from the plurality of fields of data in the database used by the application, performing a field-wise select for selecting only the identified at least one field of data and creating a dynamic data buffer for storing only the identified at least one field of data. 
         [0013]    A dynamic data buffer system, includes a module for providing a system for accessing a database having, a plurality of fields of data potentially used by applications, a module for analyzing an application&#39;s structure to identify at least one field of data from the plurality of fields of data in the database used by the application, a module for performing a field-wise select for selecting only the identified at least one field of data and a module for creating a dynamic data buffer for storing only the identified at least one field of data. 
         [0014]    A computer recording medium including computer executable code for providing a dynamic data buffer, includes code for providing a system for accessing a database having a plurality of fields of data potentially used by applications, code for analyzing an application&#39;s structure to identify at least one field of data from the plurality of fields of data in the database used by the application, code for performing a field-wise select for selecting only the identified at least one field of data and code for creating a dynamic data buffer for storing only the identified at least one field of data. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0015]    A more complete appreciation of the present disclosure and many of the attendant advantages thereof will be readily obtained as the same becomes better understood by reference to the following detailed description when considered in connection with the accompanying, drawings, wherein: 
           [0016]      FIG. 1  shows a block diagram of an exemplary computer system capable of implementing, the method and system of the present disclosure; 
           [0017]      FIG. 2  shows an example of a database and a buffer memory according to the related art; 
           [0018]      FIG. 3  shows a flow chart for implementing aspects of the present disclosure according to embodiments of the present disclosure; 
           [0019]      FIG. 4  shows an example of a buffer memory according to an embodiment of the present disclosure; 
           [0020]      FIG. 5  shows a block diagram of a database for explaining aspects of the present disclosure; 
           [0021]      FIGS. 6A and 6B  show examples of data mapping/merging and indexes, respectively, for describing aspects of the present disclosure; 
           [0022]      FIGS. 7A and 7B  show examples for describing buffer reads and updates, respectively, for describing aspects of the present disclosure; 
           [0023]      FIG. 8  shows data kept in application-specific sets; and 
           [0024]      FIG. 9  shows an example of a field-wise database selection and buffering method according to aspects of the present disclosure. 
       
    
    
     DETAILED DESCRIPTION 
       [0025]    The following exemplary embodiments are set forth to aid in an understanding of the subject matter of this disclosure, but are not intended, and may not be construed, to limit in any way the claims which follow thereafter. Therefore, while specific terminology is employed for the sake of clarity in describing some exemplary embodiments, the present disclosure is not intended to be limited to the specific terminology so selected, and it is to be understood that each specific element includes all technical equivalents which operate in a 
         [0026]      FIG. 1  shows an example of a computer system  100  which may implement the method and system of the present disclosure. The system and method of the present disclosure may be implemented in the form of a software application running on a computer system, for example, a mainframe, personal computer (PC), handheld computer, server, etc. The software application may be stored on a recording media locally accessible by the computer system, for example, floppy disk, compact disk, hard disk, etc., or may be remote from the computer system and accessible via a hard wired or wireless connection to a network, for example, a local area network, or the Internet. 
         [0027]    The computer system  100  can include a central processing unit (CPU)  102 , program and data storage devices  104 , a printer interface  106 , a display unit  108 , a (LAN) local area network data transmission controller  110 , a LAN interface  112 , a network controller  114 , an internal bus  116 , and one or more input devices  118  (for example, a keyboard, mouse etc.). As shown, the system  100  may be connected to a database  120 , via a link  122 . 
         [0028]    The computer system  100  is merely exemplary. The specific embodiments described herein are illustrative, computer system(s) as referred to herein may include(s) individual computers, servers, computing resources, networks, etc., and many variations can be introduced on these embodiments without departing from the spirit of the disclosure or from the scope of the appended claims. 
         [0029]    According to an embodiment of the present disclosure, runtime memory allocation is used for buffering by analyzing the application data structures in order to dynamically build application specific selects for data being buffered. For example, the present system first analyzes the application&#39;s structure fields and then selects and retrieves only the fields used by the application. Those fields are then stored in local buffer. According to this embodiment of the present disclosure, the number of database round-trips can be reduced thus increasing, performance. In addition, a generic buffer can be used for every object and to store complex (e.g., deep) structures. 
         [0030]    Each application has its own view of the data. That is, most applications only need a relatively small subset of fields from the database. According to an embodiment of the present disclosure, a system of field wise selections and buffering are performed to achieve an efficient and robust dynamic data buffer. Embodiments of the present disclosure will now be described by reference to  FIGS. 3-5 . 
         [0031]      FIG. 5  shows an example of an application&#39;s “view” of the database APO/MATKEY. In this example, only the fields circled are used by the application. That is, the application uses only a subset of all available fields. Referring to  FIG. 3 , the system first analyzes the application structure (e.g., the structure fields) to determine which fields are used by the application (Step S 2 ). This can be performed, for example, by parsing the application structure to determine exactly which fields of data are being retrieved. In this example, the fields include MATID, MATNR, MEINS. The system then determines the source table(s) (in this example /APO/MATKEY) for these fields (Step S 4 ). The system then performs a field-ise select (Step S 6 ) as follows to retrieve only those fields used by the application: 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 SELECT madid matnr meins 
               
               
                   
                  FROM /sapapo/matkey 
               
               
                   
                  INTO buffer 
               
               
                   
                  WHERE 
               
               
                   
                   matid IN (‘1’, ‘4’, ‘5’, ‘6’). 
               
               
                   
                   
               
             
          
         
       
     
         [0032]    The system then performs a dynamic data buffer allocation (Step S 8 ) to allocate buffer memory for the selected fields as follows: 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 BEGIN OF buffer-str, 
               
               
                   
                  Strtype TYPE REF TO typedescr, 
               
               
                   
                  Strdata TYPE REF TO data, 
               
               
                   
                 END OF buffer-str. 
               
               
                   
                   
               
             
          
         
       
     
         [0033]    According to the above embodiments of the present disclosure as shown in  FIG. 4 , by performing dynamic buffer allocation, only the data fields actually being used by the application can be retrieved and stored, saving both time and resources. 
         [0034]    According to an embodiment of the present disclosure, the system allows data mapping/merging using a dynamic type creation as shown in  FIG. 6A . Using Primary and additional indexes as appropriate (See  FIG. 6B ) the information in the buffer memory can be readily accessed. 
         [0035]    Data call be read from the dynamic buffer memory in several ways. For example, for smaller buffer structures, the system can use a MOVE-CORRESPONDING type instruction to read from the buffer. For the same buffer structure type, the system can use a MOVE type instruction to read from the buffer resulting in a faster read. An example of a same structure type read is shown in  FIG. 7A . To update the buffer, the system copies the data into the existing buffer structure for both smaller and same structures. Referring to  FIG. 7B , when the attribute sets are different, the system generates new structure with an attributes superset as follows: 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 strtype = Type C U Type B. 
               
               
                   
                 CREATE DATA strdata TYPE HANDLE strtype. 
               
               
                   
                 MOVE-CORRESPIONDING: 
               
               
                   
                  strC TO strdata, 
               
               
                   
                  strB TO strdata. 
               
               
                   
                   
               
             
          
         
       
     
         [0036]    As shown in  FIG. 8 , data can be kept in attribute sets. For example, for an application request: 
         [0000]                                select MATID, MATNR, MAINS for MATID = “1”, “4”, “5”, “6”                    
the data retrieved can be kept in application specific sets using, for example, select statements as follows:
 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 SELECT * FROM SetA 
               
               
                   
                  INTO buffer-SetA 
               
               
                   
                  WHERE matid IN (“1”, “4”, “5”, “6”) 
               
               
                   
                 SELECT * FROM SetC 
               
               
                   
                  INTO buffer-SetC 
               
               
                   
                  WHERE matid IN (“1”, “4”, “5”, “6”) 
               
               
                   
                   
               
             
          
         
       
     
         [0037]    As shown in  FIG. 8 , the attributes for application  1  are kept in Set A, the attributes for application  2  are kept in Set B and the common attributes for applications  1  and  2  are kept in Set C. Although an attribute set approach uses less memory for buffering, the approach has drawbacks. For example, if the same attributes are needed in two sets, a new set needs to be created. This approach also requires selects to more than one database table. 
         [0038]    According to an embodiment of the present disclosure, field-wise database selection and buffering is performed to provide an efficient approach to data buffering. For example, for an application request: 
         [0000]                                select MATID, MATNR, MAINS for MATID = “1”, “4”, “5”, “6”                    
field-wise database selection and buffering can be performed as follows and as shown in  FIG. 9 :
 
         [0000]    
       
         
               
               
             
           
               
                   
                   
               
             
             
               
                   
                 SELECT matid matnr mains 
               
               
                   
                  FROM /apo/matkey 
               
               
                   
                  INTO buffer 
               
               
                   
                  WHERE matid IN (“1”, “4”, “5”, “6”). 
               
               
                   
                   
               
             
          
         
       
     
         [0039]    As shown in  FIG. 9 , using this approach, the buffer is thus filled with only attributes used by the application. It is thus possible to use one table instead of fewer smaller tables utilizing this approach. This approach also uses less round trips to obtain the data from the database and uses less memory for the buffered data. 
         [0040]    Various embodiments of the present disclosure may make use of Open SQL statements. Of course, aspects of the present disclosure can be implemented utilizing various other types of database access systems. 
         [0041]    The present system can be implemented in digital electronic circuitry, or in computer hardware, firmware, software, or in combinations of them. The system can be implemented as a computer program product, i.e., a computer program tangibly embodied in an information cannier, e.g., in a machine-readable storage device or in a propagated signal, for execution by, or to control the operation of, data processing apparatus, e.g., a programmable processor, a computer, or multiple computers. A computer program can be written in any form of programming language, including compiled or interpreted languages, and it can be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment. A computer program can be deployed to be executed on one computer or on multiple computers at one site or distributed (across multiple sites and interconnected by a communication network. 
         [0042]    Method steps associated with the present system can be performed by one or more programmable processors executing a computer program to perform functions of the invention by operating on input data and generating output. Method steps can also be performed by, and apparatus of the disclosure can be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit). 
         [0043]    Processors suitable for the execution of a computer program include, by way of example, both general and special purpose microprocessors, and any one or more processors of any kind of digital computer. Generally, a processor will receive instructions and data from a read-only memory or a random access memory or both. The elements of a computer are a processor for executing instructions and one or more memory devices for storing instructions and data. Generally, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks. Information carriers suitable for embodying computer program instructions and data include all forms of non-volatile memory, including by way of example, semiconductor memory devices, e.g., EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electrically Erasable Programmable Read-Only Memory), and flash memory devices; magnetic disks, e.g., internal hard disks or removable disks; magneto-optical disks; CD-ROMs (Compact Disc Read-only Memory) and DVD-ROMs (Digital Versatile Disc Read-only Memory). The processor and the memory can be supplemented by, or incorporated in special purpose logic circuitry. 
         [0044]    To provide for interaction with a user, the present disclosure can be implemented on a computer having a display device, e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor, for displaying information to the user and a keyboard and a pointing device, e.g., a mouse or a trackball, by which the user can provide input to the computer. Other kinds of devices call be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback, e.g., visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including acoustic, speech, or tactile input. 
         [0045]    The present system can be implemented in a computing system that includes a back-end component, e.g., as a data server, or that includes a middle-ware component, e.g., an application server, or that includes a front-end component, e.g., a client computer having a graphical interface or a Web browser through which a user can interact with an implementation of the present disclosure, or any combination of such back-end, middleware, or front-end components. The components of the computing system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (“LAN”) and a wide area network (“WAN”), e.g., the Internet. 
         [0046]    The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. 
         [0047]    The relationship of client and server arises by virtue of computer programs running on respective computers and having a client-server relationship to each other. 
         [0048]    The present system has been described in terms of particular embodiments. Other embodiments are within the scope of the following claims. For example, although the present system has been described as a component in a larger system, it can also be implemented in other systems or as a stand-alone system. 
         [0049]    Numerous additional modifications and variations of the present disclosure are possible in view of the above-teachings. It is therefore to be understood that within the scope of the appended claims, the present disclosure may be practiced other than as specifically described herein. For example, elements and/or features of different illustrative embodiments may be combined with each other and/or substituted for each other within the scope of this disclosure and appended claims.