CN103581122B - Wiring method, system and the device of data - Google Patents

Wiring method, system and the device of data Download PDF

Info

Publication number
CN103581122B
CN103581122B CN201210259170.2A CN201210259170A CN103581122B CN 103581122 B CN103581122 B CN 103581122B CN 201210259170 A CN201210259170 A CN 201210259170A CN 103581122 B CN103581122 B CN 103581122B
Authority
CN
China
Prior art keywords
file
sequence number
client
data
write
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
CN201210259170.2A
Other languages
Chinese (zh)
Other versions
CN103581122A (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.)
Tencent Technology Shenzhen Co Ltd
Tencent Cloud Computing Beijing Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201210259170.2A priority Critical patent/CN103581122B/en
Publication of CN103581122A publication Critical patent/CN103581122A/en
Application granted granted Critical
Publication of CN103581122B publication Critical patent/CN103581122B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Abstract

The embodiment of the invention discloses a kind of wiring method of data, system and device, pass through the technical scheme of the application embodiment of the present invention, when client writes data in the file to data storage server, by carrying sequence number corresponding to this document itself being assigned to, in a manner of the sequence number by preemptive type, to ensure, only a client writes data into file, so as to ensure data safety;And compared with existing lease administrative mechanism, the load of server is alleviated, the performance of system is improved, and faster response speed can be obtained, it is very short to recover delay.

Description

