CN105141672B - A kind of date storage method, apparatus and system - Google Patents

A kind of date storage method, apparatus and system Download PDF

Info

Publication number
CN105141672B
CN105141672B CN201510482395.8A CN201510482395A CN105141672B CN 105141672 B CN105141672 B CN 105141672B CN 201510482395 A CN201510482395 A CN 201510482395A CN 105141672 B CN105141672 B CN 105141672B
Authority
CN
China
Prior art keywords
data
version number
stored
sent
project label
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510482395.8A
Other languages
Chinese (zh)
Other versions
CN105141672A (en
Inventor
樊恒光
孟杰
陈宁
陈一宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Guangzhou Shenma Mobile Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shenma Mobile Information Technology Co Ltd filed Critical Guangzhou Shenma Mobile Information Technology Co Ltd
Priority to CN201510482395.8A priority Critical patent/CN105141672B/en
Publication of CN105141672A publication Critical patent/CN105141672A/en
Application granted granted Critical
Publication of CN105141672B publication Critical patent/CN105141672B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1097Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computational Linguistics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a kind of date storage method, apparatus and system, methods described includes intermediate server and receives the data storage request that item server is sent, and the data storage request includes data to be stored, Data Identification and default project label;The key assignments of the data to be stored is generated according to the Data Identification and the project label;The key assignments and the data to be stored are sent and caching system is stored.Compared with prior art, in the technical scheme of the embodiment of the present invention, the different project label of different item server correspondences, so as to which the data of disparity items are made a distinction, and the data in same project are set different Data Identifications by item server, therefore, the key assignments generated according to project label and Data Identification, can uniquely correspond to a data, so as to avoid the generation of maloperation, enable caching system normal management data, it is ensured that the normal of data is used.

Description

A kind of date storage method, apparatus and system
Technical field
The present invention relates to Internet technical field, more specifically, it is related to a kind of date storage method, apparatus and system.
Background technology
In the web search epoch, when user is by client query information, inquiry request is sent to each by client Item server, for example, novel server, picture servers, video server etc., each item server are inputted according to user Information corresponding data is read in database, and be sent to client as Query Result data and shown.As can be seen here, The each Query Information of user, item server will access database, and the data volume of data place storage is huge, so as to reduce The speed of dynamic web application.In order to reduce the number of times for accessing database, Memcached caching systems are introduced, Memcached is a kind of distributed memory caching system, after item server reads Query Result data from database, Query Result data are sent and stored in Memcached caching systems, when item server receives inquiry request again When, data can be read from Memcached caching systems, so as to avoid accessing database.
Generally, Memcached caching systems data storage in the way of key/value pair, item server is by number to be stored According to being sent to before Memcached caching systems, then self-defined generation key assignments, key assignments is together sent to data Memcached caching systems are preserved.Due to the data storage by way of key/value pair, the inquiry of Memcached caching systems During data, carried out according to the corresponding key assignments of data, specifically, when item server reads, changes, updates or deleted certain data When, the key assignments of the data is sent to Memcached caching systems, Memcached caching systems are looked into the data stored The key assignments identical key assignments looked for and received, then reads the corresponding data of the key assignments, and perform phase to the data read again The operation answered.
However, due to the data of the multiple projects of Memcached caching systems correspondence storage, each project includes many numbers According to, and therefore the key assignments of data, often there are multiple different data correspondences one by the self-defined generation of different item servers The situation of individual identical key assignments, so as to cause caching system to produce maloperation to data so that the management of Memcached caching systems is mixed Disorderly, the normal of influence data is used.
The content of the invention
In view of this, date storage method provided in an embodiment of the present invention, apparatus and system, each data generation of correspondence is only One key assignments, so as to avoid the generation of maloperation so that caching system being capable of normal management data, it is ensured that data it is normal Use.
In a first aspect, receiving project clothes the embodiments of the invention provide a kind of date storage method, including intermediate server The data storage request that business device is sent, the data storage request includes data to be stored, Data Identification and default item target Know;The key assignments of the data to be stored is generated according to the Data Identification and the project label;The key assignments is treated with described Data storage sends and stores caching system.
It is described according to the Data Identification and the project label in the first possible implementation of first aspect Generating the key assignments of the data to be stored includes:For the project label, version number is set;With the version number, the data mark Know and the project label is parameter, the key assignments of the data to be stored is generated according to preset algorithm.
With reference to above-mentioned in a first aspect, in second of possible implementation, version number is being set for the project label Afterwards, in addition to:The project label is defined as to the key assignments of the version number;By the key of the version number and the version number Value sends and stores the caching system, in order to when reading the data to be stored, obtain described from caching system Version number generates the key assignments of the data to be stored.
With reference to above-mentioned in a first aspect, in the third possible implementation, in addition to:Receive the item server Data read request, the data read request includes the Data Identification and the project label;The project label is sent out The caching system is sent to, and receives the version number that the caching system is read according to the project label;With the version This number, the Data Identification and the project label are parameter, and the key assignments of the data to be stored is generated according to preset algorithm;Will The key assignments is sent to the caching system, and receives the data that the caching system is read according to the key assignments;By institute State data and be sent to the item server.
With reference to above-mentioned in a first aspect, in the 4th kind of possible implementation, in addition to:Receive the item server hair The data sent empty request, and the data, which empty request, includes the project label;Generate the redaction of the project label Number;The new version number is sent to the caching system, to replace the original version number stored using the new version number.
With reference to above-mentioned in a first aspect, in the 5th kind of possible implementation, receiving the data that item server is sent Before storage request, in addition to:Receive the project name that the item server is sent;According to project name generation Project label;The project label is sent to the item server.
Second aspect, the embodiment of the present invention additionally provides a kind of data storage device, including:Receiving module, for receiving The data storage request that item server is sent, the data storage request includes data to be stored, Data Identification and default Project label;Generation module, for being treated according to Data Identification and the project label generation that the receiving module is received The key assignments of data storage;Sending module, the key assignments for the generation module to be generated sends and deposited with the data to be stored Store up caching system.
In the first possible implementation of second aspect, the generation module includes version number's setting unit and life Into unit, wherein, version number's setting unit, for setting version number for the project label;The generation unit, is used for Version number, the Data Identification and the project label using version number's setting unit setting is parameter, according to pre- imputation Method generates the key assignments of the data to be stored.
With reference to above-mentioned second aspect, in second of possible implementation, the generation module also includes determining unit, Wherein, the determining unit, the key assignments for the project label to be defined as to the version number;The sending module, is also used Sent in the key assignments for the version number for determining the version number and the determining unit and store the caching system.
With reference to above-mentioned second aspect, in the third possible implementation, the receiving module is additionally operable to receive described The data read request of item server, the data read request includes the Data Identification and the project label;It is described Sending module, is additionally operable to the project label being sent to the caching system, the receiving module receives the caching system The version number read according to the project label;The generation module, is additionally operable to the version received with the receiving module Number, the Data Identification and the project label be parameter, the key assignments of the data to be stored is generated according to preset algorithm;It is described Sending module, is additionally operable to the key assignments being sent to the caching system, the receiving module receive the caching system according to The data that the key assignments is read;The sending module, is additionally operable to send said data to the item server.
With reference to above-mentioned second aspect, in the 4th kind of possible implementation, the receiving module is additionally operable to receive described The data that item server is sent empty request, and the data, which empty request, includes the project label;The generation module, It is additionally operable to generate the new version number of the project label;The sending module, is additionally operable to the new version number being sent to described Caching system, to replace the original version number stored using the new version number.
With reference to above-mentioned second aspect, in the 5th kind of possible implementation, the receiving module is additionally operable to receive described The project name that item server is sent;The generation module, is additionally operable to the project name received according to the receiving module Generate the project label;The sending module, is additionally operable to the project label that the generation module is generated being sent to the item Mesh server.
The third aspect, the embodiment of the present invention additionally provides a kind of data-storage system, including:Intermediate server, project clothes Business device and caching system, wherein, the intermediate server is as described in second aspect;The item server, in described Between server send data storage request;Be additionally operable to the intermediate server send data read request, and receive it is described in Between server respond data transmitted by the data read request;It is additionally operable to empty to intermediate server transmission data and asks Ask;The caching system, for storing key assignments and the data that the intermediate server is sent;It is additionally operable to according to the digital independent Corresponding data is read in request, and the data read are sent into the intermediate server.
From above technical scheme, in order to solve the technical problem that existing storage method produces maloperation to data, this Inventive embodiments provide a kind of date storage method, apparatus and system, and this programme sets an intermediate server, centre clothes Business device receives the data storage request that item server is sent, wherein, data storage request includes data to be stored, Data Identification With default project label, the Data Identification is the identification information of data to be stored, and project label is belonging to data to be stored The identification information of project.Intermediate server generates the key assignments of data to be stored according to Data Identification and project label, then, by key Value and data to be stored send and are saved in caching system.Compared with prior art, different item servers correspondence is different Project label, so as to which the data of disparity items are made a distinction, and the data in same project are set by item server Different Data Identifications are put, therefore, the key assignments generated according to project label and Data Identification can uniquely correspond to a data, So as to avoid the generation of maloperation so that caching system being capable of normal management data, it is ensured that the normal of data is used.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to institute in embodiment The accompanying drawing needed to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the present invention Example, for those of ordinary skill in the art, on the premise of not paying creative work, can also be obtained according to these accompanying drawings Obtain other accompanying drawings.By shown in accompanying drawing, above and other purpose of the invention, feature and advantage will become apparent from.In whole Identical reference indicates identical part in accompanying drawing.Deliberately accompanying drawing, emphasis are not drawn by actual size equal proportion scaling It is the purport for showing the present invention.
Fig. 1 is the method flow diagram of date storage method provided in an embodiment of the present invention;
Fig. 2 is another implementation flow chart of date storage method provided in an embodiment of the present invention;
Fig. 3 is the structural representation of data storage device provided in an embodiment of the present invention;
Fig. 4 is the structural representation of data-storage system provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete Whole description, it is clear that described embodiment is only a part of embodiment of the invention, rather than whole embodiments.It is based on Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made Embodiment, belongs to the scope of protection of the invention.
Because different pieces of information uses identical key assignments in the prior art, when some item server enters to its corresponding data During row operation, for example, when deleting data, other data with the data key values identical can be deleted in the lump, so as to cause to grasp by mistake Make, produce managerial confusion, in order to solve the technical problem, the embodiments of the invention provide following proposal.
Fig. 1 is referred to, Fig. 1 is the method flow diagram of date storage method provided in an embodiment of the present invention.Methods described bag Include following steps:
Step S101:Intermediate server receives the data storage request that item server is sent.
Wherein, the embodiment of the present invention sets an intermediate server between item server and caching system, in the middle of this Server is used for the key assignments for generating data to be stored, and necessary data are handed between finished item server and caching system Mutually, detailed process is described below.In the embodiment of the present invention, intermediate server could be arranged to one section of program, or carrying There is chip of correlation function program etc., here is omitted for the embodiment of the present invention.
In this step, the data storage request transmitted by item server includes data to be stored, Data Identification and preset Project label, wherein, Data Identification be item server according to the attribute of data to be stored generate, for marking the data, And distinguished with other data, therefore, the unique Data Identification of data correspondence in same project.Likewise, in order to distinguish Different projects, each item server is correspondingly arranged unique project label, and the content of project label can be, but not limited to item The english abbreviation of mesh title or project name, can set manually to be automatically generated, and the embodiment of the present invention is not done to this Limitation.
, can be by manually adding for example, the project label corresponding to picture could be arranged to pho, can also be by The corresponding item server of picture, is sent to intermediate server, intermediate server is according to title " figure by project name " picture " Piece " generation project label " pho ", then " pho " is sent in the item server of picture.And picture items server can be Its picture to be stored sets Data Identification, for example, wallpaper -001.
By setting up intermediate server between item server and caching system in this step, handled by intermediate server Data interaction between item server and caching system, compared with prior art, is easy to corresponding to disparity items server Data unified management, provide condition for the implementation of technical solution of the present invention.
Step S102:The key assignments of the data to be stored is generated according to the Data Identification and the project label.
Wherein, intermediate server is received after Data Identification and project label, using Data Identification and project label as parameter, Key assignments is generated according to preset algorithm, therefore, the key assignments can indicate the attribute of data to be stored, and the item belonging to data to be stored Mesh server, so that each data to be stored can correspond to unique key assignments.
It should be noted that in the present embodiment, preset algorithm can be hash algorithm, it is of course also possible to be other calculating Machine algorithm, the embodiment of the present invention is without limitation.
The present embodiment by the project label for representing Data Identification and the affiliated project of data to be stored by generating key assignments so that Key assignments can indicate the attribute of data to be stored, and the item server belonging to data to be stored, so as to ensure each to be stored The unique key assignments of data correspondence, so as to avoid the generation of maloperation.
Step S103:The key assignments and the data to be stored are sent and caching system is stored.
Wherein, data to be stored and its key assignments are sent to caching system, caching system by intermediate server after generation key assignments System is stored data to be stored and its key assignments according to storage format.Due to data being stored in the form of key/value pair Method, the technology being well known to those skilled in the art, here is omitted for the embodiment of the present invention.
Due to form data storage of the caching system by key/value pair, therefore, data are carried out with any operation and is required to lead to The key assignments for crossing data searches corresponding data.Specifically, to read data instance, when item server reads certain data, Xiang Zhong Between server send read requests, read requests include the project label of the item server and the data mark of data to be read Know, intermediate server is received after read requests, obtain project label and Data Identification, and key is generated according to above-mentioned preset algorithm Value, is then sent to caching system, caching system searches the key assignments, and the key assignments is read after finding by the key assignments and reading order Corresponding data, and intermediate server is sent to, intermediate server transmits data to corresponding item server, completes data Read.
The above-mentioned process to read data, deletes data and data is carried out with mistake of the process of other operations with reading data Journey is similar, and after intermediate server calculates generation key assignments, corresponding operational order is sent to caching system according to operation content, Caching system can also be operated accordingly to data according to demand after data are found, and the embodiment of the present invention is no longer gone to live in the household of one's in-laws on getting married herein State.
Understood based on foregoing description, date storage method provided in an embodiment of the present invention, an intermediate server is set, should Intermediate server receives the data storage request that item server is sent, wherein, data storage request includes data to be stored, number According to mark and default project label, the Data Identification is the identification information of data to be stored, and project label is number to be stored According to the identification information of affiliated project.Intermediate server generates the key assignments of data to be stored according to Data Identification and project label, so Afterwards, key assignments and data to be stored are sent and is saved in caching system.Compared with prior art, different item servers correspondence Different project labels, so as to which the data of disparity items are made a distinction, and the data in same project are taken by project Business device sets different Data Identifications, therefore, the key assignments generated according to project label and Data Identification, can uniquely correspond to one Data, so as to avoid the generation of maloperation so that caching system being capable of normal management data, it is ensured that the normal of data makes With.
In order that the function that the technical scheme of the embodiment of the present invention can be realized is more comprehensive, on the basis of above-described embodiment On, the present invention can also include other embodiments.Fig. 2 is referred to, Fig. 2 is date storage method provided in an embodiment of the present invention Another implementation flow chart.Because the present embodiment is the supplement to above-described embodiment, therefore, in the present embodiment with it is above-mentioned Embodiment identical part, may refer to the description of above-described embodiment, here is omitted for the present embodiment.Under the present embodiment includes State step:
Step S201:Intermediate server receives the data storage request that item server is sent.
Technical scheme is described by taking picture as an example for the present embodiment.Picture servers search for this Picture is stored, and storage request is sent to intermediate server, and storage request includes the corresponding project label pho of picture, and Picture servers are the mark wallpaper -001 that picture to be stored is set.
Step S202:For the project label, version number is set.
Wherein, in the present embodiment, intermediate server is that pho sets version number, version number after project label pho is read Content can be numeral, or the information such as letter, the description of the effect embodiment as described below of version number.Assuming that the present embodiment In, set version number is a1.
Step S203:Using the version number, the Data Identification and the project label as parameter, given birth to according to preset algorithm Into the key assignments of the data to be stored.
Wherein, in the present embodiment, intermediate server is calculated using pho, a1 and three amounts of wallpaper -001 as parameter using Hash Method calculates the key assignments of generation picture to be stored.
Because the key assignments of picture to be stored is generated by pho, a1 and three parameters of wallpaper -001, wherein pho and wallpaper -001 For picture servers generate, be fix information, and a1 be intermediate server generation, therefore, in order in picture servers to picture When performing operation, intermediate server can be successfully generated corresponding key assignments, after build version a1, can be stored a1. Specifically, pho can be defined as to a1 key assignments, a1 and pho is sent into caching system is stored, or by pho and a1 Correspondence is stored in intermediate server, and the embodiment of the present invention is without limitation.The present invention a preferred exemplary in, by a1 with Pho is stored into caching system, can be according to project label when reading in order to picture servers, update or delete picture Pho reads version number a1 from caching system, so as to generate the key assignments of picture to be read.
Specifically, when picture servers read, update or delete picture, corresponding operating request is being sent into centre After server, project label pho is sent to caching system by intermediate server first, and caching system searches version number according to pho A1, and a1 is sent to intermediate server, intermediate server generates key assignments according to parameter pho, a1 and wallpaper -001, then by key Value is sent to caching system with corresponding operational order, and caching system performs corresponding operating to picture.
This step can not only be easily facilitated as the unique corresponding key of data generation by setting version number for project label Value, and be easy to manage the corresponding total data of the item server as a whole.
Step S204:The key assignments and the data to be stored are sent and caching system is stored.
Wherein, according to the description of above-described embodiment, when an item server all empties the data stored, need To be sent respectively to the data stored and empty request, it is not only cumbersome and computationally intensive.Due to memcached storages System is caching system, and system can be emptied periodically to the data stored, when item server needs to empty data, Ke Yitong The mode of modification key parameters is crossed, by the key assignments void in whole of all data stored, not only operating process is simple, Er Qieneng Enough greatly reduce data processing amount.
Due to item server one project label of correspondence, if the corresponding project label of modification item server, The situation of the multiple project labels of item server correspondence can be then produced, so as to cause data maintenance inconvenience, therefore, this implementation Version number is introduced in example.When item server needs to empty the data stored, the version number of project label can be changed, Because the key assignments of each data is in generation, version number is used, be therefore, it can the whole nothings of the key assignments of data storage Effect, so that data storage be emptied.
Specifically, by taking picture items server as an example, when picture items server need to empty it is current stored it is all During picture, send data to intermediate server and empty request.Wherein, data, which empty request, includes the item of picture items server Target knows pho, and intermediate server is received after data empty request, generation project label pho new version number a2, and by pho New version number a2 be sent to caching system, use new version number a2 to replace original version a1.Due to the whole currently stored The key assignments of picture is generated all in accordance with original version a1, when the original version a1 that caching system is stored is replaced by new version number a2, Picture servers are when obtaining picture, it is impossible to read original version a1, therefore, will be unable to get currently stored any Picture, is additionally, since picture storage arriving caching system, if there is the data not being read in certain time, it will delayed Deposit system is deleted, so as to which the picture stored is all emptied.
It should be noted that replacing original version a1 method using new version number a2, it can specifically include:First will caching The original version a1 stored in system is deleted, then, and project label pho and new version number a2 is write;Or, read master This number a1, original version a1 is revised as after new version number a2, then write caching system;Or, searched according to project label pho To original version a1 position, the position is write by new version number a2 and covers original version a1.Certainly, the above method is only The preferred embodiment of the embodiment of the present invention, the technical scheme to the embodiment of the present invention is not construed as limiting.
Summary, in order to solve the technical problem that existing storage method produces maloperation to data, the embodiment of the present invention There is provided a kind of date storage method, this programme sets an intermediate server, and the intermediate server receives item server hair The data storage request sent, wherein, data storage request includes data to be stored, Data Identification and default project label, institute The identification information that Data Identification is data to be stored is stated, project label is the identification information of the affiliated project of data to be stored.It is middle Server based on data is identified and project label generates the key assignments of data to be stored, then, and key assignments and data to be stored are sent And it is saved in caching system.Compared with prior art, different item servers corresponds to different project labels, so as to incite somebody to action The data of disparity items are made a distinction, and the data in same project are set different Data Identifications by item server, because This, the key assignments generated according to project label and Data Identification can uniquely correspond to a data, so as to avoid maloperation Produce so that caching system being capable of normal management data, it is ensured that the normal of data is used.
Corresponding with above-mentioned implementation method, the embodiment of the present invention additionally provides a kind of data storage device, refers to figure 3, Fig. 3 be the structural representation of data storage device provided in an embodiment of the present invention, and described device includes:Receiving module 11, life Into module 12 and sending module 13, wherein, receiving module 11, the data storage request for receiving item server transmission, institute Stating data storage request includes data to be stored, Data Identification and default project label;Generation module 12, for according to described Data Identification and the project label that receiving module 11 is received generate the key assignments of the data to be stored;Sending module 13, is used Sent in the key assignments for generating the generation module 12 and the data to be stored and store caching system.
The function of modules and the implementation process of effect refer to corresponding implementation process in the above method in described device, It will not be repeated here.
Compared with prior art, the device described in the present embodiment, is that different item servers set different item targets Know, so as to which the data of disparity items are made a distinction, and the data in same project set different by item server Data Identification, therefore, the key assignments generated according to project label and Data Identification can uniquely correspond to a data, so as to Enough avoid the generation of maloperation so that caching system being capable of normal management data, it is ensured that the normal of data is used.
Based on above-described embodiment, generation module 12 specifically includes version number's setting unit and generation unit, wherein, the version This number setting unit, for setting version number for the project label;The generation unit, for setting single with the version number Version number, the Data Identification and the project label that member is set are parameter, and the number to be stored is generated according to preset algorithm According to key assignments.
On the basis of the present embodiment, in another embodiment, the generation module also includes determining unit, its In, the determining unit, the key assignments for the project label to be defined as to the version number;It is described to send in the present embodiment Module, the key assignments for being additionally operable to the version number by the version number and determining unit determination sends and stores the caching system System.
In addition, on the basis of above-described embodiment, in another embodiment, receiving module 11 is additionally operable to receive described The data read request of item server, the data read request includes the Data Identification and the project label;Send Module 13, is additionally operable to the project label being sent to the caching system, the receiving module 11 receives the caching system The version number read according to the project label;Then, the generation module 12, is additionally operable to connect with the receiving module 11 The version number of receipts, the Data Identification and the project label are parameter, and the data to be stored are generated according to preset algorithm Key assignments;The sending module 13, is additionally operable to the key assignments being sent to the caching system, the receiving module 11 receives described The data that caching system is read according to the key assignments;The sending module 13, then send said data to the project Server.
In another embodiment, the receiving module 11 is additionally operable to receive the number that the item server is sent According to request is emptied, the data, which empty request, includes the project label;In the present embodiment, the generation module 12, also New version number for generating the project label;The sending module 13, is additionally operable to the new version number being sent to described Caching system, to replace the original version number stored using the new version number.
In another embodiment, the receiving module 11, is additionally operable to receive the entry name that the item server is sent Claim;The generation module 12, the project name for being additionally operable to be received according to the receiving module 11 generates the project label;Institute Sending module 13 is stated, is additionally operable to the project label that the generation module 12 is generated being sent to the item server.
The function of modules and unit and the implementation process of effect refer to corresponding reality in the above method in described device Existing process, will not be repeated here.
As can be seen here, the data storage device that the embodiment of the present invention is provided, is the default difference of different item servers Project label, the data of disparity items can be made a distinction, so as to being that each data sets unique corresponding key Value, can avoid the generation of maloperation so that caching system being capable of normal management data, it is ensured that the normal of data is used.
Corresponding with above-mentioned implementation method and device, the embodiment of the present invention additionally provides a kind of data-storage system, please Referring to Fig. 4, Fig. 4 is the structural representation of data-storage system provided in an embodiment of the present invention, and the system includes:Intermediary service Device 1, item server 2 and caching system 3, wherein, intermediate server 1 includes apparatus as described above, the embodiment of the present invention Here is omitted.
Item server 2, for sending data storage request to intermediate server 1, wherein, data storage request includes treating Data storage, Data Identification and default project label;Accordingly, caching system 3, for storing the transmission of intermediate server 1 Key assignments and data.
On the basis of above-described embodiment, in another embodiment, item server 2 is additionally operable to intermediate server 1 Data read request is sent, and receives the data transmitted by the response data read requests of intermediate server 1;Accordingly, in this reality Apply in example, caching system 3, be additionally operable to read corresponding data according to data read request, and the data read are sent to Between server 1.
In addition, in another embodiment, item server 2 is additionally operable to empty request to intermediate server transmission data.
It should be noted that in the present embodiment, the quantity of item server 2 can be multiple, specifically, being answered according to actual Demand is set, and the embodiment of the present invention is without limitation.
In addition, the function of each server and caching system and the implementation process of effect refer to above-mentioned retouch in the system State, will not be repeated here.
Summary, in order to solve the technical problem that existing storage method produces maloperation to data, the embodiment of the present invention There is provided a kind of date storage method, apparatus and system, this programme sets an intermediate server, the intermediate server receiving item The data storage request that mesh server is sent, wherein, data storage request includes data to be stored, Data Identification and default item Target is known, and the Data Identification is the identification information of data to be stored, and project label is item purpose mark belonging to data to be stored Information.Intermediate server generates the key assignments of data to be stored according to Data Identification and project label, then, by key assignments and to be stored Data send and are saved in caching system.Compared with prior art, the different project label of different item servers correspondence, from And the data of disparity items can be made a distinction, and the data in same project are set different data by item server Mark, therefore, the key assignments generated according to project label and Data Identification can uniquely correspond to a data, so as to avoid The generation of maloperation so that caching system being capable of normal management data, it is ensured that the normal of data is used.
Described above is only the embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should It is considered as protection scope of the present invention.

Claims (9)

1. a kind of date storage method, it is characterised in that including:
Intermediate server receives the data storage request that item server is sent, and the data storage request includes number to be stored According to, Data Identification and default project label;
Version number is set for the project label, the version number and the project label are sent and associatedly caching is arrived in storage System, so as to which in response to data read request, the project with being included in the data read request is obtained from the caching system Identify corresponding version number;
Using the version number, the Data Identification and the project label as parameter, generated according to preset algorithm described to be stored The key assignments of data;
The key assignments and the data to be stored are sent to caching system, the caching system is stored in the form of key-value pair In, in order to which the caching system searches corresponding data by the key assignments;
The data sent in response to receiving the item server empty request, and the intermediate server generates the project label New version number, wherein, the data empty request include the project label;
The new version number is sent to the caching system, to replace the original version number stored using the new version number, Wherein, the caching system is configured as will be stored in the data not being read in the scheduled time thereon and deleted.
2. the method as described in claim 1, it is characterised in that after version number is set for the project label, in addition to:
The project label is defined as to the key assignments of the version number;
The key assignments of the version number is sent together with the version number and the caching system is stored, in order to read institute When stating data to be stored, the key assignments that the version number generates the data to be stored is obtained from caching system.
3. method as claimed in claim 1 or 2, it is characterised in that also include:
The data read request of the item server is received, the data read request includes the Data Identification and the item Target is known;
The project label is sent to the caching system, and receives what the caching system was read according to the project label The version number;
Using the version number, the Data Identification and the project label as parameter, generated according to preset algorithm described to be stored The key assignments of data;
The key assignments is sent to the caching system, and receives the number that the caching system is read according to the key assignments According to;
Send said data to the item server.
4. the method as described in claim 1, it is characterised in that receive data storage request that item server sends it Before, in addition to:
Receive the project name that the item server is sent;
The project label is generated according to the project name;
The project label is sent to the item server.
5. a kind of data storage device, it is characterised in that including:
Receiving module, the data storage request for receiving item server transmission, the data storage request includes to be stored Data, Data Identification and default project label;
Generation module, including:
Version number's setting unit, for setting version number for the project label;
Generation unit, for version number, the Data Identification and the project label set with version number's setting unit For parameter, the key assignments of the data to be stored is generated according to preset algorithm;
Sending module, arrives caching system, to ring for sending and associatedly storing the version number and the project label In data read request version corresponding with the project label included in the data read request should be obtained from the caching system This number, and the key assignments for being additionally operable to generate the generation module be sent to the data to be stored and the version number it is slow Deposit system, to be stored in the form of key-value pair in the caching system, in order to which the caching system is searched by the key assignments Corresponding data;
Receiving module, empties request, the data, which empty request, to be included for receiving the data that the item server is sent The project label;
The generation module is additionally operable to generate the new version number of the project label;
The sending module is additionally operable to the new version number being sent to the caching system, to be replaced using the new version number The original version number stored, wherein, the caching system is configured as will be stored in what is be not read in the scheduled time thereon Data are deleted.
6. device as claimed in claim 5, it is characterised in that the generation module also includes determining unit, wherein,
The determining unit, the key assignments for the project label to be defined as to the version number;
The sending module, the key assignments of version number for being additionally operable to determine the determining unit is sent simultaneously together with the version number Store the caching system.
7. the device as described in claim 5 or 6, it is characterised in that
The receiving module, is additionally operable to receive the data read request of the item server, and the data read request includes The Data Identification and the project label;
The sending module, is additionally operable to the project label being sent to the caching system, the receiving module receives described The version number that caching system is read according to the project label;
The generation module, is additionally operable to version number, the Data Identification and the project label received with the receiving module For parameter, the key assignments of the data to be stored is generated according to preset algorithm;
The sending module, is additionally operable to the key assignments being sent to the caching system, the receiving module receives the caching The data that system is read according to the key assignments;
The sending module, is additionally operable to send said data to the item server.
8. device as claimed in claim 5, it is characterised in that
The receiving module, is additionally operable to receive the project name that the item server is sent;
The generation module, the project name for being additionally operable to be received according to the receiving module generates the project label;
The sending module, is additionally operable to the project label that the generation module is generated being sent to the item server.
9. a kind of data-storage system, it is characterised in that including:Intermediate server, item server and caching system, wherein,
The intermediate server is the data storage device any one of claim 5 to 8;
The item server, for sending data storage request to the intermediate server;It is additionally operable to the intermediary service Device sends data read request, and receives the data transmitted by the intermediate server response data read request;Also use Request is emptied in sending data to the intermediate server;
The caching system, for storing key assignments and the data that the intermediate server is sent;It is additionally operable to be read according to the data Take request to read corresponding data, and the data read be sent to the intermediate server, wherein, the caching system by with It is set to and will be stored in the data not being read in scheduled time thereon and delete.
CN201510482395.8A 2015-08-03 2015-08-03 A kind of date storage method, apparatus and system Active CN105141672B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510482395.8A CN105141672B (en) 2015-08-03 2015-08-03 A kind of date storage method, apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510482395.8A CN105141672B (en) 2015-08-03 2015-08-03 A kind of date storage method, apparatus and system

Publications (2)

Publication Number Publication Date
CN105141672A CN105141672A (en) 2015-12-09
CN105141672B true CN105141672B (en) 2017-09-15

Family

ID=54726876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510482395.8A Active CN105141672B (en) 2015-08-03 2015-08-03 A kind of date storage method, apparatus and system

Country Status (1)

Country Link
CN (1) CN105141672B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107544916B (en) * 2016-06-29 2020-04-24 迈普通信技术股份有限公司 Caching method and storage device
CN106528844B (en) * 2016-11-24 2019-07-05 腾讯科技(深圳)有限公司 A kind of data request method and device and data-storage system
CN107025289B (en) * 2017-04-14 2018-12-11 腾讯科技(深圳)有限公司 A kind of method and relevant device of data processing
CN109213709B (en) * 2017-06-30 2021-01-15 阿里巴巴(中国)有限公司 Data conversion method and device and data processing equipment
CN107508878B (en) * 2017-08-17 2020-08-11 杭州时趣信息技术有限公司 Key name deleting method and device based on cache proxy server
CN108052656A (en) * 2017-12-28 2018-05-18 迈普通信技术股份有限公司 A kind of data cache control method and equipment
CN109902119A (en) * 2019-03-11 2019-06-18 深圳众享互联科技有限公司 Block chain and database hybrid system Data Identification method and its methods of exhibiting
CN112052234B (en) * 2020-08-20 2024-04-23 北京完美赤金科技有限公司 Service data processing method and device, storage medium and electronic device
CN113849373A (en) * 2021-09-27 2021-12-28 中国电信股份有限公司 Server supervision method and device and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101867607A (en) * 2010-05-21 2010-10-20 北京无限立通通讯技术有限责任公司 Distributed data access method, device and system
US9311135B2 (en) * 2011-01-18 2016-04-12 Scality, S.A. Method for generating universal objects identifiers in distributed multi-purpose storage systems
CN103428171B (en) * 2012-05-17 2016-08-24 阿里巴巴集团控股有限公司 The processing method of a kind of session, application server and system
US9367572B2 (en) * 2013-09-06 2016-06-14 Realnetworks, Inc. Metadata-based file-identification systems and methods
CN103607312B (en) * 2013-11-29 2017-02-15 广州华多网络科技有限公司 Data request processing method and system for server system

Also Published As

Publication number Publication date
CN105141672A (en) 2015-12-09

Similar Documents

Publication Publication Date Title
CN105141672B (en) A kind of date storage method, apparatus and system
KR102240557B1 (en) Method, device and system for storing data
US9805086B2 (en) Consolidating information relating to duplicate images
EP2721504B1 (en) File processing method, system and server-clustered system for cloud storage
US8285690B2 (en) Storage system for eliminating duplicated data
CN104537076B (en) A kind of file read/write method and device
JP2012089094A5 (en)
CN105701096A (en) Index generation method, data inquiry method, index generation device, data inquiry device and system
CN105100146A (en) Data storage method, device and system
CN102708165A (en) Method and device for processing files in distributed file system
US10594804B2 (en) Directory service discovery and/or learning
CN104881466A (en) Method and device for processing data fragments and deleting garbage files
CN110019048A (en) Document handling method, device, system and server based on MongoDB
CN109600410A (en) Data-storage system and method
WO2020215580A1 (en) Distributed global data deduplication method and device
KR20090063669A (en) Method and system of file metadata management transparent about address changing of data servers and their disk movements
US20200125266A1 (en) Providing a global unique identifier for a storage volume
CN108111598B (en) Cloud disk data issuing method and device and storage medium
CN105765570A (en) Music identification
CN111382180B (en) Data clearing method and device for local cache
WO2021137768A1 (en) Method, apparatus and device for consuming messages based on message queue
CN102164152A (en) Method and system for remotely processing files
CN108062277A (en) A kind of electronics authority data access method, apparatus and system
US20090240700A1 (en) Distributed file management system
CN107526530B (en) Data processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200811

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: 510627 Guangdong city of Guangzhou province Whampoa Tianhe District Road No. 163 Xiping Yun Lu Yun Ping square B radio tower 12 layer self unit 01

Patentee before: GUANGZHOU SHENMA MOBILE INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right