Summary of the invention
In view of above content, be necessary to provide a kind of storage process adaptive system, comprise database server, this database server comprises: storing process and data dictionary, store the information of all storing processs in this data dictionary, this database server also comprises a storing process rule list, store the defined storing process access rule of user in this storing process rule list, described database server also comprises: select module, be used for selecting the information of the needed storing process of described data dictionary user; Preserve module, be used for the information of the needed storing process of selected user is stored in data link table; Described selection module also is used for the corresponding storing process access rule of storing process in a current required execution of described storing process rule list selection; Acquisition module is for the information of obtaining the storing process of current required execution according to selected storing process access rule in described data link table; And execution module, be used for carrying out described storing process and return the result who carries out storing process.
In addition, also be necessary to provide a kind of storage process adaptive method, this method comprises the steps: to set up the storing process rule list in database server, stores the defined storing process access rule of user in this storing process rule list; Select the information of the needed storing process of user in the data dictionary in described database server; The information of the needed storing process of selected user is stored in the data link table in the described database server; In described storing process rule list, select the corresponding storing process access rule of storing process of a current required execution; In described data link table, obtain the information of the storing process of current required execution according to selected storing process access rule; And carry out described storing process and return the result who carries out storing process.
Compared to prior art, described storage process adaptive system and method, can the database of revising be adapted to automatically, when changing storing process, need not to change the code that calls storing process, reduce the modification of code to greatest extent, reduced the risk of system development project, improved work efficiency.
Embodiment
As shown in Figure 1, be the hardware structure figure of storage process adaptive system preferred embodiment of the present invention.The database server 3 that this system comprises client computer 1, communicates by letter by network 2 with this client computer 1.Wherein, network 2 can comprise any network well known in the art, comprising: transmission control protocol/procotol (TCP/IP) network (for example: internal network, the Internet), LAN (Local Area Network), wide area network, fiber channel, token ring etc.Described database server 3 comprises: database 300, storing process 400 and data link table 500.
Described database 300 comprises data dictionary 301.Data dictionary 301 is that main existence form exists with tables of data and view, is the set about the information of data.This data dictionary 301 is deposited all relevant informations of database, for example: how many spaces database 300 distributes, current how many spaces of having used, user's name, the relevant informations of the authority that user and role are awarded and storing process 400 etc., the relevant information of described storing process 400 comprises: the title of the input parameter of storing process 400, output parameter, storing process 400 etc.
Described storing process 400 is one section program of being write by the programming personnel, and this program is used for the data interaction of database 300 and client computer 1, and each data manipulation of database 300 is had corresponding storing process 400.For example: if client computer 1 needs the storage data to database 300, then carry out the storing process 400 of storage data; If client computer 1 need call the data in the database 300, then carry out the storing process 400 that calls data.Described storing process 400 also comprises a parameter list (not shown), stores input parameter and the output parameter of storing process 400 in this parameter list.Described data link table 500 is used for all information of the storing process 400 of the required usefulness of user that storage obtains from data dictionary 301, and all information of described storing process 400 are that name storage with storing process 400 is in this data link table 500.
As shown in Figure 2, be the functional block diagram of database server 3 among Fig. 1.Described database server 3 comprises: acquisition module 10, selection module 12, preservation module 14 and execution module 16.Storage process adaptive system of the present invention is before starting, need in database server 3, to set up the storing process rule list by the programming personnel, as shown in Figure 4, the content of this storing process rule list comprises: the return label value of the title of the job category of storing process 400, storing process 400, the index value sequence number of storing process 400 and storing process 400.The job category of described storing process 400 is recited as ID number of job category, defined voluntarily by the programming personnel for the ID of this job category number, for example in the present embodiment described ID number is defined as: ID number is that 1 expression job category is material loading, and ID number is that 2 expression job categories are the storage employee number.The title of described storing process 400 is used for according to the information of this name acquiring data link table 500 to storing process 400 that should title.The index value sequence number of described storing process 400 is represented the sequence number of output valve in the parameter list of storing process 400 of storing process 400.The return label value of described storing process 400 has two kinds of situations: " 1 " or " 0 ", if the return label value is " 1 ", represent that described storing process 400 has output valve, if do not need output, then the return label value is " 0 ".For example: as shown in Figure 4, ID number of the job category of storage employee number is 2, and the index value sequence number is 3, and the return label value is 1, and the storing process 400 of expression storage employee number correspondence has output valve, and this output valve is the 3rd parameter in the described parameter list.
Acquisition module 10 is used for obtaining the data dictionary 301 of database 300.
Select module 12 to be used for selecting the information of needed all storing processs 400 of described data dictionary 301 users.
Preserving module 14 is used for the information of needed all storing processs 400 of selected user is stored in data link table 500 with the name nominating of storing process 400.
Described selection module 12 also is used for selecting current storing process 400 corresponding storing process access rules that need execution at described storing process rule list, for example: if the current storage employee number that needs, as shown in Figure 4, described selection module 12 is used for selecting the corresponding storing process access rule of storage employee number at the storing process rule list: the ID of job category number is 2, the index value sequence number is 3, and the return label value is 1.
Described acquisition module 10 also is used for searching these storing process 400 titles according to the title of this storing process 400 in the rule of described rule list in described data link table 500, thereby obtain the information of storing process 400 in data link table 500 of current required execution, obtain the information of storing process 400 in data link table 500 of storage employee number correspondence in the present embodiment.
Execution module 16 is used for carrying out the current storing process 400 that needs execution, and this execution module 16 also is used for returning the output result who carries out described storing process 400.If described storing process 400 complete back no-output values are then returned the output result and are " ok ", if described storing process 400 has output valve after complete, then returning the output result is this output valve.
As shown in Figure 3, be the operation process chart of storage process adaptive method of the present invention preferred embodiment.
Step S30 sets up the storing process rule list, and as shown in Figure 4, the content of this storing process rule list comprises: the return label value of the title of the job category of storing process 400, storing process 400, the index value sequence number of storing process 400 and storing process 400.The job category of described storing process 400 is recited as ID number of job category, defined voluntarily by the programming personnel for the ID of this job category number, for example in the present embodiment described ID number is defined as: ID number is that 1 expression job category is material loading, and ID number is that 2 expression job categories are the storage employee number.The title of described storing process 400 is used for the information of storing process 400 that should title according to this title or 500 pairs of the chained lists of fetching data.The index value sequence number of described storing process 400 is represented the sequence number of output valve in the parameter list of storing process 400 of storing process 400.The return label value of described storing process 400 has two kinds of situations: " 1 " or " 0 ", if the return label value is " 1 ", represent that described storing process 400 has output valve, if do not need output, then the return label value is " 0 ".For example: as shown in Figure 4, ID number of the job category of storage employee number is 2, and the index value sequence number is 3, and the return label value is 1, and the storing process 400 of expression storage employee number correspondence has output valve, and this output valve is the 3rd parameter in the described parameter list.
Step S32, acquisition module 10 obtain the data dictionary 301 in the database 300.
Step S34 selects module 12 to select the information of needed all storing processs 400 of user in described data dictionary 301.
Step S36 preserves module 14 information of needed all storing processs 400 of the selected user name nominating with storing process 400 is stored in the data link table 500.
Step S38, described selection module 12 is selected current storing process 400 corresponding storing process access rules that need execution in described storing process rule list, for example: if the current storage employee number that needs, as shown in Figure 4, described selection module 12 is used for selecting the corresponding storing process access rule of storage employee number at the storing process rule list: the ID of job category number is 2, the index value sequence number is 3, and the return label value is 1.
Step S40, described acquisition module 10 is searched these storing process 400 titles according to the title of this storing process 400 of the storing process access rule correspondence of described selection in described data link table 500, thereby obtain the information of storing process 400 in data link table 500 of current required execution, obtain the information of storing process 400 in data link table 500 of storage employee number correspondence in the present embodiment.
Step S42, execution module 16 is carried out the current storing process 400 that needs execution, carries out the storing process 400 of described storage employee number correspondence in the present embodiment.
Step S44, execution module 16 return the output result who carries out described storing process 400.If described storing process 400 complete back no-output values are then returned the output result and are " ok ", if described storing process 400 has output valve after complete, then returning the output result is this output valve.
It should be noted last that, above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although with reference to preferred embodiment the present invention is had been described in detail, those of ordinary skill in the art is to be understood that, can make amendment or be equal to replacement technical scheme of the present invention, and not break away from the spirit and scope of technical solution of the present invention.