Background technology
The miscellaneous service resource management system utilizes computer technology and network technology that resource information is gathered, shared and management.Therefore, in the miscellaneous service resource management system, lot of data need be stored, and at present, the data storage that relies on two dimension is usually developed, so that towards fixing business demand or service management flow.
With breadboard experimental data management system is example, illustrates in the prior art it is how the data of actual detected to be stored.
F is a data acquisition in the experimental data management system, supposes that there are equipment 1, equipment 2 and equipment 3 in this laboratory.Wherein, A1, A2, A3 are respectively the detection data of equipment 1, equipment 2,3 couples of detected object A of equipment, and B1, B2, B3 are respectively the detection data of equipment 1, equipment 2,3 couples of detected object B of equipment.Data acquisition with same detection object is called as data recording, and each data recording in the data recording is numbered, and as the detection data of equipment 1, this numbering is called the territory.
See also Fig. 1, Fig. 1 is existing data storage synoptic diagram.A, B are respectively the numbering of detected object, and existing date storage method is that each data with every among F data recording are kept in the storage unit in order, and this date storage method can be preserved relatively-stationary data.But there is following shortcoming in it:
Along with the user constantly widens the requirement of resource management system, probably make original data can not satisfy new demand.Such as, customer requirements increases equipment 4, then need in F, increase each detected object detected data on equipment 4, because original data are that static state is preserved successively, so there is not clearance spaces between each data, because there is the shortcoming of extendability difference in it, therefore when increasing the territory, how newly-increased numeric field data is stored, then directly influence the normal operation of system.
The first method of available technology adopting is to wipe original historical data, in the experimental data management system that increases new numeric field data write storage unit again.Because the newly-increased data of storage need be wiped original historical data, so cause the low problem of storage efficiency.And this method need be changed the storage of historical record, thereby influences the stability of system.Especially when reading and writing corresponding data, because the storage again of data causes memory address to change, if corresponding storage address information in the untimely modification system will influence the normal operation of total system by the storage address information of record data.Simultaneously, spend a large amount of manpowers and search and revise this storage address information, increased system development costs.
The second method of available technology adopting is to part historical data carrying (seeing also Fig. 2).Thisly carry out data storage by mode of transport and determine that at first which historical data need carry, and calculate the distance of each historical data that will carry carrying, carry out the carrying of historical data then, store newly-increased numeric field data into corresponding memory space at last.This method data storage efficiency is slow, and, destroy the data of original storage easily, cause the system can't operate as normal.
That is to say, this service resource management system that carries out data storage with two dimension, after the data item customization finishes, Field Count in the tables of data and tables of data number just are fixed, can conveniently increase new record according to existing storage means with above-mentioned field, but be difficult to the new record that storage increases newer field, promptly the data extendability is relatively poor.But, deepen along with the user understands constantly system's related service, the also constantly upgrading of demand of system.The user proposes new demand to the service resource management system.And when original data can not satisfy new demand, data that need be new just to the increase of original system.Do like this and not only increase system development costs, and the user waits for that the cycle of new demand realization is long, even new sometimes upgrading meeting storage causes and has a strong impact on the serious situation that incompatible history data store may occur storing when new data to original system data.
Summary of the invention
The object of the present invention is to provide the extendible date storage method of a kind of realization, cause system extension poor with solution owing to existing storage means, and then cause the technical matters that storage efficiency is low, system is unstable and the development system cost is high.
For addressing the above problem, the extendible date storage method of a kind of realization of the present invention, in order to realize the storage of data in the service resource management system, described service resource management system is to be unit input data with the table, and every record data of each table are to import corresponding thresholding according to preestablishing every domain information, comprising:
(1) identifies to each table of showing the described table of the setting unique identification of energy in advance;
(2) when importing new record data in the table, described record data are that the unit is preserved with the territory: table sign, described record data positional information and corresponding thresholding in described table of preserving described record data place table.
Described positional information is row sign and the line identifiers of described record data in described table, and described row are designated the unique identifier in described territory, and described line identifier is the unique identifiers of these record data in described table.
Step (1) comprises that also described table is set identifies the memory block, claims and corresponding table sign in order to the table name of preserving each table.
Also comprise described row sign memory block is set, in order to preserving all domain names in each table and corresponding row sign, and the table sign of table under the described territory.
When the reading and recording data, find the line identifier that table identifies and described record data are shown at the place of the table at described record data place earlier, search described record data memory block, obtain and export the thresholding that all have described table sign and described line identifier.
If when receiving the deletion record request of data, determine the table name at described record data place and the positional information at described record data place earlier: the line identifier of described record data in described table and the domain name at record data place;
Search described table sign memory block according to table name, obtain the table sign of described table;
According to the described row sign of domain name lookup memory block, obtain the described row sign of thresholding;
Search described record data memory block according to the search information that comprises table sign, line identifier and row sign, and the search information of deleting described record data and comprising table sign, row sign, line identifier, and discharge described storage unit.
If when receiving more new recorded data request, determine the table name at described record data place and the positional information at described record data place earlier: the line identifier of described record data in described table and the domain name at record data place;
Search described table sign memory block according to table name, obtain the table sign of described table;
According to the described row sign of domain name lookup memory block, obtain the described row sign of thresholding;
Search described record data memory block according to the search information that comprises table sign, line identifier and row sign, and delete described record data, the record data of newly importing are saved in the corresponding storage unit.
Compared with prior art, the present invention has the following advantages: the present invention is when the storage data, according to thresholding is that unit stores, and not only preserves the search information that described thresholding is also preserved described thresholding: the positional information in the table at described thresholding place and the described thresholding place table.When increasing data newly at every turn, only need be that unit stores and gets final product with the thresholding, thereby avoid changing the history data store position, the memory location that is historical data is fixing and independently, increase the storage of historical data in not influence of the new data system, so the present invention improved the stability of system, and when the storage data, need not calculate steps such as transport distance, therefore improve the efficient of data storage.Also have, each data storage location of each data recording is fixed, and when reading and writing by above-mentioned address data memory, has avoided modification history data store address, thereby has reduced system development costs.
Embodiment
Below in conjunction with accompanying drawing, specify the present invention.
The present invention mainly stores various table data in the service resource management system, has extensibility to reach data storage, makes things convenient for the effect of system maintenance.In the present invention, when the various data in the incoming traffic resource management system were stored, adopting with the thresholding was that unit stores, and searches described thresholding for convenience, when storage, also need store the table information at described thresholding place and the positional information in described table, with easy-to-look-up.
Introduce earlier place of the present invention hardware system.See also Fig. 3, it is the principle schematic of the computer system at date storage method of the present invention place.Described computer system comprises processor 1, storer 2, input equipment 3 (as keyboard, mouse) and output device 4 (as display) at least.Processor 1 is used for the work of each building block of control computer, and storer 2 is used to store data.
In the present invention, storer 2 can be divided into following unit: service resources memory block 21, row sign memory block 22, table sign memory block 23 and record data memory block 24.Wherein, service resources memory block 21 is used for the structural information (domain information of forming table) of storage service resource management system table information, table etc.It comprises: the number in the territory of the number of the table that is provided with in the described service resource management system, the table name of each table, composition table and the information in each territory.Row signs memory block 22 is used for storing the information in each territory in all tables of described service resource management system, comprise the table sign at domain name, place, described territory or table name, can be in the service resource management system can unique differential threshold domain identifier.Table sign memory block 23 is used for storing all table information of described service resource management system, comprise table name and can be in the service resource management system table sign of unique Identification Lists.Record data memory block 24 is used to preserve the record data of input.
When the user creates table by input media 3 in the service resource management system, import table name and other table information, as the number in the composition territory shown, the byte number that the domain name in each territory, each territory are shared etc., and described information is kept in the service resources memory block 21.
The user demonstrates each table information of service resources system by output unit 4 (as display), and domain information in each table, to make things convenient for the user to input record data.
According to aforementioned calculation machine system, the present invention proposes a kind of date storage method.See also Fig. 4, it is a date storage method of the present invention.Described method is in order to realize the storage of data in the service resource management system, described service resource management system is to be unit input data with the table, and every record data of each table are to import corresponding thresholding according to preestablishing every domain information, may further comprise the steps:
S110: the table sign of setting the described table of the unique identification of energy in advance to each table;
S120: when importing new record data in the table, described record data are that the unit is preserved with the territory: preserve the table sign of described record data place table, thresholding positional information and corresponding thresholding in described table of described record data.
The data of preserving can directly be stored in the record data memory block, are example with the table F in the background technology still below,
If the line identifier of described record data (A1, A2, A3) place table is 1, the line identifier of record data (B1, B2, B3) place table is 2, and the domain name at A1, B1 place be the domain name at K1, A2, B2 place is K2, and the domain name of A3 and B3 place table is K3.Then as follows in record data storage area stores data according to storage means of the present invention:
F |
1 |
K1 |
A1 |
F |
1 |
K2 |
A2 |
F |
1 |
K3 |
A3 |
F |
2 |
K1 |
B1 |
F |
2 |
K2 |
B2 |
F … |
2 |
K3 |
B3 |
From the above, behind the new record data of input, be to be that unit stores with the thresholding in the present invention, and store table, the row, column information at each thresholding place, so that can utilize those information in time to read described thresholding.In present service resource management system, after the structure (what territories forming described table by) of a table was determined, the position of existing territory in table seldom can take place to change, and the present invention makes with regard to being based on this.And when increase neofield in table after, processor will be kept at the service resources memory block from the domain information (comprising the storage size that domain name, field type and territory are shared) that the input equipment input is created.When comprising the thresholding of new establishment in the record data of user's input, then directly directly storing described thresholding according to storage means of the present invention gets final product, avoided needing carrying in the prior art or revising the data of former record data memory block, reached the efficient that data storage has extensibility thus.
Suppose in table F, to have created neofield again, its domain name is K4, and the thresholding in the A record in the K4 territory is A4, then according to date storage method of the present invention: obtain earlier table, the row, column information at A4 place, and will show, row, column information and described thresholding A4 directly be kept in the record data memory block and get final product.
F |
1 |
K1 |
A1 |
F |
1 |
K2 |
A2 |
F |
1 |
K3 |
A3 |
F |
2 |
K1 |
B1 |
F |
2 |
K2 |
B2 |
F |
2 |
K3 |
B3 |
F |
1 |
K4 |
A4 |
Avoided as from the foregoing needing carrying in the prior art or revising the data of former record data memory block, reached the efficient that data storage has extensibility thus.
In said method, the table sign is to adopt table name to discern its table from professional resource management system, but consider that the table name that may be provided with in the service resource management system is longer, when storage, take a large amount of storage spaces easily, for this reason, table sign memory block is set in the embodiments of the invention, be used for preserving the table name of each table of service resource management system and corresponding table sign thereof, described table sign can be that the user imports, but optimum mode is the table sign that is different from table name by one of processor distribution, and described sign can be data, character etc.
And, except the table sign of preserving described thresholding place, also need in the data recording memory block, preserve described thresholding positional information in described table.Described positional information is row sign and the line identifiers of described record data in described table, and described row are designated the unique identifier in described territory, and described line identifier is the unique identifiers of these record data in described table.In the above-described embodiment, described row sign is to represent with domain name, and described line identifier is that the position that is recorded in the described table at place, described territory is represented.In fact, the row sign can be different with domain name, for this reason, row sign of the present invention memory block is used for the corresponding relation of memory row sign and domain name, when creating neofield in the table, processor can distribute a row sign to domain name, is kept at row sign memory block together with the table name at place, described territory or table sign and domain name
In the service resource management system, except table F, also be provided with table M, table M has two territory M1, M2, and
When then carrying out the data recording storage, at first in table sign memory block, preserve table F and M and corresponding table sign, as:
Table name |
The table sign |
F |
1 |
M |
2 |
In row sign memory block, preserve domain name and corresponding row sign then, as
The table name of place table |
Domain name |
The row sign |
F |
K1 |
1 |
F |
K2 |
2 |
F |
K3 |
3 |
Each thresholding with record data is stored in the record data memory block subsequently, as
1 |
1 |
1 |
A1 |
1 |
1 |
2 |
A2 |
1 |
1 |
3 |
A3 |
1 |
2 |
1 |
B1 |
1 |
2 |
2 |
B2 |
1 |
2 |
3 |
B3 |
2 |
1 |
4 |
C1 |
2 |
1 |
5 |
C2 |
2 |
2 |
4 |
D1 |
2 |
2 |
5 |
D2 |
Obviously, store according to above-mentioned date storage method, data have extensibility, and when especially increasing neofield, the good data recording of storage reaches the efficient that improves storage efficiency before need not carrying.And present embodiment also employing table sign, row sign replaces table name and domain name, reduces memory capacity.
When the reading and recording data, find the line identifier that table identifies and described record data are shown at the place of the table at described record data place earlier, search described record data memory block, obtain and export the thresholding that all have described table sign and described line identifier.
If when receiving the deletion record request of data, determine the table name at described record data place and the positional information at described record data place earlier: the line identifier of described data in described table and the domain name at data place;
Search described table sign memory block according to table name, obtain the table sign of described table;
According to the described row sign of domain name lookup memory block, obtain the described row sign of thresholding;
Search described record data memory block according to the search information that comprises table sign, line identifier and row sign, and the search information of deleting described record data and comprising table sign, row sign, line identifier, and discharge described storage unit.
If when receiving more new recorded data request, determine the table name at described record data place and the positional information at described record data place earlier: the line identifier of described record data in described table and the domain name at data place;
Search described table sign memory block according to table name, obtain the table sign of described table;
According to the described row sign of domain name lookup memory block, obtain the described row sign of thresholding;
Search described record data memory block according to the search information that comprises table sign, line identifier and row sign, and delete described record data, the data that input is newly write down are saved in the corresponding storage unit.
More than disclosed only be several specific embodiment of the present invention, but those skilled in the art can think variation, all should fall within protection scope of the present invention.