Wiring method, system and the device of data
Technical field
The present invention relates to communication technical field, the more particularly to a kind of wiring method of data, system and device.
Background technology
In HDFS(Hadoop Distributed File System, the distributed file system increased income)In, it may go out Existing multiple client writes the situation of data into a file simultaneously, is this:In the prior art by using the mode of lease Multiple client is avoided to write data into a file simultaneously.
Specifically, when needing to write data into file, one lease of client request, and in the time of the lease The client is only allowed to write data into this document in time limit, without allowing other clients to write data into this document; When lease is expired, the client can be renewed a contract, to renew the lease;When the client need not write number into this document According to when then retract lease, now another client can seize the lease of this document, so as to allow other clients to Data are write in this document.
During the embodiment of the present invention is realized, inventor has found that prior art at least has problems with:
It in existing lease administrative mechanism, can frequently renew the lease, metamessage server is exerted heavy pressures on, member letter The overload of server is ceased, and systematic function is than relatively low;In addition, it is necessary to wait lease mistake after client breaks down Phase could continue to write data into file, and it is very big to recover delay.
The content of the invention
The embodiment of the present invention provides a kind of wiring method of data, system and device, solves the lease management of prior art The problems such as in mechanism, server load is overweight, systematic function is bigger than relatively low and recovery delay.
To reach above-mentioned purpose, on the one hand the embodiment of the present invention provides a kind of wiring method of data, methods described tool Body includes:
When client needs to write data into file, the client provides server to position and sent for asking First request message of the document location;
The position provides server after first request message is received, and determines corresponding to the file recently Allocated First ray number, and the second sequence number corresponding to the file is distributed, second sequence number is more than described first Sequence number or second sequence number are less than the First ray number;And by the positional information of the file and described Two sequence numbers are sent to the client;
The client sends the second request for asking the write-in data into the file to data storage server Message, and second sequence number is carried in second request message;
The data storage server is determined after second request message is received using second sequence number The client is allowed to write data or the refusal client profit into the file using the positional information of the file With the positional information of the file data are write into the file.
The data storage server determines to allow the client using the file using second sequence number Positional information writes data or the refusal client into the file using the positional information of the file to the text Data are write in part, are specifically included:
The data storage server is obtained assigned by nearest one client that data are write into the file 3rd sequence number corresponding to the file, and the magnitude relationship between second sequence number and the 3rd sequence number;
When second sequence number is more than the First ray, if second sequence number is more than or equal to described the Three sequence numbers, then the data storage server allow the client using the positional information of the file into the file Write data;If second sequence number is less than the 3rd sequence number, the data storage server refuses the visitor Family end writes data using the positional information of the file into the file;
When second sequence number is less than the First ray, if second sequence number is less than or equal to described the Three sequence numbers, then the data storage server allow the client using the positional information of the file into the file Write data;If second sequence number is more than the 3rd sequence number, the data storage server refuses the visitor Family end writes data using the positional information of the file into the file.
This method further comprises:It is the sequence number that each file record is allocated recently that the position, which provides server,;
After first request message is received, the position provides server and determined by the information of self record First ray number allocated recently corresponding to the file, and the First ray number allocated recently is incremented by or passed Subtract, obtain the second currently allocated sequence number of the file;
After second sequence number is sent into the client, the position is provided second described in server record Sequence number allocated recently corresponding to file described in Serial No..
This method further comprises:When multiple data storage servers store the file simultaneously, the client profit Data are write with the positional information of the file thereto file of a data storage server, by the data storage Server writes data into the file of other data storage servers;
When other data storage servers write hereof data success after, other described data storage servers to The data storage server sends write-in successfully response, and as assigned by the data storage server by the client Sequence number corresponding to the file is sent to the position and provides server;
Corresponding to the sequence number and the file of self record that the position offer server relatively receives recently Allocated sequence number;If the two is identical, confirm that the client data writes successfully;If the two is different, confirm The client data write-in failure.
On the other hand, the embodiment of the present invention additionally provides a kind of writing system of data, and the system specifically includes:
Client, for when needing to write data into file, being sent to position offer server described for asking First request message of document location;And
After the positional information of the file and the second sequence number is received, sent to data storage server for asking The second request message that data are write into the file is sought, and second sequence number is carried in second request message;
Position provides server, for after first request message is received, determining corresponding to the file most Closely allocated First ray number, and distribute the second sequence number corresponding to the file, second sequence number are more than described the One sequence number or second sequence number are less than the First ray number;And by the positional information of the file and described Second sequence number is sent to the client;
Data storage server, it is true using second sequence number for after second request message is received Surely the client is allowed to write data or the refusal client into the file using the positional information of the file Using the positional information of the file data are write into the file.
The data storage server, the client institute specifically for obtaining the nearest one write-in data into the file 3rd sequence number corresponding to the file being assigned to, and it is big between second sequence number and the 3rd sequence number Small relation;
When second sequence number is more than the First ray, if second sequence number is more than or equal to described the Three sequence numbers, then the client is allowed to write data into the file using the positional information of the file;It is if described Second sequence number is less than the 3rd sequence number, then refuses the client using the positional information of the file to the file Middle write-in data;
When second sequence number is less than the First ray, if second sequence number is less than or equal to described the Three sequence numbers, then the client is allowed to write data into the file using the positional information of the file;It is if described Second sequence number is more than the 3rd sequence number, then refuses the client using the positional information of the file to the file Middle write-in data.
On the other hand, the embodiment of the present invention additionally provides a kind of client, and the client specifically includes:
First sending module, for when needing to write data into file, providing server to position and sending for asking Seek the first request message of the document location;
Receiving module, for providing the first sequence allocated recently corresponding to file described in server by utilizing in the position Row number is distributed after the second sequence number corresponding to the file, receives the position that the position provides the file that server returns Confidence ceases and second sequence number;
Second sending module, for being sent to data storage server for asking to write the of data into the file Two request messages, and second sequence number is carried in second request message;
Determine that the permission client utilizes the file using second sequence number by the data storage server Positional information data or the refusal client are write into the file using the positional information of the file to described Data are write in file.
On the other hand, the embodiment of the present invention additionally provides a kind of position and provides server, and the position provides service utensil Body includes:
Receiving module, for when client needs to write data into file, receiving and being used for from the client Ask the first request message of the document location;
Processing module, for after first request message is received, determining recently to be divided corresponding to the file The First ray number matched somebody with somebody, and the second sequence number corresponding to the file is distributed, second sequence number is more than the First ray Number or second sequence number be less than the First ray number;
Sending module, for the positional information of the file and second sequence number to be sent into the client, by The client sends carrying second sequence for asking the write-in data into the file to data storage server Number the second request message, and determined using second sequence number by the data storage server to allow client profit Data are write into the file or the refusal client utilizes the position of the file with the positional information of the file Information writes data into the file.
The processing module, it is further used for the sequence number being allocated recently for each file record;
After first request message is received, determined by the information of self record corresponding to the file recently Allocated First ray number, and by the First ray increasing or decreasing allocated recently, it is current to obtain the file The second allocated sequence number;
After second sequence number is sent into the client, file pair described in second Serial No. is recorded The sequence number allocated recently answered.
On the other hand, the embodiment of the present invention additionally provides a kind of data storage server, the data storage server tool Body includes:
Receiving module, for when client needs to write data into file, receiving and being used for from the client The second request message of the write-in data into the file is asked, and the second sequence number is carried in second request message;Its In, the second Serial No. position provides server and is receiving be used to ask the document location the of the client After one request message, corresponding to the file that is distributed using First ray number allocated recently corresponding to the file Second sequence number, second sequence number is more than the First ray number or second sequence number is less than the First ray Number;
Processing module, for after second request message is received, determining to allow using second sequence number Data are write into the file using the positional information of the file for the client or the refusal client utilizes institute The positional information for stating file writes data into the file.
The processing module, specifically for obtaining assigned by the client of the nearest one write-in data into the file The file corresponding to the 3rd sequence number, and size between second sequence number and the 3rd sequence number is closed System;
When second sequence number is more than the First ray, if second sequence number is more than or equal to described the Three sequence numbers, then the client is allowed to write data into the file using the positional information of the file;It is if described Second sequence number is less than the 3rd sequence number, then refuses the client using the positional information of the file to the file Middle write-in data;
When second sequence number is less than the First ray, if second sequence number is less than or equal to described the Three sequence numbers, then the client is allowed to write data into the file using the positional information of the file;It is if described Second sequence number is more than the 3rd sequence number, then refuses the client using the positional information of the file to the file Middle write-in data.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, client writes number in the file to data storage server According to when, by carrying sequence number corresponding to this document itself being assigned to, in a manner of the sequence number by preemptive type, to ensure Only a client writes data into file, so as to ensure data safety;And compared with existing lease administrative mechanism, The load of server is alleviated, improves the performance of system, and faster response speed can be obtained, it is very short to recover delay.
Brief description of the drawings
Fig. 1 is a kind of schematic flow sheet of the wiring method for data that the embodiment of the present invention proposes;
Fig. 2 is illustrated by a kind of flow of the wiring method of the data proposed under the concrete application scene of the embodiment of the present invention Figure;
Fig. 3 is a kind of structural representation for client that the embodiment of the present invention proposes;
Fig. 4 provides the structural representation of server for a kind of position that the embodiment of the present invention proposes;
Fig. 5 is a kind of structural representation for data storage server that the embodiment of the present invention proposes.
Embodiment
In existing lease administrative mechanism, due to can frequently renew the lease, and needed after client breaks down Wait lease is expired could continue to write data into file, therefore, can there is overload, the system of metamessage server Performance comparision it is low, recover delay it is very big the problems such as.
In order to overcome the defects of such, the embodiment of the present invention proposes a kind of wiring method of data, system and device, with Ensure that only a client writes data into file by way of the sequence number of preemptive type, so as to ensure data peace Entirely;And compared with existing lease administrative mechanism, the load of server is alleviated, the performance of system is improved, and can obtain To faster response speed, it is very short to recover delay.
As shown in figure 1, a kind of schematic flow sheet of the wiring method of the data proposed for the embodiment of the present invention, this method tool Body comprises the following steps:
Step S101, when client needs to write data into file, the client provides server to position and sent For asking the first request message of this document position.
Step S102, position provides server after the first request message is received, and determines corresponding to this document recently Allocated First ray number, and distribute the second sequence number corresponding to this document;Wherein, second sequence number is more than First ray Number or second sequence number be less than First ray number;Specifically, according to different allocation strategies, obtain First ray number it Afterwards, can be using the bigger value of distribution ratio First ray number as the second sequence number;Or can be with the smaller value of distribution ratio First ray number For the second sequence number.
In the embodiment of the present invention, the sequence that it is allocated recently for each file record is needed in providing server in position Number;After the first request message is received, the position provides server can determine this document by the information of self record Corresponding sequence number allocated recently(For convenience of description, by taking First ray number as an example), and first that this is allocated recently Sequence number is incremented by or successively decreased, to obtain the sequence number that this document is currently allocated(For convenience of description, with the second sequence number Exemplified by);Further, the position provides server and also needs to record what is be allocated recently corresponding to the second Serial No. this document Sequence number.
For example, position provides the Serial No. 100 that server record file 1 is allocated recently, the pin of client 1 is being received After the first request message of file 1, Serial No. 100 allocated recently corresponding to file 1, and assigned sequence number are determined 101, and record 101 is sequence number allocated recently corresponding to file 1;Afterwards if receive client 2 is directed to file 1 The first request message, determine corresponding to file 1 Serial No. 101 allocated recently, and assigned sequence number 102, Yi Jiji Record 102 is sequence number allocated recently corresponding to file 1;Or receiving the first request for file 1 of client 1 After message, Serial No. 100 allocated recently corresponding to file 1, and assigned sequence number 99 are determined, and record 99 is file Sequence number allocated recently corresponding to 1;Afterwards if the first request message for file 1 of client 2 is received, it is determined that literary Serial No. 99 allocated recently corresponding to part 1, and assigned sequence number 98, and record 98 are quilt recently corresponding to file 1 The sequence number of distribution.
Step S103, position provides server by the positional information of this document and the second sequence number(That currently distributes should Second sequence number corresponding to file)It is sent to client.
Step S104, client is sent for asking second of the write-in data into this document to ask to data storage server Message is sought, and the second sequence number is carried in second request message.
Step S105, data storage server is after the second request message is received, using being taken in the second request message Second sequence number of band determines to allow client to write data or refusal visitor into this document using the positional information of this document Family end writes data into this document using the positional information of this document.
Specifically, in this step, data storage server obtains nearest one client that data are write into this document 3rd sequence number corresponding to assigned this document, and compare the magnitude relationship between the second sequence number and the 3rd sequence number; When the second sequence number is more than First ray, if the second sequence number is more than or equal to the 3rd sequence number, data storage service Device allows client to write data into this document using the positional information of this document;If the second sequence number is less than the 3rd sequence Number, then data storage server refusal client writes data into this document using the positional information of this document;In the second sequence When row number is less than First ray, if the second sequence number is less than or equal to the 3rd sequence number, data storage server allows visitor Family end writes data into this document using the positional information of this document;If the second sequence number is more than the 3rd sequence number, count Data are write into this document using the positional information of this document according to storage server refusal client.
In the embodiment of the present invention, when having multiple data storage servers while storing this document, then the client may be used also Only to write data in the file of a data storage server thereto using the positional information of file, and by the data storage Server writes data into the file of other data storage servers;In the case, when other data storage servers exist Write in file after data success, other data storage servers are also needed to send to the data storage server and write successfully Response message, and sequence number corresponding to this document as assigned by the data storage server by client be sent to it is above-mentioned Position provides server;Afterwards, the sequence number and this document pair of self record that offer server in the position relatively receives The sequence number allocated recently answered;If the two is identical, it can confirm that client data writes successfully;If the two is not Together, then it can confirm that client data write-in failure.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, client writes number in the file to data storage server According to when, by carrying sequence number corresponding to this document itself being assigned to, in a manner of the sequence number by preemptive type, to ensure Only a client writes data into file, so as to ensure data safety;And compared with existing lease administrative mechanism, The load of server is alleviated, improves the performance of system, and faster response speed can be obtained, it is very short to recover delay.
With reference to specific application scenarios, the technical scheme proposed to the embodiment of the present invention illustrates.
Under this application scene, the wiring method of the data is applied may be simultaneously to data storage server in multiple client Same file in write data scene, the scene includes but is not limited to the distributed file system HDFS to increase income, with this Subsequently illustrated exemplified by HDFS scenes, it can be metamessage server that above-mentioned position, which provides server,(MetaServer), on It can be node server to state data storage server(NodeServer);And positions of the MetaServer for providing file Information, the NodeServer is used to store associated documents, and allows client to write data into each file.
, it is necessary to each one sequence number of file record in MetaServer in the embodiment of the present invention, needed in client When data are write into file, by the sequence number increments corresponding to this document recorded in MetaServer(Or successively decrease), and It will be incremented by(Or successively decrease)Sequence number afterwards returns to client;Afterwards, client needs to take when writing data into this document This sequence number, and NodeServer client need into this document write data when, it is necessary to verify from client Sequence number, to allow the client to write data into this document or refuse the client to write data into this document.
If for example, there is two clients to write data into a file simultaneously, customer end A has obtained a sequence number A, customer end B have obtained a sequence number B;When returning to incremental sequence number to client, if sequence number B is more than sequence number A, then customer end B data can be write into this document, customer end A can not write data into this document;Returned to client During the sequence number that dragover subtracts, if sequence number B is more than sequence number A, customer end A can write data, client into this document End B can not write data into this document;So as to ensure that only a client can write data into this document.
Under the application scenarios, as shown in Fig. 2 the flow of the wiring method of the data comprises the following steps:
Step S201, client are sent for asking this article when needing to write data into file to MetaServer The request message of part position.
Under HDFS scenes, client can be by Master(Main equipment)Send the request that data are write into file (The logical path information of this document can be carried in the request), to obtain the file identification of Master returns(file id); Afterwards, client sends request message for asking this document position to MetaServer, and is carried in the request message This document identifies.
Step S202, MetaServer determine the positional information of this document using this document mark, and utilize this document pair The sequence number allocated recently answered distributes current sequence number corresponding to this document.
In one embodiment, the bigger Serial No. this document of the sequence number that can be allocated recently with distribution ratio is corresponding Current sequence number;In another embodiment, the smaller Serial No. of the sequence number that can be allocated recently with distribution ratio should Current sequence number corresponding to file.For convenience of explanation, the bigger sequence number of the sequence number that is subsequently allocated recently with distribution ratio Exemplified by current sequence number corresponding to this document.
The positional information of this document and current sequence number are sent to client by step S203, MetaServer.
Step S204, client send the request message for asking the write-in data into this document to NodeServer, And the current sequence number is carried in the request message.
Step S205, NodeServer determine to allow client after the request message is received using the current sequence number Data are write into this document using the positional information of this document or refuse client using this document positional information to this Data are write in file, specific data writing process will not be repeated here.
Specifically, NodeServer obtains this article assigned by nearest one client that data are write into this document Sequence number corresponding to part, and compare the magnitude relationship between current sequence number and the sequence number of the acquisition;If the former be more than etc. In the latter, then client is allowed to write data into this document using the positional information of this document;If the former is less than the latter, Refusal client writes data into this document using the positional information of this document.
In the embodiment of the present invention, when having multiple NodeServer while storing this document, then the client can use Streamline mechanism, only writes data in the file of a NodeServer thereto, and from the NodeServer to other Data are write in NodeServer file;After other NodeServer write data success hereof, to this NodeServer, which is sent, writes successful response message, and this document as assigned by the NodeServer by client is corresponding Sequence number, write the size of data and verification and wait information to be sent to MetaServer;Reception is compared by MetaServer Sequence number allocated recently corresponding to the sequence number and this document of self record arrived;, can be true if the two is identical Recognize client data to write successfully;If the two is different, client data write-in failure can confirm that.
Further, if it is confirmed that client data writes successfully, then the MetaServer can also thereto one NodeServer returns to client data and writes successful information, and returns to the write-in of its data from the NodeServer to client Successful information, so as to complete data writing process.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, client writes data in the file to NodeServer When, by carrying sequence number corresponding to this document itself being assigned to, in a manner of the sequence number by preemptive type, to ensure only There is a client to write data into file, so as to ensure data safety;And compared with existing lease administrative mechanism, subtract Light MetaServer load, improves the performance of system, and can obtain faster response speed, recovers delay very It is short.
Based on the inventive concept same with the above method, the embodiment of the present invention additionally provides a kind of writing system of data, The system specifically includes:
Client, for when needing to write data into file, being sent to position offer server described for asking First request message of document location;And after the positional information of the file and the second sequence number is received, to data Storage server sends the second request message for asking the write-in data into the file, and in second request message Carry second sequence number;
Position provides server, for after first request message is received, determining corresponding to the file most Closely allocated First ray number, and distribute the second sequence number corresponding to the file, second sequence number are more than described the One sequence number or second sequence number are less than the First ray number;And by the positional information of the file and described Second sequence number is sent to the client;
Data storage server, it is true using second sequence number for after second request message is received Surely the client is allowed to write data or the refusal client into the file using the positional information of the file Using the positional information of the file data are write into the file.
Further, the data storage server, data are write into the file specifically for obtaining nearest one Client assigned by the file corresponding to the 3rd sequence number, and second sequence number and the 3rd sequence Magnitude relationship between number;
When second sequence number is more than the First ray, if second sequence number is more than or equal to described the Three sequence numbers, then the client is allowed to write data into the file using the positional information of the file;It is if described Second sequence number is less than the 3rd sequence number, then refuses the client using the positional information of the file to the file Middle write-in data;
When second sequence number is less than the First ray, if second sequence number is less than or equal to described the Three sequence numbers, then the client is allowed to write data into the file using the positional information of the file;It is if described Second sequence number is more than the 3rd sequence number, then refuses the client using the positional information of the file to the file Middle write-in data.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, client writes number in the file to data storage server According to when, by carrying sequence number corresponding to this document itself being assigned to, in a manner of the sequence number by preemptive type, to ensure Only a client writes data into file, so as to ensure data safety;And compared with existing lease administrative mechanism, The load of server is alleviated, improves the performance of system, and faster response speed can be obtained, it is very short to recover delay.
Based on the inventive concept same with the above method, the embodiment of the present invention additionally provides a kind of client, specific knot Structure schematic diagram is as shown in figure 3, the client specifically includes:
First sending module 31, it is used for for when needing to write data into file, providing server to position and sending Ask the first request message of the document location;
Receiving module 32, for providing be allocated recently corresponding to file described in server by utilizing first in the position Sequence number is distributed after the second sequence number corresponding to the file, is received the position and is provided the file that server returns Positional information and second sequence number;
Second sending module 33, for being sent to data storage server for asking to write data into the file Second request message, and second sequence number is carried in second request message;
Determine that the permission client utilizes the file using second sequence number by the data storage server Positional information data or the refusal client are write into the file using the positional information of the file to described Data are write in file.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, client writes number in the file to data storage server According to when, by carrying sequence number corresponding to this document itself being assigned to, in a manner of the sequence number by preemptive type, to ensure Only a client writes data into file, so as to ensure data safety;And compared with existing lease administrative mechanism, The load of server is alleviated, improves the performance of system, and faster response speed can be obtained, it is very short to recover delay.
Based on the inventive concept same with the above method, the embodiment of the present invention additionally provides a kind of position and provides server, Specific structural representation is as shown in figure 4, position offer server specifically includes:
Receiving module 41, for when client needs to write data into file, receiving the use from the client In the first request message for asking the document location;
Processing module 42, for after first request message is received, determining corresponding to the file quilt recently The First ray number of distribution, and the second sequence number corresponding to the file is distributed, second sequence number is more than first sequence Row number or second sequence number are less than the First ray number;
Sending module 43, for the positional information of the file and second sequence number to be sent into the client, Carrying second sequence for asking the write-in data into the file is sent from the client to data storage server Second request message of row number, the permission client profit is determined using second sequence number by the data storage server Data are write into the file or the refusal client utilizes the position of the file with the positional information of the file Information writes data into the file.
The processing module 42, it is further used for the sequence number being allocated recently for each file record;
After first request message is received, determined by the information of self record corresponding to the file recently Allocated First ray number, and by the First ray increasing or decreasing allocated recently, it is current to obtain the file The second allocated sequence number;
After second sequence number is sent into the client, file pair described in second Serial No. is recorded The sequence number allocated recently answered.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, client writes number in the file to data storage server According to when, by carrying sequence number corresponding to this document itself being assigned to, in a manner of the sequence number by preemptive type, to ensure Only a client writes data into file, so as to ensure data safety;And compared with existing lease administrative mechanism, The load of server is alleviated, improves the performance of system, and faster response speed can be obtained, it is very short to recover delay.
Based on the inventive concept same with the above method, the embodiment of the present invention additionally provides a kind of data storage server, Specific structural representation is as shown in figure 5, the data storage server specifically includes:
Receiving module 51, for when client needs to write data into file, receiving the use from the client The second request message of data is write into the file in request, and the second sequence number is carried in second request message; Wherein, the second Serial No. position provide server receive the client be used for ask the document location After first request message, the file distributed using First ray number allocated recently corresponding to the file is corresponding The second sequence number, second sequence number is more than the First ray number or second sequence number and is less than first sequence Row number;
Processing module 52, for after second request message is received, determining to permit using second sequence number Perhaps data are write into the file using the positional information of the file for described client or the refusal client utilizes The positional information of the file writes data into the file.
The processing module 52, distributed specifically for the client for obtaining the nearest one write-in data into the file 3rd sequence number corresponding to the file arrived, and the size between second sequence number and the 3rd sequence number is closed System;
When second sequence number is more than the First ray, if second sequence number is more than or equal to described the Three sequence numbers, then the client is allowed to write data into the file using the positional information of the file;It is if described Second sequence number is less than the 3rd sequence number, then refuses the client using the positional information of the file to the file Middle write-in data;
When second sequence number is less than the First ray, if second sequence number is less than or equal to described the Three sequence numbers, then the client is allowed to write data into the file using the positional information of the file;It is if described Second sequence number is more than the 3rd sequence number, then refuses the client using the positional information of the file to the file Middle write-in data.
Compared with prior art, the embodiment of the present invention has advantages below:
By the technical scheme of the application embodiment of the present invention, client writes number in the file to data storage server According to when, by carrying sequence number corresponding to this document itself being assigned to, in a manner of the sequence number by preemptive type, to ensure Only a client writes data into file, so as to ensure data safety;And compared with existing lease administrative mechanism, The load of server is alleviated, improves the performance of system, and faster response speed can be obtained, it is very short to recover delay.
Through the above description of the embodiments, those skilled in the art can be understood that the embodiment of the present invention It can be realized by hardware, the mode of necessary general hardware platform can also be added by software to realize.Based on such reason Solution, the technical scheme of the embodiment of the present invention can be embodied in the form of software product, and the software product can be stored in one Individual non-volatile memory medium(Can be CD-ROM, USB flash disk, mobile hard disk etc.)In, including some instructions to cause one meter Calculate machine equipment(Can be personal computer, server, or network equipment etc.)Perform each implement scene institute of the embodiment of the present invention The method stated.
It will be appreciated by those skilled in the art that accompanying drawing is a schematic diagram for being preferable to carry out scene, module in accompanying drawing or Flow is not necessarily implemented necessary to the embodiment of the present invention.
It will be appreciated by those skilled in the art that the module in device in implement scene can be described according to implement scene into Row is distributed in the device of implement scene, can also carry out one or more dresses that respective change is disposed other than this implement scene In putting.The module of above-mentioned implement scene can be merged into a module, can also be further split into multiple submodule.
The embodiments of the present invention are for illustration only, do not represent the quality of implement scene.
Disclosed above is only several specific implementation scenes of the embodiment of the present invention, and still, the embodiment of the present invention is not office It is limited to this, the changes that any person skilled in the art can think of should all fall into the business limitation scope of the embodiment of the present invention.

