CN106528844B - A kind of data request method and device and data-storage system - Google Patents
A kind of data request method and device and data-storage system Download PDFInfo
- Publication number
- CN106528844B CN106528844B CN201611044045.4A CN201611044045A CN106528844B CN 106528844 B CN106528844 B CN 106528844B CN 201611044045 A CN201611044045 A CN 201611044045A CN 106528844 B CN106528844 B CN 106528844B
- Authority
- CN
- China
- Prior art keywords
- data
- request
- major key
- server
- value
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2228—Indexing structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2219—Large Object storage; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2458—Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
- G06F16/2471—Distributed queries
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/60—Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Databases & Information Systems (AREA)
- General Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Software Systems (AREA)
- Fuzzy Systems (AREA)
- Mathematical Physics (AREA)
- Probability & Statistics with Applications (AREA)
- Computational Linguistics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the present application provides a kind of data request method and device and data-storage system, applied to any server in data-storage system, passes through the request of data for receiving and carrying at least one not associated target major key for having value;It is local to search and the associated value of target major key;If there is the target major key for not finding associated value, the value found is associated with corresponding target major key, and the request of data for the target major key for being associated with the value found is forwarded to another server for not receiving request of data in data-storage system;If all target major keys find associated value, the value found is associated with corresponding target major key, returned the result and be sent to the mode of the client of request data, so that when client requests multiple key-value pairs to data-storage system, it is not required to repeatedly be interacted with the server in data-storage system, on the basis of improving client-side interface performance, the purpose of the request data in data-storage system is realized.
Description
Technical field
The present invention relates to data request processing technical fields, and in particular to a kind of data request method and device and data are deposited
Storage system.
Background technique
Because of key-value pair substantial amounts, therefore the key-value pair in data-storage system with different major keys may be stored in number
According to the different server in storage system.Wherein, data-storage system such as distributed memory system, the distributed storage system
System is made of multiple servers;Key-value pair is major key and the combination with the associated value of major key, and value can indicate content information, such as close
Title, gender etc..
Because key-value pair is distributed storage on each server in data-storage system, so when client is stored to data
When system request multiple key-value pairs, it usually needs more in data-storage system to access according to the distribution of request key-value pair
A server, to guarantee to pull the key-value pair of all requests from data-storage system.
Client is repeatedly interacted with the server progress in data-storage system to realize to multiple key-value pairs of request
The mode pulled, it will usually there are problems that client throughput amount is low and then cause to influence client-side interface performance.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of data request method and device and data-storage system, to mention
On the basis of high client-side interface performance, the purpose of the request data in data-storage system is realized.
To achieve the above object, the embodiment of the present invention provides the following technical solutions:
A kind of data request method, applied to any server in data-storage system, which comprises
Request of data is received, the request of data carries at least one not associated target major key for having value;
It is local to search and the associated value of target major key;
If there is the target major key for not finding associated value, the value found is associated with corresponding target major key,
And it another is not received what the request of data for the target major key for being associated with the value found was forwarded in the data-storage system
Cross the server of request of data;
If all target major keys find associated value, the value found is associated with corresponding target major key, is obtained
To returning the result, obtained return the result is sent to the client of request data.
A kind of request of data device, applied to any server in data-storage system, described device includes:
Request of data receiving unit, is requested for receiving data, and the request of data, which carries at least one, not associated has value
Target major key;
Local searching unit is searched and the associated value of target major key for local;
Request of data retransmission unit, for if there is the target major key for not finding associated value, the value that will be found
It is associated with corresponding target major key, and the request of data for the target major key for being associated with the value found is forwarded to the data and is deposited
Another server for not receiving request of data in storage system;
The value found is associated with by as a result return unit if finding associated value for all target major keys
Corresponding target major key, is returned the result, and obtained return the result is sent to the client of request data.
A kind of data-storage system, including at least one server, each server include:
Memory is previously stored at least one key-value pair;
Processor, receives request of data, and the request of data carries at least one not associated target major key for having value;
It searches and the associated value of target major key in the memory;
If there is the target major key for not finding associated value, the value found is associated with corresponding target major key,
And it another is not received what the request of data for the target major key for being associated with the value found was forwarded in the data-storage system
Cross the server of request of data;
If all target major keys find associated value, the value found is associated with corresponding target major key, is obtained
To returning the result, obtained return the result is sent to the client of request data.
The embodiment of the present application provides a kind of data request method and device and data-storage system, is applied to data storage system
Any server in system carries the request of data of at least one not associated target major key for having value by receiving;It is local to search
With the associated value of target major key;If there is the target major key for not finding associated value, the value found is associated with accordingly
Target major key, and the request of data for the target major key for being associated with the value found is forwarded to another in data-storage system
The server of request of data was not received;If all target major keys find associated value, the value found is associated with
Corresponding target major key, is returned the result and is sent to the mode of the client of request data, so that working as client to data
It when storage system requests multiple key-value pairs, is not required to repeatedly be interacted with the server in data-storage system, is improving client
On the basis of end interface performance, the purpose of the request data in data-storage system is realized.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of data request method application scenarios schematic diagram provided by the embodiments of the present application;
Fig. 2 is a kind of data request method flow chart provided by the embodiments of the present application;
Fig. 3 is that a kind of value that will be found provided by the embodiments of the present application is associated with corresponding target major key, and will be associated with
There is the request of data of the target major key of the value found to be forwarded to another data that do not received in the data-storage system to ask
The method flow diagram for the server asked;
Fig. 4 is another data request method flow chart provided by the embodiments of the present application;
Fig. 5 is a kind of request of data forwarding of target major key that will be associated with the value found provided by the embodiments of the present application
To the method flow diagram of another server for not receiving request of data in the data-storage system;
Fig. 6 is a kind of service for not receiving request of data from the data-storage system provided by the embodiments of the present application
In device, the method flow diagram being locally stored with the server of the identified associated value of target major key is determined;
Fig. 7 is that the request of data for the target major key that another kind provided by the embodiments of the present application will be associated with the value found turns
It is sent to the method flow diagram of another server for not receiving request of data in the data-storage system;
Fig. 8 is one kind provided by the embodiments of the present application from identified server, determining and identified target major key
The method flow diagram for the server that the modulus remainder being calculated using the modulus algorithm is matched;
Fig. 9 is a kind of structural schematic diagram of request of data device provided by the embodiments of the present application;
Figure 10 is a kind of detailed construction schematic diagram of request of data retransmission unit provided by the embodiments of the present application;
Figure 11 is the detailed construction schematic diagram of another request of data retransmission unit provided by the embodiments of the present application;
Figure 12 is a kind of detailed construction schematic diagram of second determination unit provided by the embodiments of the present application;
Figure 13 is the detailed construction schematic diagram of another request of data retransmission unit provided by the embodiments of the present application;
Figure 14 is a kind of detailed construction schematic diagram of 5th determination unit provided by the embodiments of the present application;
Figure 15 is a kind of hardware block diagram of request of data device provided by the embodiments of the present application.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
Embodiment:
Fig. 1 is a kind of data request method application scenarios schematic diagram provided by the embodiments of the present application.
A kind of data request method provided by the embodiments of the present application is applied to data-storage system, the data-storage system
In include at least one server.Specifically, three servers are only embodied in data-storage system as shown in Figure 1, and
Respectively with the name of server 1, server 2 and server 3.Optionally, data can be arbitrarily arranged in inventor according to their own needs
The number for the server for including in storage system, it is not limited here.Also, herein by three services in data-storage system
Device uses server 1, server 2 and server 3 to name respectively, is intended merely to description conveniently, it is not limited here.
Optionally, when client requests multiple key-value pairs to data-storage system, need to only appoint into data-storage system
Server of anticipating sends request of data.Here request of data can only be sent to by not limiting client as shown in Figure 1
Request of data can be sent to any one in server 1, server 2 or server 3 by server 1, optionally, client.
It is illustrated by taking Fig. 1 as an example: when client requests multiple key-value pairs to data-storage system, need to only be stored to data
Any one server (such as server 1) in system sends request of data, and then each clothes in data-storage system
The forwarding of request of data is realized between business device, to be returned the result.Request of data as shown in Figure 1 is in data-storage system
Pass-through mode between each server is preferred embodiment provided by the embodiments of the present application, and related request of data is stored in data is
The pass-through mode between each server in system is it is not limited here.It is deposited for example, request of data is sent to data by client
After storage system, request of data need to only may be forwarded between the part server in data-storage system can be obtained return
As a result.
It should be understood that being asked for each server being located in data-storage system as long as receiving data
It asks, i.e., need to execute corresponding data request method according to the data request method flow chart being illustrated in fig. 2 shown below.
As shown in Fig. 2, this method comprises:
S101, request of data is received, the request of data carries at least one not associated target major key for having value;
Optionally, the mode for receiving request of data includes: the request of data for receiving client and sending, alternatively, receiving upper one
The request of data of server forwarding of request of data is received (for example, request of data is sent to server 1, server 1 by client
When request of data is transmitted to server 2, it is believed that server 2 is the received upper one server (service for receiving request of data
Device 1) forwarding request of data.
It should be understood that carrying at least one not associated target major key for having value in the request of data received.That is, connecing
At least one target major key is carried in the request of data received, the target major key is not associated value.The purpose of request of data is:
Obtain each associated value of target major key that request of data carries.
S102, local lookup and the associated value of target major key;
Optionally, after server receives request of data, the local mode searched with the associated value of target major key, packet
Include: server is searched and the associated value of target major key in coupled database.That is, the number being connected with server
It is determined as the local of the server according to library.
Optionally, the database being connected with server may be disposed on the server, or independently of the server
It is connected to the server, it is not limited here.
Optionally, the database being connected with server can be the server cluster being made of multiple databases, can also be
An individual database, in relation to the concrete form for the database being connected with server, it is not limited here.
S103, the target major key for not finding associated value is judged whether there is;If there is not finding associated value
Target major key, execute step S104;If all target major keys find associated value, step S105 is executed;
Optionally, from the target major key determined in step S101, it is determined whether there is the mesh for not finding associated value
Mark major key;If there is the target major key for not finding associated value, step S104 is executed;If all target major keys are searched
To associated value, step S105 is executed.
S104, the value found is associated with to corresponding target major key, and the target major key that will be associated with the value found
Request of data be forwarded to another server for not receiving request of data in the data-storage system;
It optionally, include: the value for being directed to and each finding by the mode that the value found is associated with corresponding target major key,
The determining and associated target major key of value found, and the value found is associated with identified target major key.
S105, the value found is associated with corresponding target major key, is returned the result, is returned the result obtained
It is sent to the client of request data.
Optionally, it is described return the result including " if all target major keys find associated value, the value that will be found
It is associated with corresponding target major key, the request of data of the obtained target major key for being associated with the value found ".
Above is only the preferred embodiment of the embodiment of the present application, and return knot can be arbitrarily arranged in inventor according to their own needs
The particular content for including in fruit, it is not limited here.
In order to be more comprehensively illustrated to a kind of data request method provided by the embodiments of the present application, now to the application
" value found is associated with corresponding target major key, and lookup will be associated in a kind of request of data that embodiment provides
To the request of data of target major key of value be forwarded to another clothes for not receiving request of data in the data-storage system
Business device " process describes in detail, specifically refers to Fig. 3.
Fig. 3 is that a kind of value that will be found provided by the embodiments of the present application is associated with corresponding target major key, and will be associated with
There is the request of data of the target major key of the value found to be forwarded to another data that do not received in the data-storage system to ask
The method flow diagram for the server asked.
As shown in figure 3, this method comprises:
S201, received data request in, the value found is associated with corresponding target major key, is associated with
The request of data of the target major key of the value found;
Optionally, server receives request of data (request of data carries at least one not associated target for having value
Major key);It is local to search and the associated value of target major key;If there is the target major key for not finding associated value, in institute
In received request of data, the value found is associated with corresponding target major key, obtains the target for being associated with the value found
The request of data of major key.
Another into the data-storage system of S202, the obtained request of data of forwarding did not received request of data
Server.
Optionally, the obtained request of data of above-mentioned steps S201 (is associated with the number of the target major key of the value found
According to request) it is forwarded to another server for not receiving request of data in the data-storage system.
Optionally, another into the data-storage system of obtained request of data is forwarded not receive request of data
Server, comprising: forward obtained request of data to any one of the data-storage system not receive data
The server of request.
Corresponding target major key is associated with to a kind of value that will be found provided by the embodiments of the present application by above-mentioned, and will
Another do not received that the request of data for being associated with the target major key of the value found is forwarded in the data-storage system counts
Be further described according to the method for the server of request so that data request method provided by the embodiments of the present application be more clear,
Completely, be convenient for those skilled in the art understand that.
Optionally, in the embodiment of the present application, the request of data for the target major key for being associated with the value found is forwarded to institute
After stating another server for not receiving request of data in data-storage system, having turned for hop count and request of data is adjusted
It is corresponding to send out number.
In the embodiment of the present application, it is preferred that whenever the request of data for the target major key that will be associated with the value found turns
After being sent to another server for not receiving request of data in the data-storage system, adjustment hop count is asked with data
The hop count asked is corresponding.
Optionally, hop count is corresponding to the hop count of request of data, comprising: hop count has turned with request of data
It is identical to send out number.
Above is only the preferred embodiment of the embodiment of the present application, and forwarding time can be arbitrarily arranged in inventor according to their own needs
Number concrete mode corresponding with the hop count of request of data, it is not limited here.
Further, existing in order to be more comprehensively illustrated to a kind of data request method provided by the embodiments of the present application
It describes in detail to another data request method provided by the embodiments of the present application, specifically refers to Fig. 4.
Fig. 4 is another data request method flow chart provided by the embodiments of the present application.
As shown in figure 4, this method comprises:
S301, request of data is received, the request of data carries at least one not associated target major key for having value;
S302, local lookup and the associated value of target major key;
S303, the target major key for not finding associated value is judged whether there is;If there is not finding associated value
Target major key, execute step S304;If all target major keys find associated value, step S307 is executed;
S304, the value found is associated with corresponding target major key;
S305, judge current hop count whether the quantity Matching with the server in the data-storage system;If
The quantity of server in current hop count and the data-storage system mismatches, and executes step S306;
Optionally, when the quantity of current hop count and the server in data-storage system mismatches, illustrate the number
According in storage system, there is also the servers for not receiving request of data, therefore, execute step S306, will be associated with and find
The request of data of the target major key of value is forwarded to another server for not receiving request of data in the data-storage system
(that is, the request of data for the target major key for being associated with the value found is forwarded to any one of described data-storage system
The server of request of data was not received).
S306, the request of data for the target major key for being associated with the value found is forwarded in the data-storage system
Another server for not receiving request of data;
If S307, all target major keys find associated value, the value found is associated with corresponding target master
Key is returned the result, and obtained return the result is sent to the client of request data.
Referring to fig. 4 it is found that a kind of data request method provided by the embodiments of the present application, if in current hop count and institute
When stating the quantity Matching of the server in data-storage system, further comprises step S308, is associated with and finds according to
The request of data determination of target major key of value return the result, identified return the result is sent to the client of request data
End.
Optionally, when the quantity Matching of current hop count and the server in the data-storage system, described in explanation
The server for not receiving request of data has been not present in data-storage system, therefore, the mesh for being associated with the value found
The request of data determination of mark major key returns the result, and identified return the result is sent to the client of request data.
Another data request method provided by the embodiments of the present application is further described by above-mentioned, so that the application
Embodiment provide data request method be more clear, completely, be convenient for those skilled in the art understand that.
Further, existing in order to be more comprehensively illustrated to a kind of data request method provided by the embodiments of the present application
To " data for the target major key for being associated with the value found being asked in a kind of data request method provided by the embodiments of the present application
Seek another server for not receiving request of data being forwarded in the data-storage system " process describes in detail, has
Body refers to Fig. 5.
Fig. 5 is a kind of request of data forwarding of target major key that will be associated with the value found provided by the embodiments of the present application
To the method flow diagram of another server for not receiving request of data in the data-storage system.
As shown in figure 5, this method comprises:
S401, from the request of data of target major key for being associated with the value found, determine the not associated target master for having value
Key;
Optionally, from the request of data of target major key for being associated with the value found, the not associated target for having value is determined
Major key, comprising: determine the not associated target master for having value present in the request of data for the target major key for being associated with the value found
Key.
S402, from the server for not receiving request of data in the data-storage system, determine be locally stored with
The server of the identified associated value of target major key;
Optionally, from the request of data of target major key for being associated with the value found, the not associated mesh for having value is determined
After marking major key, in the server that need to not receive request of data from the data-storage system, determines and be locally stored and institute
Each server of the determining associated value of target major key.
S403, the request of data for the target major key for being associated with the value found is forwarded to any one identified local
It is stored with the server with the identified associated value of target major key.
The request of data of the target major key that the value found will be associated with is forwarded to any one identified local
It is stored with the server with the identified associated value of target major key, comprising: the target major key of the value found will be associated with
Request of data is forwarded in any one server determined by step S402.
Further, Fig. 6 is that one kind provided by the embodiments of the present application did not received data from the data-storage system
In the server of request, the method flow diagram being locally stored with the server of the identified associated value of target major key is determined.
As shown in fig. 6, this method comprises:
S501, the server for not receiving request of data in the data-storage system is determined;
S502, the major key for obtaining the key-value pair that identified each server local stores respectively;
Optionally, other being stored in each server in data-storage system in the data-storage system are every
The key-value pair list of a server;Data were not received when the server for receiving request of data determines in the data-storage system
After the server of request, the key-value pair list of identified each server is obtained, includes at least one in the key-value pair list
A key-value pair;And then each major key for including in each key-value pair list is obtained respectively, as corresponding with the key-value pair list
Server local storage major key.
S503, from identified server, determination major key identical with identified target major key is locally stored
Server.
Optionally, from identified server, major key identical with identified target major key has been locally stored in determination
Server as from the server for not receiving request of data in the data-storage system, determine be locally stored with
The server of the identified associated value of target major key.
A kind of data for the target major key that will be associated with the value found provided by the embodiments of the present application are asked by above-mentioned
Being further described for another player method for not receiving request of data being forwarded in the data-storage system is asked, so that
Data request method provided by the embodiments of the present application is more clear, completely, be convenient for those skilled in the art understand that.
Further, existing in order to be more comprehensively illustrated to a kind of data request method provided by the embodiments of the present application
To " data for the target major key for being associated with the value found being asked in a kind of data request method provided by the embodiments of the present application
Seek another server for not receiving request of data being forwarded in the data-storage system " process describes in detail, has
Body refers to Fig. 7.
Fig. 7 is that the request of data for the target major key that another kind provided by the embodiments of the present application will be associated with the value found turns
It is sent to the method flow diagram of another server for not receiving request of data in the data-storage system.
As shown in fig. 7, this method comprises:
S601, from the request of data of target major key for being associated with the value found, determine the not associated target master for having value
Key;
S602, the server for not receiving request of data in the data-storage system is determined;
The local of S603, the modulus algorithm for obtaining the data-storage system and identified each server take
Mould remainder;
Optionally, when each server by utilizing modulus mode in data-storage system stores key-value pair, the data
The modulus algorithm that each server uses in storage system is identical, and the modulus at this moment not only needing to obtain data-storage system is calculated
Method, the modulus algorithm include: for by the numerical value (such as carrying out the numerical value 3 in modulus to 3) of modulus;It also needs to obtain the number
According to each server in storage system local modulus remainder (local modulus remainder be relative to server storage key-value pair
In major key for, local modulus remainder be server local storage key-value pair major key according to modulus algorithm carry out modulus
When remainder).For example, when data-storage system includes two servers (server 1 and server 2), data storage system
To 3 modulus, the modulus remainder of server 1 is the 1 (master of each key-value pair stored in expression server 1 for the modulus algorithm instruction of system
Key is that 1), the modulus remainder of server 2 is 2 (each key-value pairs stored in expression server 2 to the remainder of 3 progress modulus
2) remainder that major key carries out modulus to 3 is.
S604, from identified server, it is determining to be calculated with identified target major key using the modulus algorithm
To the server that matches of modulus remainder;
Optionally, server is matched with the modulus remainder that identified target major key is calculated using the modulus algorithm
Mode include: that the local modulus remainder of server is taken with identified target major key using what the modulus algorithm was calculated
Mould remainder is identical.
S605, by the request of data for the target major key for being associated with the value found be forwarded to determined by any one and institute
The server that modulus remainder matches is calculated using the modulus algorithm in determining target major key.
Optionally, by the request of data for the target major key for being associated with the value found be forwarded to determined by any one with
The server that modulus remainder matches is calculated using the modulus algorithm in identified target major key, comprising: will be associated with
The request of data of the target major key of the value found is forwarded to any one in above-mentioned steps S604 in identified server.
Further, Fig. 8 is one kind provided by the embodiments of the present application from identified server, it is determining with it is identified
The method flow diagram for the server that the modulus remainder that target major key is calculated using the modulus algorithm matches.
As shown in figure 8, this method comprises:
S701, the modulus remainder that identified each target major key is calculated separately using the modulus algorithm;
Optionally, the modulus remainder of identified each target major key is calculated separately using the modulus algorithm, comprising: needle
To identified each target major key, the modulus remainder of the target major key is calculated using the modulus algorithm.For example, working as target
When the numerical value of major key is 5, if modulus algorithm instruction carries out modulus calculating to 3, the target major key for being 5 for numerical value is carried out to 3
Modulus calculates, and the modulus remainder that the numerical value of the target major key is 5 is 2.
S702, from identified server, determine any one modulus having with the modulus remainder that is calculated
The server of the identical local modulus remainder of remainder.
Optionally, from identified server, what is determined has and any one in the modulus remainder that is calculated
The server of the identical local modulus remainder of modulus remainder is determining with identified mesh as from identified server
The server that the modulus remainder that mark major key is calculated using the modulus algorithm matches.
A kind of data for the target major key that will be associated with the value found provided by the embodiments of the present application are asked by above-mentioned
Being further described for another player method for not receiving request of data being forwarded in the data-storage system is asked, so that
Data request method provided by the embodiments of the present application is more clear, completely, be convenient for those skilled in the art understand that.
Method is described in detail in aforementioned present invention disclosed embodiment, diversified forms can be used for method of the invention
Device realize, therefore the invention also discloses a kind of request of data device, specific embodiment is given below and carries out specifically
It is bright.
Fig. 9 is a kind of structural schematic diagram of request of data device provided by the embodiments of the present application.
In the embodiment of the present application, it is preferred that device as shown in Figure 9 is applied to any service in data-storage system
Device.
As shown in figure 9, the device includes:
Request of data receiving unit 81, is requested for receiving data, and the request of data, which carries at least one, not associated to be had
The target major key of value;
Local searching unit 82 is searched and the associated value of target major key for local;
Request of data retransmission unit 83, for if there is the target major key for not finding associated value, by what is found
Value is associated with corresponding target major key, and the request of data for the target major key for being associated with the value found is forwarded to the data
Another server for not receiving request of data in storage system;
The value found is associated with by as a result return unit 84 if finding associated value for all target major keys
It to corresponding target major key, is returned the result, obtained return the result is sent to the client of request data.
A kind of alternative construction of request of data retransmission unit 83 provided in an embodiment of the present invention turns referring to Figure 10, request of data
Bill member 83 includes:
Associative cell 91, for being requested in received data if there is the target major key for not finding associated value
In, the value found is associated with corresponding target major key, obtains the request of data for the target major key for being associated with the value found;
First request of data forwards subelement 92, for forwarding obtained request of data into the data-storage system
Another server for not receiving request of data.
In the embodiment of the present application, it is preferred that be forwarded to the request of data for the target major key for being associated with the value found
After another server for not receiving request of data in the data-storage system, hop count and request of data have been adjusted
Hop count is corresponding.
A kind of alternative construction of request of data retransmission unit 83 provided in an embodiment of the present invention, request of data retransmission unit 83
It include: the first retransmission unit, if the quantity for the server in current hop count and the data-storage system is not
Match, another is not received what the request of data for the target major key for being associated with the value found was forwarded in the data-storage system
Cross the server of request of data.
Further, a kind of request of data retransmission unit 83 provided by the embodiments of the present application further include: the second retransmission unit,
If being associated with lookup according to described for the quantity Matching of the server in current hop count and the data-storage system
To the request of data determination of target major key of value return the result, identified return the result is sent to the client of request data
End.
Another alternative construction of request of data retransmission unit 83 provided in an embodiment of the present invention is referring to Figure 11, request of data
Retransmission unit 83 includes:
First determination unit 101, for from the request of data of target major key for being associated with the value found, determination not to be closed
It is associated with the target major key of value;
Second determination unit 102, for from the server for not receiving request of data in the data-storage system, really
Surely the server with the identified associated value of target major key is locally stored;
Second request of data forwards subelement 103, the request of data of the target major key for that will be associated with the value found
The server with the identified associated value of target major key is locally stored in any one determined by being forwarded to.
A kind of alternative construction of second determination unit 102 provided in an embodiment of the present invention is referring to Figure 12, the second determination unit
102 include:
First server determination unit 111, for determining the clothes for not receiving request of data in the data-storage system
Business device;
Major key acquiring unit 112, for the key-value pair of each server local storage determined by obtaining respectively
Major key;
Second server determination unit 113, for from identified server, determine be locally stored with it is identified
The server of the identical major key of target major key.
Another alternative construction of request of data retransmission unit 83 provided in an embodiment of the present invention is referring to Figure 13 request of data
Retransmission unit 83 includes:
Third determination unit 121, for from the request of data of target major key for being associated with the value found, determination not to be closed
It is associated with the target major key of value;
4th determination unit 122, for determining the server for not receiving request of data in the data-storage system;
Modulus remainder acquiring unit 123, for obtaining the modulus algorithm of the data-storage system and identified every
The local modulus remainder of a server;
5th determination unit 124, described in from identified server, determining and identified target major key is utilized
The server that the modulus remainder that modulus algorithm is calculated matches;
Computing unit 125, determined by being forwarded to the request of data for being associated with the target major key of the value found
The server that modulus remainder matches is calculated using the modulus algorithm with identified target major key in any one.
A kind of alternative construction of 5th determination unit 124 provided in an embodiment of the present invention is referring to Figure 14, the 5th determination unit
124 include:
Modulus remainder computing unit 131, for calculating separately identified each target major key using the modulus algorithm
Modulus remainder;
Third server determination unit 132, for determining the modulus for having and being calculated from identified server
The server of the identical local modulus remainder of any one modulus remainder in remainder.
Optionally, request of data device can be hardware device, and above-described module, unit can be to be set to data
Functional module in request unit.Figure 15 shows the hardware block diagram of request of data device, and referring to Fig.1 5, request of data dress
Setting may include: processor 141, communication interface 142, memory 143 and communication bus 144;Wherein processor 141, communication connect
Mouth 142, memory 143 complete mutual communication by communication bus 144;Optionally, communication interface 142 can be communication mould
The interface of block, such as the interface of gsm module;
Processor 141, for executing program;Memory 143, for storing program;Program may include program code, journey
Sequence code includes computer operation instruction;
Processor 141 may be a central processor CPU or specific integrated circuit ASIC (Application
Specific Integrated Circuit), or be arranged to implement the integrated electricity of one or more of the embodiment of the present invention
Road;Memory 143 may include high speed RAM memory, it is also possible to further include nonvolatile memory (non-volatile
Memory), a for example, at least magnetic disk storage.
Wherein, program can be specifically used for:
Request of data is received, the request of data carries at least one not associated target major key for having value;
It is local to search and the associated value of target major key;
If there is the target major key for not finding associated value, the value found is associated with corresponding target major key,
And it another is not received what the request of data for the target major key for being associated with the value found was forwarded in the data-storage system
Cross the server of request of data;
If all target major keys find associated value, the value found is associated with corresponding target major key, is obtained
To returning the result, obtained return the result is sent to the client of request data.
The embodiment of the present application provides a kind of request of data device, applied to any server in data-storage system, leads to
Cross the request of data for receiving and carrying at least one not associated target major key for having value;It is local to search and the associated value of target major key;
If there is the target major key for not finding associated value, the value found is associated with corresponding target major key, and will association
Have that the request of data of the target major key of the value found is forwarded in data-storage system another did not received request of data
Server;If all target major keys find associated value, the value found is associated with corresponding target major key, is obtained
The mode of the client of request data is returned the result and is sent to, so that when client requests multiple key assignments to data-storage system
Clock synchronization is not required to repeatedly be interacted with the server in data-storage system, real on the basis of improving client-side interface performance
The purpose of the request data in data-storage system is showed.
A kind of data-storage system is also disclosed in the embodiment of the present invention, and the data-storage system includes at least one service
Device, each server include:
Memory is previously stored at least one key-value pair;
Processor, receives request of data, and the request of data carries at least one not associated target major key for having value;
It searches and the associated value of target major key in the memory;
If there is the target major key for not finding associated value, the value found is associated with corresponding target major key,
And it another is not received what the request of data for the target major key for being associated with the value found was forwarded in the data-storage system
Cross the server of request of data;
If all target major keys find associated value, the value found is associated with corresponding target major key, is obtained
To returning the result, obtained return the result is sent to the client of request data.
The embodiment of the present application provides a kind of data-storage system, applied to any server in data-storage system, leads to
Cross the request of data for receiving and carrying at least one not associated target major key for having value;It is local to search and the associated value of target major key;
If there is the target major key for not finding associated value, the value found is associated with corresponding target major key, and will association
Have that the request of data of the target major key of the value found is forwarded in data-storage system another did not received request of data
Server;If all target major keys find associated value, the value found is associated with corresponding target major key, is obtained
The mode of the client of request data is returned the result and is sent to, so that when client requests multiple key assignments to data-storage system
Clock synchronization is not required to repeatedly be interacted with the server in data-storage system, real on the basis of improving client-side interface performance
The purpose of the request data in data-storage system is showed.
To sum up:
The embodiment of the present application provides a kind of data request method and device and data-storage system, is applied to data storage system
Any server in system carries the request of data of at least one not associated target major key for having value by receiving;It is local to search
With the associated value of target major key;If there is the target major key for not finding associated value, the value found is associated with accordingly
Target major key, and the request of data for the target major key for being associated with the value found is forwarded to another in data-storage system
The server of request of data was not received;If all target major keys find associated value, the value found is associated with
Corresponding target major key, is returned the result and is sent to the mode of the client of request data, so that working as client to data
It when storage system requests multiple key-value pairs, is not required to repeatedly be interacted with the server in data-storage system, is improving client
On the basis of end interface performance, the purpose of the request data in data-storage system is realized.
Each embodiment in this specification is described in a progressive manner, the highlights of each of the examples are with other
The difference of embodiment, the same or similar parts in each embodiment may refer to each other.For device disclosed in embodiment
For, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is said referring to method part
It is bright.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The foregoing description of the disclosed embodiments enables those skilled in the art to implement or use the present invention.
Various modifications to these embodiments will be readily apparent to those skilled in the art, as defined herein
General Principle can be realized in other embodiments without departing from the spirit or scope of the present invention.Therefore, of the invention
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest scope of cause.
Claims (17)
1. a kind of data request method, which is characterized in that applied to any server in data-storage system, the method packet
It includes:
Request of data is received, the request of data carries at least one not associated target major key for having value;
It is local to search and the associated value of target major key;
If there is the target major key for not finding associated value, the value found is associated in received request of data
Corresponding target major key, obtain the request of data for the target major key for being associated with the value found, and will be associated with and find
The request of data of the target major key of value is forwarded to another server for not receiving request of data in the data-storage system;
If all target major keys find associated value, the value found is associated with corresponding target major key, is returned
It returns as a result, obtained return the result is sent to the client of request data.
2. the method according to claim 1, wherein the value that will be found is associated with corresponding target master
Key, and another do not connect what the request of data for the target major key for being associated with the value found was forwarded in the data-storage system
Received the server of request of data, comprising:
In received data request, the value found is associated with corresponding target major key, obtains being associated with and find
The request of data of the target major key of value;
Forward another server that did not received request of data of the obtained request of data into the data-storage system.
3. the method according to claim 1, wherein the data for the target major key for being associated with the value found are asked
After seeking another server for not receiving request of data being forwarded in the data-storage system, hop count and data are adjusted
The hop count of request is corresponding;
The request of data of the target major key that the value found will be associated with is forwarded to another in the data-storage system
The server of request of data was not received, comprising:
If the quantity of the server in current hop count and the data-storage system mismatches, it will be associated with and find
The request of data of the target major key of value is forwarded to another server for not receiving request of data in the data-storage system.
4. according to the method described in claim 3, it is characterized by further comprising:
If the quantity Matching of the server in current hop count and the data-storage system, is associated with lookup according to described
To the request of data determination of target major key of value return the result, identified return the result is sent to the client of request data
End.
5. the method according to claim 1, wherein the number of the target major key that the value found will be associated with
Another server for not receiving request of data being forwarded in the data-storage system according to request, comprising:
From the request of data of target major key for being associated with the value found, the not associated target major key for having value is determined;
From the server for not receiving request of data in the data-storage system, determination has been locally stored and identified mesh
Mark the server of the associated value of major key;
By the request of data for the target major key for being associated with the value found be forwarded to determined by any one be locally stored with
The server of the identified associated value of target major key.
6. according to the method described in claim 5, it is characterized in that, described do not received data from the data-storage system
In the server of request, the server being locally stored with the identified associated value of target major key is determined, comprising:
Determine the server for not receiving request of data in the data-storage system;
The major key of the key-value pair of each server local storage determined by obtaining respectively;
From identified server, the server that major key identical with identified target major key is locally stored is determined.
7. the method according to claim 1, wherein the number of the target major key that the value found will be associated with
Another server for not receiving request of data being forwarded in the data-storage system according to request, comprising:
From the request of data of target major key for being associated with the value found, the not associated target major key for having value is determined;
Determine the server for not receiving request of data in the data-storage system;
Obtain the modulus algorithm of the data-storage system and the local modulus remainder of identified each server;
From identified server, more than the determining modulus being calculated using the modulus algorithm with identified target major key
The server that number matches;
By the request of data for the target major key for being associated with the value found be forwarded to determined by any one and identified mesh
It marks major key and the server that modulus remainder matches is calculated using the modulus algorithm.
8. determining and determining the method according to the description of claim 7 is characterized in that described from identified server
The server that matches of the modulus remainder that is calculated using the modulus algorithm of target major key, comprising:
The modulus remainder of identified each target major key is calculated separately using the modulus algorithm;
From identified server, determine with identical with any one modulus remainder in the modulus remainder being calculated
The server of local modulus remainder.
9. a kind of request of data device, which is characterized in that applied to any server in data-storage system, described device packet
It includes:
Request of data receiving unit, is requested for receiving data, and the request of data carries at least one not associated mesh for having value
Mark major key;
Local searching unit is searched and the associated value of target major key for local;
Request of data retransmission unit, for if there is the target major key for not finding associated value, the value found to be associated with
Corresponding target major key into received request of data, the data for obtaining the target major key for being associated with the value found are asked
It asks, and another is not connect what the request of data for the target major key for being associated with the value found was forwarded in the data-storage system
Received the server of request of data;
The value found is associated with accordingly by as a result return unit if finding associated value for all target major keys
Target major key, returned the result, obtained return the result be sent to the client of request data.
10. device according to claim 9, which is characterized in that the request of data retransmission unit, comprising:
Associative cell, for will be looked into received data request if there is the target major key for not finding associated value
The value found is associated with corresponding target major key, obtains the request of data for the target major key for being associated with the value found;
First request of data forwards subelement, for forwarding obtained request of data another into the data-storage system
The server of request of data was not received.
11. device according to claim 9, which is characterized in that the data of the target major key of the value found will be associated with
After requesting another server for not receiving request of data being forwarded in the data-storage system, hop count and number are adjusted
It is corresponding according to the hop count of request;
The request of data retransmission unit, comprising:
First retransmission unit, if quantity for the server in current hop count and the data-storage system is not
Match, another is not received what the request of data for the target major key for being associated with the value found was forwarded in the data-storage system
Cross the server of request of data.
12. device according to claim 11, which is characterized in that the request of data retransmission unit, further includes:
Second retransmission unit, if the quantity Matching for the server in current hop count and the data-storage system,
It is returned the result according to the determination of the request of data of the target major key of the value for being associated with and finding, returns the result hair for identified
Give the client of request data.
13. device according to claim 9, which is characterized in that the request of data retransmission unit, comprising:
First determination unit not associated has value for determining from the request of data of target major key for being associated with the value found
Target major key;
Second determination unit, it is local for determining from the server for not receiving request of data in the data-storage system
It is stored with the server with the identified associated value of target major key;
Second request of data forwards subelement, for the request of data for being associated with the target major key of the value found to be forwarded to institute
The server with the identified associated value of target major key is locally stored in any one determining.
14. device according to claim 13, which is characterized in that second determination unit, comprising:
First server determination unit, for determining the server for not receiving request of data in the data-storage system;
Major key acquiring unit, the major key of the key-value pair for obtaining identified each server local storage respectively;
Second server determination unit, for from identified server, determination to be locally stored and identified target master
The server of the identical major key of key.
15. device according to claim 9, which is characterized in that the request of data retransmission unit, comprising:
Third determination unit not associated has value for determining from the request of data of target major key for being associated with the value found
Target major key;
4th determination unit, for determining the server for not receiving request of data in the data-storage system;
Modulus remainder acquiring unit, for obtaining the modulus algorithm and identified each clothes of the data-storage system
The local modulus remainder of business device;
5th determination unit, for from identified server, determining and identified target major key to utilize the modulus to calculate
The server that the modulus remainder that method is calculated matches;
Computing unit, for by the request of data for being associated with the target major key of the value found be forwarded to determined by any one
The server that modulus remainder matches is calculated using the modulus algorithm with identified target major key.
16. device according to claim 15, which is characterized in that the 5th determination unit, comprising:
Modulus remainder computing unit, for using the modulus algorithm calculate separately determined by each target major key modulus more than
Number;
Third server determination unit, for from identified server, determine have in the modulus remainder that is calculated
The identical local modulus remainder of any one modulus remainder server.
17. a kind of data-storage system, which is characterized in that including at least one server, each server includes:
Memory is previously stored at least one key-value pair;
Processor, receives request of data, and the request of data carries at least one not associated target major key for having value;
It searches and the associated value of target major key in the memory;
If there is the target major key for not finding associated value, the value found is associated in received request of data
Corresponding target major key, obtain the request of data for the target major key for being associated with the value found, and will be associated with and find
The request of data of the target major key of value is forwarded to another server for not receiving request of data in the data-storage system;
If all target major keys find associated value, the value found is associated with corresponding target major key, is returned
It returns as a result, obtained return the result is sent to the client of request data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611044045.4A CN106528844B (en) | 2016-11-24 | 2016-11-24 | A kind of data request method and device and data-storage system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611044045.4A CN106528844B (en) | 2016-11-24 | 2016-11-24 | A kind of data request method and device and data-storage system |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106528844A CN106528844A (en) | 2017-03-22 |
CN106528844B true CN106528844B (en) | 2019-07-05 |
Family
ID=58356886
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611044045.4A Active CN106528844B (en) | 2016-11-24 | 2016-11-24 | A kind of data request method and device and data-storage system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106528844B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107094178B (en) * | 2017-05-11 | 2019-06-18 | 广东网金控股股份有限公司 | A kind of Internet data transmission method, apparatus and server terminal |
CN110019212B (en) * | 2017-11-29 | 2021-06-18 | 杭州海康威视数字技术股份有限公司 | Data processing method and device and database server |
CN108235074B (en) * | 2018-01-08 | 2021-03-16 | 武汉斗鱼网络科技有限公司 | Method for sending and receiving key information, server and computer equipment |
CN111049902B (en) * | 2019-09-16 | 2021-08-13 | 腾讯科技(深圳)有限公司 | Data storage method, device, storage medium and equipment based on block chain network |
CN112799872B (en) * | 2021-02-19 | 2022-08-12 | 上海交通大学 | Erasure code encoding method and device based on key value pair storage system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101706819A (en) * | 2009-12-14 | 2010-05-12 | 金蝶软件(中国)有限公司 | Query method and system of database, client side, server and database |
CN102402590A (en) * | 2011-10-31 | 2012-04-04 | 深圳中兴力维技术有限公司 | Managing method and system of key value data |
CN104683422A (en) * | 2013-12-03 | 2015-06-03 | 腾讯科技(深圳)有限公司 | Method and device for transmitting data |
CN105141672A (en) * | 2015-08-03 | 2015-12-09 | 广州神马移动信息科技有限公司 | Method, device and system for data storage |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8949294B2 (en) * | 2011-03-23 | 2015-02-03 | Red Hat, Inc. | Data grid supporting multiple protocols |
-
2016
- 2016-11-24 CN CN201611044045.4A patent/CN106528844B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101706819A (en) * | 2009-12-14 | 2010-05-12 | 金蝶软件(中国)有限公司 | Query method and system of database, client side, server and database |
CN102402590A (en) * | 2011-10-31 | 2012-04-04 | 深圳中兴力维技术有限公司 | Managing method and system of key value data |
CN104683422A (en) * | 2013-12-03 | 2015-06-03 | 腾讯科技(深圳)有限公司 | Method and device for transmitting data |
CN105141672A (en) * | 2015-08-03 | 2015-12-09 | 广州神马移动信息科技有限公司 | Method, device and system for data storage |
Also Published As
Publication number | Publication date |
---|---|
CN106528844A (en) | 2017-03-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106528844B (en) | A kind of data request method and device and data-storage system | |
US10506043B2 (en) | Rapid client-side component processing based on component relationships | |
CN107004013A (en) | System and method for providing distributed tree traversal using hardware based processing | |
EP2904737B1 (en) | Consistency-based service-level agreements in cloud storage environments | |
CN108153757A (en) | A kind of method and apparatus of Hash table management | |
WO2022121538A1 (en) | Data synchronization method and system based on blockchain, and related device | |
JP2016040724A (en) | Data synchronization | |
US20140025723A1 (en) | Cloud storage system and data storage and sharing method based on the system | |
CN110325985A (en) | The method efficiently inquired based on major key read using the atom RDMA of hash index in the memory to cache close friend | |
US10594804B2 (en) | Directory service discovery and/or learning | |
US20200379966A1 (en) | Method and system for implementing a decentralized storage pool for autonomous vehicle navigation guidance information | |
CN103873602A (en) | Network resource naming method and generating device | |
CN108268524A (en) | Database aggregation processing method and device | |
CN109521962A (en) | A kind of metadata query method, apparatus, equipment and computer readable storage medium | |
CN110046062A (en) | Distributed data processing method and system | |
US20180321706A1 (en) | Timestamp Alignment Across a Plurality Of Computing Devices | |
CN105843867A (en) | Metadata model-based search method and search device based on metadata model | |
CN105045536B (en) | A kind of method, apparatus and system of data storage | |
CN109739684A (en) | The copy restorative procedure and device of distributed key value database based on vector clock | |
WO2016101759A1 (en) | Data routing method, data management device and distributed storage system | |
CN103139314B (en) | Based on distributed Web services discover method and the system thereof of P2P | |
WO2022057525A1 (en) | Method and device for data retrieval, electronic device, and storage medium | |
JP2012252705A (en) | Communication method and device for content requestor and content respondent in network based on hierarchical name structure | |
CN108540583A (en) | Domain name delivery method and device in a kind of CDN system, electronic equipment | |
CN108920631A (en) | A kind of file polling method, apparatus, equipment and readable storage medium storing program for executing |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |