A kind of method of data storage, system and equipment
Technical field
The invention belongs to computer network communication field, relate in particular to storage means, storage system and the memory device of user data in the computer network communication process.
Background technology
In the compunication process, server often stores a large amount of user data, for user capture and calling.Wherein, in a kind of user data of typical types, each user's data is formed by a plurality of data fields, and identical data field has the data message of same type, is under the jurisdiction of each user data of users and carries out mark by the user ID of a unique correspondence.It typically is example with the address book data, all comprise a plurality of data fields such as name, sex, phone number, telephone number, work address, postcode, e-mail address, individual's introduction or unit introduction in each contact person's the user data, name field in each user data all is used for storing user's name information, and phone number field all is used for storing user's telephone number information.
In such user data, the access frequency difference of different pieces of information field is bigger, as the access frequency of fields such as name, sex, phone number or Email than higher, thereby the user requires than higher for the access speed of these data fields, and the access frequency of fields such as work address, postcode or individual's introduction is relatively low, and the user also can be lower for the access speed requirement of these data fields.
At present, above-mentioned user data generally leaves in the hard disk of server, continuous expansion along with customer volume, data volume also is on the increase, continue to increase the operating load of server, reduced the access speed of user data, influenced user's communications efficient, service provider just need purchase storage demand and the fast access demand that the more service device satisfies user data like this.
In data storage devices such as server, mainly contain two kinds of data storage devices, i.e. internal memory and disk, the travelling speed of internal memory is than fast 2 orders of magnitude of disk, but its memory capacity is than the little 1-2 of a disk order of magnitude.If in disk, the capacity of disk is enough with storage of subscriber data, but access speed can be slow, so service provider need provide multiple servers, utilizes different server process some users' request, to reach the requirement of user to access speed.If storage of subscriber data in internal memory, can be provided than access speed faster to the user, but because the memory capacity of internal memory is limited, service provider needs more server store a large amount of user data.
In order to reduce system overhead and equipment purchasing expense, in compunication, often use cache technology.Cache technology is based on the principle of locality of system, and promptly system has visited after a part of user data, has very big probability can visit again recent user data of visiting recently.Therefore, after system visits certain the certain customers' data that is stored on the disk, utilize cache technology this partial data and in the recent period the data storage of other accessed mistakes in travelling speed faster in the internal memory, can obtain from internal memory thereby reach when system visits this certain customers data once more, improve the access speed of user data.
But when different user data during by frequent access, internal memory needs data quantity stored to strengthen, and can cause the capacity of internal memory can not satisfy the memory requirement of the data volume of rapid growth.Simultaneously, in a lot of the application, the visit of user data and does not meet the requirement of principle of locality often at random, this has just exceeded the scope of application of cache technology, utilizes traditional cache technology to be difficult to reduce system overhead and equipment purchasing expense in this case.
Summary of the invention
The objective of the invention is to optimize the mode of data storage in the prior art, improve the access speed and the efficient of user data, reduce the operation expense of server, thereby reduce user's equipment purchasing expense.
In order to realize goal of the invention, the invention provides a kind of date storage method, described data comprise a plurality of data fields, and unique corresponding data sign, described data are stored in data storage device, described data storage device comprises first memory storage and second memory storage, the travelling speed of described first memory storage is greater than described second memory storage, described data field is set to first storage level and second storage level, and the access frequency of the first storage level data is higher than the second storage level data;
With described Data Identification is that index is put into described first memory storage with the first storage level data and stored;
With described Data Identification is that index is put into described second memory storage with the second storage level data and stored.
Described first memory storage is the internal memory of described data storage device.
Described second memory storage is the hard disk of described data storage device.
In order to realize goal of the invention better, the present invention further provides a kind of data-storage system, be used for handling the data that are stored in data storage device, described data comprise a plurality of data fields, and unique corresponding data sign, described data storage device comprises first memory storage and second memory storage, and the travelling speed of described first memory storage is greater than described second memory storage, and described data-storage system is carried out following operation:
(1) described data field is separated into first storage level and second storage level, the access frequency of the first storage level data is higher than the second storage level data;
(2) be that index is put into described first memory storage with the first storage level data and stored with described Data Identification;
(3) be that index is put into described second memory storage with the second storage level data and stored with described Data Identification.
Described system further comprises:
Classification is provided with module, is used to be provided with the storage rank of described data field, and described storage rank comprises first storage level and second storage level, and the access frequency of the first storage level data is higher than the second storage level data;
Communication interface receives the data that client is submitted storage to, and the data of calling to the client backward reference;
The first storage level database is the index stores first storage level data with described Data Identification;
The second storage level database is the index stores second storage level data with described Data Identification;
The classification processing module is provided with module, communication interface, the first storage level database and the second storage level database with described classification and is connected, and carries out the classification of data and stores and call.
The described first storage level database is kept in described first memory storage, and described first memory storage is the internal memory of described data storage device.
The described second storage level database is preserved in described second memory storage, and described second memory storage is the hard disk of described data storage device.
In order to realize goal of the invention better, the present invention further also provides a kind of data storage device, be used for storaging user data, comprise first memory storage and second memory storage, the travelling speed of described first memory storage is greater than described second memory storage, and described data comprise a plurality of data fields, and unique corresponding data sign, described data storage device further comprises the data staging storage system, is used to carry out following operation:
(1) described data field is separated into first storage level and second storage level, the access frequency of the first storage level data is higher than the second storage level data;
(2) be that index is put into described first memory storage with the first storage level data and stored with described Data Identification;
(3) be that index is put into described second memory storage with the second storage level data and stored with described Data Identification.
Described data staging storage system further comprises:
Classification is provided with module, is used to be provided with the storage rank of described data field, and described storage rank comprises first storage level and second storage level, and the access frequency of the first storage level data is higher than the second storage level data;
Communication interface receives the data that client is submitted storage to, and the data of calling to the client backward reference;
The first storage level database is the index stores first storage level data with described Data Identification;
The second storage level database is the index stores second storage level data with described Data Identification;
The classification processing module is provided with module, communication interface, the first storage level database and the second storage level database with described classification and is connected, and carries out the classification of data and stores and call.
The described first storage level database is kept in described first memory storage, and described first memory storage is the internal memory of described data storage device.
The described second storage level database is kept in described second memory storage, and described second memory storage is the hard disk of described data storage device.
The present invention carries out the classification storage by the data field with user data, can improve the access speed and the efficient of user data effectively.Simultaneously, can reduce the operation expense of server, thereby reduce user's equipment purchasing expense.
Description of drawings
Fig. 1 is the synoptic diagram of data storage device among the present invention;
Fig. 2 is that data staging storage system provided by the invention constitutes synoptic diagram;
Fig. 3 is the realization flow figure of data staging storage provided by the invention.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
Fig. 1 shows the structural representation of data storage device 100, and wherein data storage device 100 can be a server, and perhaps other large and medium-sized computing machines comprise first memory storage 101 and second memory storage 102.Wherein, the memory capacity of first memory storage 101 is less than second memory storage 102, but travelling speed is higher than second memory storage 102.Typically, first memory storage 101 can be the internal memory of data storage device 100, second memory storage 102 can be storage mediums such as the hard disk of data storage device 100 or CD, the user submits to data storage device 100 by client 200 needs storage user data, and data storage device 100 storage user data are called in visit in communication process.
In the present invention, according to the different access frequency of different pieces of information field in the user to user data and different access speed requirements, storage rank to the data field is divided, promptly be divided into two storages of first storage level and second storage level rank, wherein the access frequency of the first storage level data and access speed are higher than the second storage level data, it is corresponding to carry out association by Data Identification between the first storage level data and the second storage level data, is convenient to the user and calls mutually.The foundation of data storage classification is at user in concrete application and the business different pieces of information field to be had different access frequencys and access speed requirement, typical in the address book data, name, sex, the access frequency of fields such as telephone number is than higher, need call immediately, the user requires than higher the access speed of these data fields, therefore these data fields are set to the first storage level data, the access frequency of other data fields is lower, the user is less demanding to the access speed of these data fields, therefore these data fields are set to the second storage level data, and it is corresponding to carry out association by Data Identification between the first storage level data and the second storage level data.
In the present invention, the first storage level data and the second storage level data are stored respectively, wherein, the first storage level data storage is convenient to the user by client 200 frequent access and quick calling in first memory storage 101 of data storage device 100; With second memory storage 102 of the second storage level data storage, just call to data storage device 100 request visits when having only the user to need by client 200 at data storage device 100.
Fig. 2 shows the realization flow of data staging storage means provided by the invention, and details are as follows:
In step S201, the storage rank of different pieces of information field in the user data is set, the data field that a part of access frequency is high is set to the first storage level data, and other data fields are set to the second storage level data;
In step S202, receive client 200 and submit storage user data to;
In step S203, the different pieces of information field in the user data is separated into first storage level and second storage level according to the storage rank that is provided with;
In step S204, with the first storage level data storage in first memory storage 101;
In step S205, the second storage level data are saved in second memory storage 102.
Fig. 3 shows the formation synoptic diagram of data staging storage system 300 provided by the invention, and data staging storage system 200 operates in the data storage device 100, is used for user data is carried out the classification storage and classification is called.
Data staging storage system 300 comprises that classification is provided with module 301, communication interface 302, the first storage level database 303, the second storage level database 304 and classification processing module 305, wherein:
Classification is provided with module 301, is used for being provided with the storage rank of user data data field, calls for classification processing module 305, can by classification the storage rank that module 301 is provided with data field flexibly be set according to concrete business demand and applicable cases;
Communication interface 302 receives client 200 and submits storage user data to, submits to classification processing module 303 to store classification user data; The user data that receives client 200 calls request of access, delivers classification processing module 303 and handles; Simultaneously, receive the user data that classification processing module 303 sends and send to client 200;
The first storage level database 303 is kept in first memory storage 101 of data storage device 100, is index with the Data Identification, the data field of first storage level that storage classification processing module 305 is submitted to;
The second storage level database 304 is kept in second memory storage 102 of data storage device 100, is index with the Data Identification, the data field of second storage level that storage classification processing module 305 is submitted to.
Classification processing module 305, received communication interface 302 is submitted storage user data to, read the storage rank that classification is provided with the data field that is provided with in the module 301, data field is separated first storage level and second storage level, be sent to the first storage level database 303 and 304 storages of the second storage level database respectively; Simultaneously, when receiving the data access calls request of communication interface 302 transmissions, Data Identification in the recognition data visit call request, the respective data field of transferring storage in the first storage level database 303 or the second storage level database 304 sends communication interface 302 to.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.