Claims (8)

1. a kind of wiring method of data, it is characterised in that methods described specifically includes:
When client needs to write data into file, the client sends described for asking to position offer server First request message of document location;
The position provides server after first request message is received, and determines recently to be divided corresponding to the file The First ray number matched somebody with somebody, and the second sequence number corresponding to the file is distributed, second sequence number is more than the First ray Number or second sequence number be less than the First ray number;And by the positional information of the file and second sequence Row number is sent to the client;
The client sends the second request message for asking the write-in data into the file to data storage server, And second sequence number is carried in second request message;
The data storage server obtains nearest one and write into the file after second request message is received Enter the 3rd sequence number corresponding to the file assigned by the client of data, and second sequence number and described the Magnitude relationship between three sequence numbers;
When second sequence number is more than the First ray, if second sequence number is more than or equal to the 3rd sequence Row number, then the data storage server allow the client to be write using the positional information of the file into the file Data;If second sequence number is less than the 3rd sequence number, the data storage server refuses the client Using the positional information of the file data are write into the file;
When second sequence number is less than the First ray, if second sequence number is less than or equal to the 3rd sequence Row number, then the data storage server allow the client to be write using the positional information of the file into the file Data;If second sequence number is more than the 3rd sequence number, the data storage server refuses the client Using the positional information of the file data are write into the file.
2. the method as described in claim 1, it is characterised in that this method further comprises:
It is the sequence number that each file record is allocated recently that the position, which provides server,;
After first request message is received, the position provides server and passed through described in the information determination of self record First ray number allocated recently corresponding to file, and by the First ray increasing or decreasing allocated recently, obtain Second sequence number currently allocated to the file;
After second sequence number is sent into the client, the position provides the second sequence described in server record Number for sequence number allocated recently corresponding to the file.
3. method as claimed in claim 2, it is characterised in that this method further comprises:
When multiple data storage servers simultaneously store the file when, the client using the file positional information to Write data in the file of one of data storage server, and from the data storage server to other data storages Data are write in the file of server;
After other data storage servers write data success hereof, other described data storage servers are to the number Write-in successfully response, and described in as assigned by the data storage server by the client is sent according to storage server Sequence number corresponding to file is sent to the position and provides server;
Divided recently corresponding to the sequence number and the file of self record that the position offer server relatively receives The sequence number matched somebody with somebody;If the two is identical, confirm that the client data writes successfully;If the two is different, described in confirmation Client data write-in failure.
4. a kind of writing system of data, it is characterised in that the system specifically includes:
Client, for when needing to write data into file, providing server to position and sending for asking the file First request message of position;And
After the positional information of the file and the second sequence number is received, to data storage server send for ask to The second request message of data is write in the file, and second sequence number is carried in second request message;
Position provides server, for after first request message is received, determining corresponding to the file quilt recently The First ray number of distribution, and the second sequence number corresponding to the file is distributed, second sequence number is more than first sequence Row number or second sequence number are less than the First ray number;And by the positional information of the file and described second Sequence number is sent to the client;
Data storage server, for after second request message is received, obtaining nearest one into the file Write data client assigned by the file corresponding to the 3rd sequence number, and second sequence number with it is described Magnitude relationship between 3rd sequence number;
When second sequence number is more than the First ray, if second sequence number is more than or equal to the 3rd sequence Row number, then the client is allowed to write data into the file using the positional information of the file;If described second Sequence number is less than the 3rd sequence number, then refuses the client and write using the positional information of the file into the file Enter data;
When second sequence number is less than the First ray, if second sequence number is less than or equal to the 3rd sequence Row number, then the client is allowed to write data into the file using the positional information of the file;If described second Sequence number is more than the 3rd sequence number, then refuses the client and write using the positional information of the file into the file Enter data.
5. a kind of client, it is characterised in that the client specifically includes:
First sending module, for when needing to write data into file, providing server to position and sending for asking institute State the first request message of document location;
Receiving module, for providing First ray number allocated recently corresponding to file described in server by utilizing in the position Distribute after the second sequence number corresponding to the file, receive the position letter that the position provides the file that server returns Breath and second sequence number;
Second sending module, for being sent to data storage server for asking second of the write-in data into the file to ask Message is sought, and second sequence number is carried in second request message;
The position for determining to allow the client to utilize the file using second sequence number by the data storage server Confidence ceases data or the refusal client are write into the file using the file positional information to the file Middle write-in data.
6. a kind of position provides server, it is characterised in that the position provides server and specifically included:
Receiving module, for when client needs to write data into file, receiving and being used to ask from the client First request message of the document location;
Processing module, for after first request message is received, determining what is be allocated recently corresponding to the file First ray number, and distribute the second sequence number corresponding to the file, second sequence number be more than the First ray number or Second sequence number described in person is less than the First ray number;
Sending module, for the positional information of the file and second sequence number to be sent into the client, by described Client sends carrying second sequence number for asking the write-in data into the file to data storage server Second request message, and determine that the permission client utilizes institute using second sequence number by the data storage server The positional information for stating file writes the positional information of data or the refusal client using the file into the file Data are write into the file.
7. position as claimed in claim 6 provides server, it is characterised in that
The processing module, it is further used for the sequence number being allocated recently for each file record;
After first request message is received, determine recently to be divided corresponding to the file by the information of self record The First ray number matched somebody with somebody, and by the First ray increasing or decreasing allocated recently, obtain the file and currently divided The second sequence number matched somebody with somebody;
After second sequence number is sent into the client, record corresponding to file described in second Serial No. Allocated sequence number recently.
8. a kind of data storage server, it is characterised in that the data storage server specifically includes:
Receiving module, for when client needs to write data into file, receiving and being used to ask from the client The second request message of data is write into the file, and the second sequence number is carried in second request message;Wherein, institute Stating the second Serial No. position offer server please in first for asking the document location for receiving the client After seeking message, second corresponding to the file that is distributed using First ray number allocated recently corresponding to the file Sequence number, second sequence number is more than the First ray number or second sequence number is less than the First ray number;
Processing module, for after second request message is received, obtaining nearest one and writing number into the file According to client assigned by the file corresponding to the 3rd sequence number, and second sequence number and the 3rd sequence Magnitude relationship between row number;
When second sequence number is more than the First ray, if second sequence number is more than or equal to the 3rd sequence Row number, then the client is allowed to write data into the file using the positional information of the file;If described second Sequence number is less than the 3rd sequence number, then refuses the client and write using the positional information of the file into the file Enter data;
When second sequence number is less than the First ray, if second sequence number is less than or equal to the 3rd sequence Row number, then the client is allowed to write data into the file using the positional information of the file;If described second Sequence number is more than the 3rd sequence number, then refuses the client and write using the positional information of the file into the file Enter data.
CN201210259170.2A 2012-07-25 2012-07-25 Wiring method, system and the device of data Active CN103581122B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210259170.2A CN103581122B (en) 2012-07-25 2012-07-25 Wiring method, system and the device of data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210259170.2A CN103581122B (en) 2012-07-25 2012-07-25 Wiring method, system and the device of data

Publications (2)

Publication Number Publication Date
CN103581122A CN103581122A (en) 2014-02-12
CN103581122B true CN103581122B (en) 2018-01-16

Family

ID=50052060

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210259170.2A Active CN103581122B (en) 2012-07-25 2012-07-25 Wiring method, system and the device of data

Country Status (1)

Country Link
CN (1) CN103581122B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107516048B (en) * 2016-06-16 2021-01-08 阿里巴巴集团控股有限公司 Method and equipment for controlling file access in distributed file system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102307221A (en) * 2011-03-25 2012-01-04 国云科技股份有限公司 Cloud storage system and implementation method thereof
CN102420854A (en) * 2011-11-14 2012-04-18 西安电子科技大学 Distributed file system facing to cloud storage

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7111136B2 (en) * 2003-06-26 2006-09-19 Hitachi, Ltd. Method and apparatus for backup and recovery system using storage based journaling
US20110225120A1 (en) * 2010-03-11 2011-09-15 Yahoo! Inc. System for maintaining a distributed database using leases

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102307221A (en) * 2011-03-25 2012-01-04 国云科技股份有限公司 Cloud storage system and implementation method thereof
CN102420854A (en) * 2011-11-14 2012-04-18 西安电子科技大学 Distributed file system facing to cloud storage

Also Published As

Publication number Publication date
CN103581122A (en) 2014-02-12

Similar Documents

Publication Publication Date Title
CN102413156B (en) Distributed data storage system and method
CN103986694B (en) Control method of multi-replication consistency in distributed computer data storing system
JP6498767B2 (en) System for efficient processing of transaction requests related to database accounts
CN109598598A (en) Transaction processing method and device, electronic equipment based on block chain
US20190287082A1 (en) Method for processing transactions using blockchain networks, and transaction management server using the same
CN102204267A (en) Distributed data storage and access systems
CN107506145B (en) Physical storage scheduling method and cloud host creation method
US11720515B2 (en) Article, device, and techniques for serverless stack for streaming message processing
US9176857B2 (en) Method and apparatus for managing video memory in embedded device
CN104125163A (en) Data processing method, device and terminal
JP6975153B2 (en) Data storage service processing method and equipment
US10346074B2 (en) Method of compressing parity data upon writing
CN103888424A (en) Cluster-type data encryption system and data processing method thereof
CN111427918A (en) Transaction detail data comparison method and device
CN109889561A (en) A kind of data processing method and device
CN108230487A (en) The method and apparatus of shared camera resource
CN103514164A (en) Data migration method and system
CN103581122B (en) Wiring method, system and the device of data
US20080250421A1 (en) Data Processing System And Method
CN105095310A (en) Data processing method, first server, second server and data processing system
CN104850548B (en) A kind of method and system for realizing big data platform input/output processing
CN107395406A (en) The presence data processing method of on-line system, apparatus and system
US10289312B2 (en) Method of reordering a queue of write requests
CN113051152B (en) Task data generation method and device and processing equipment
CN105843807B (en) A kind of data-erasure method, equipment and platform

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
TR01 Transfer of patent right

Effective date of registration: 20190805

Address after: 518000 Nanshan District science and technology zone, Guangdong, Zhejiang Province, science and technology in the Tencent Building on the 1st floor of the 35 layer

Co-patentee after: Tencent cloud computing (Beijing) limited liability company

Patentee after: Tencent Technology (Shenzhen) Co., Ltd.

Address before: Shenzhen Futian District City, Guangdong province 518057 Zhenxing Road, SEG Science Park 2 East Room 403

Patentee before: Tencent Technology (Shenzhen) Co., Ltd.