CN103944972A - Method and gateway for uploading and downloading data - Google Patents

Method and gateway for uploading and downloading data Download PDF

Info

Publication number
CN103944972A
CN103944972A CN201410131955.0A CN201410131955A CN103944972A CN 103944972 A CN103944972 A CN 103944972A CN 201410131955 A CN201410131955 A CN 201410131955A CN 103944972 A CN103944972 A CN 103944972A
Authority
CN
China
Prior art keywords
data
server
client
value
mark
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.)
Pending
Application number
CN201410131955.0A
Other languages
Chinese (zh)
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.)
SHENZHEN ZHONGBO KECHUANG INFORMATION TECHNOLOGY Co Ltd
Original Assignee
SHENZHEN ZHONGBO KECHUANG INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SHENZHEN ZHONGBO KECHUANG INFORMATION TECHNOLOGY Co Ltd filed Critical SHENZHEN ZHONGBO KECHUANG INFORMATION TECHNOLOGY Co Ltd
Priority to CN201410131955.0A priority Critical patent/CN103944972A/en
Publication of CN103944972A publication Critical patent/CN103944972A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and gateway for uploading and downloading data. The method comprises the steps that data uploading instructions transmitted by a client side are received, wherein the data uploading instructions carry marks of data needing to be uploaded by the client side; when data corresponding to the marks are not cached in a cache unit and are not stored in a server, data uploading permission instructions are transmitted to the client side; the data uploaded by the client side according to the data uploading permission instructions are received, and the data are cached. By means of the mode, the bandwidth occupied by the data in the transmission process can be reduced, and the data transmission speed can be improved.

Description

A kind ofly upload, method and the gateway of downloading data
Technical field
The present invention relates to technical field of data processing, particularly relate to a kind ofly upload, method and the gateway of downloading data.
Background technology
Along with the development of Internet technology, there is explosive increase in information data, and increasing user selects by the Internet obtaining information.Information in the Internet is stored in server end conventionally, and user for example, by network access equipment: computer, smart mobile phone etc., from server end obtaining information, and server and network access equipment link together by gateway.
User is by network access equipment during to server request information, informational needs forwards layer by layer through gateway, cross most arrival network access equipment, wherein, user is at every turn to server request information, server all needs the photos and sending messages to user, gateway also needs to forward this information, when simultaneously excessive to the user's of server request information quantity, for server and gateway, will face immense pressure, also high to the requirement of the network bandwidth.
Summary of the invention
The technical problem that the present invention mainly solves is to provide method and the gateway of a kind of data upload, download, can reduce the bandwidth that data take in transmitting procedure, improves data transmission bauds.
For solving the problems of the technologies described above, the technical scheme that the present invention adopts is: a kind of method of uploading data is provided, comprises and receive the data upload instruction that client sends, wherein, the mark of the required data of uploading of client is carried in described data upload instruction; In buffer unit, there is no the data that buffer memory is corresponding with described mark, and in the time that server does not store the data corresponding with described mark, send data upload grant instruction to described client; Receive the data that described client is uploaded according to described data upload grant instruction, and data described in buffer memory.
Wherein, described in be labeled as a MD5 value, a described MD5 is the MD5 value of the required data of uploading of described client; Described do not have data that buffer memory is corresponding with described mark in buffer unit, and in the time that server does not store the data corresponding with described mark, the step that sends data upload grant instruction to described client comprises: first set of obtaining the MD5 value of each data that comprise in buffer unit; In the first set, search the member identical with a MD5 value; If do not find described member; , send a described MD5 to server, so that described server is searched the member identical with a MD5 value in the second set, wherein, described second gathers the set of the MD5 value for comprising each data of storing in server; Receive the message that does not find the member identical with a MD5 value in the second set that described server returns, and send data upload grant instruction to described client.
Wherein, method also comprises: if find the member who matches with a MD5 value in described the first set, or, receive the message that finds the member who matches with a MD5 value in the second set that described server returns, send data upload success message to described client.
Wherein, method also comprises: send the data of described client upload to described server, so that data described in described server stores.
Wherein, method also comprises: the cache-time that obtains each data in buffer unit; Judge whether described cache-time exceedes the threshold values time; If described cache-time exceedes the threshold values time, delete the data that described cache-time is corresponding.
For solving the problems of the technologies described above, another technical solution used in the present invention is: a kind of method that downloading data is provided, comprise: receive the first data download instruction that client sends, and forward described the first data download instruction to described server, wherein, described the first data download instruction is carried the mark of the data of required download; Receive the MD5 value that described server returns according to described mark, wherein, a described MD5 value is for storing at described server, and the MD5 value of the data corresponding with described mark; Search the second data according to described being identified in buffer unit, wherein, described the second data are institute's buffer memory in buffer unit, and the data corresponding with described mark; If find described the second data, obtain the 2nd MD5 value of described the second data; Compare a described MD5 whether identical with the 2nd MD5; If identical, return to described the second data to client.
Wherein, described method also comprises: if a described MD5 is not identical with the 2nd MD5, send prompting message to described client, to point out described in described client the first data and the second data inconsistent.
Wherein, described method also comprises: if while not finding described the second data, send the second data download instruction to described server, wherein, described the second data download instruction sends the first data for request server; Receive the first data that described server sends, and the first data described in buffer memory, and the first data that send to described client.
For solving the problems of the technologies described above, another technical solution used in the present invention is: a kind of gateway is provided, comprises the first receiver module, and the data upload instruction sending for receiving client, wherein, the mark of the required data of uploading is carried in described data upload instruction; The first sending module, for there is no the data that buffer memory is corresponding with described mark at buffer unit, and in the time that server does not store the data corresponding with described mark, sends data upload grant instruction to described client; The second receiver module, the data of uploading according to described data upload grant instruction for receiving described client, and data described in buffer memory.
For solving the problems of the technologies described above, another technical solution used in the present invention is: a kind of gateway is provided, comprise the first receiver module, the the first data download instruction sending for receiving client, and forward described the first data download instruction to described server, wherein, described the first data download instruction is carried the mark of the data of required download; The second receiver module, a MD5 value of returning according to described mark for receiving described server, wherein, a described MD5 value is for storing at described server, and the MD5 value of the data corresponding with described mark; Search module, search the second data for being identified at buffer unit described in basis, wherein, described the second data are institute's buffer memory in buffer unit, and the data corresponding with described mark; Acquisition module, for while finding described the second data, obtaining the 2nd MD5 value of described the second data in the described module of searching; Whether comparing module is identical with the 2nd MD5 for comparing a described MD5; Sending module, when identical, returns to described second data to client with the 2nd MD5 value for compare a described MD5 in described comparing module.
The invention has the beneficial effects as follows: the situation that is different from prior art, the present invention by data buffer storage at gateway, in the time of user end to server request msg, and determine gateway buffer unit and be cached with the data that client is asked, and server stores is while having the data that client asks, gateway directly returns to the data of described request to client, need not server send the data of described request to client, and server sends the data of described request to client, need to pass through gateway forwards, and in the present invention gateway directly to client return data, reduction transfer of data the network path of process, reduce the bandwidth that data take in transmitting procedure, thereby raising data transmission bauds.
Brief description of the drawings
Fig. 1 is data upload of the present invention, download system execution mode structural representation;
Fig. 2 is the structural representation of gateway the first execution mode of the present invention;
Fig. 3 is the structural representation of gateway the second execution mode of the present invention;
Fig. 4 is the method execution mode flow chart of data upload of the present invention;
Fig. 5 is that the method execution mode of data upload of the present invention judges the data flow chart whether identical with the data of buffer memory in buffer unit that server is stored;
Fig. 6 is the method execution mode flow chart that data of the present invention are downloaded.
Embodiment
Below in conjunction with drawings and embodiments, the present invention is described in detail.
Refer to Fig. 1, as shown in the figure, system comprises server 10, gateway 11 and client 12.Server 10 is by gateway 11 and client 12, the quantity of gateway 11 is multiple, and multiple gateways 11 are joined together to form network, when server 10 sends data to client 12, data need gateway 11 to forward, client 12 sends data to server 10, and data also need to forward through gateway 11, wherein, gateway 11 can be router, switch etc., gateway 11 is provided with buffer unit (not shown), and buffer unit is for data cached, and server 10 is for storing data.Client 12 can be the terminal equipment such as computer, smart mobile phone.
When client 12 need to be to server 10 uploading data, client 12 sends data upload instruction to server 10, and wherein, the mark of the required data of uploading of client 12 is carried in data upload instruction.Wherein, when client 12 sends data upload instruction to server 10, gateway 11 receives this data upload instruction prior to server 10.Gateway 11 detects in buffer unit whether be cached with the data that this mark is corresponding, if do not have, gateway 11 sends this mark to server 10.Server 10 receives after mark, detect on server 10 whether store the data corresponding with this mark, if do not have, server 10 issues the message that does not find the data that this mark is corresponding to gateway 11, gateway 11 receives after this message, sends data upload grant instruction to client 12.Client 12 receives after data upload grant instruction, sends these data to gateway 11.Gateway 11 receives after these data, these data of buffer memory in buffer unit, and send these data to server 10, so that server 10 these data of storage.
The mark of the required data of uploading of client 12 of carrying in data upload instruction can be the mark of data, for example: the title of data can be also a MD5 value of these data, and a MD5 is the MD5 value of the required data of uploading of client 12.Client 12, in the time of needs uploading data, is calculated a MD5 value of the required data of uploading according to algorithm, the code that wherein calculates a MD5 value is as follows:
Gateway 11 receives after data upload instruction, resolves this data upload instruction, obtains a MD5 value.Gateway 11 obtains the first set of the MD5 value of each data that comprise in buffer unit, wherein, gateway 11 can receive after a MD5 value, calculate the MD5 value of each data in buffer unit, generate first and gather, also can be gateway 11 and calculate in advance the MD5 value of each data in buffer unit, generate the first set, the MD5 value of data in the corresponding buffer unit of each member in the first set, in embodiment of the present invention, the first set also can be MD5 value table.
Gateway 11 is searched the member of mating with a MD5 value in the first set, if find the member who matches with a MD5 value in the first set, illustrate in buffer unit and be cached with and the required data of uploading of client 12, gateway 11 sends data upload success message to client 12.Certainly, gateway 11 is searched the member of mating with a MD5 value in the first set, also can be sent in the first set and find to server 10 member's who matches with a MD5 value title, make server 10 check that whether the version of the corresponding data of storage on server 10 is consistent with life, if consistent, send data upload success message to client 12; If inconsistent, server 10 sends these data to gateway 11.If do not find the member who matches with a MD5 value in the first set, gateway 11 sends a MD5 value to server 10.
Server 10 receives after a MD5 value, server 10 is searched the member who matches with a MD5 value in the second set, wherein, the second set is for comprising the set of the MD5 value of each data of storage in server 10, and second gathers the MD5 value of data of storing in each member's corresponding server 10.If server 10 finds the member who matches with a MD5 value in the second set, illustrate that server 10 stores the required data of uploading of client 12,10 of servers send to gateway 11 message that finds the member who matches with a MD5 value, gateway 12 receives after this message, sends data upload success message to client 12.If server 10 does not find the member of mating with a MD5 value in the second set, server 10 is sent in the message that does not find the member who matches with a MD5 value in the second set to gateway 11, gateway 11 receives after this message, send data upload grant instruction to client 12, gateway 11 receives the data that client 12 is uploaded according to data upload grant instruction, and these data of buffer memory.Certainly, before the data that gateway 11 returns at reception server 10, whether enough also can detect in buffer unit space, if not enough, clear up the data that spatial cache is useless.
Further, for the consistency of data on the geodata and services device of buffer memory in maintenance buffer unit, gateway 11 is except data cached, also can buffer memory MD5 value and the title corresponding with data, gateway 11 regularly sends MD5 value and the title of the data in buffer unit to server 10, server 10 obtains be stored in data server on corresponding with this title, and obtain the MD5 value of these data, whether the MD5 value that relatively gets MD5 value and calculate matches, if do not match, say that the data of storing on geodata and services device 10 corresponding to this title of buffer memory in buffer unit are inconsistent, these data of server 10 marks, and detecting that network is idle or at setting-up time, send these data to gateway 11, gateway 11 receives after these data, upgrade data corresponding in buffer unit.
Further, when gateway 11 is data cached in buffer unit, can be set the corresponding threshold values time of these data, the threshold values time is the time of data buffer storage in buffer unit.Gateway 11 regularly obtains the cache-time of each data in buffer unit, and judges whether cache-time exceedes the threshold values time, if cache-time exceedes the threshold values time, deletes the data that cache-time is corresponding.Wherein, the business of the size that the threshold values time is data and the spatial cache of buffer unit, then it is long-pending to be multiplied by buffer memory total time, for example: buffer memory total time is 30 days, when spatial cache size is 1G, the threshold values time of the data that size is 500M is 15 days.The threshold values time of data also can be according to the access frequency of data, work changes, for example: access frequency is higher, the threshold values time increases, wherein, the variation of determining access frequency is to contrast according to the access frequency of average access frequency and individual data, average access frequency=((the access times * data n2 size of data n1)+(the access times * n2 size of data of data n3)+... ... ...) quantity of the little * data of/spatial cache, unit data access frequency=data access number of times * size of data/spatial cache, in the time that a unit data access frequency is greater than average access frequency, the threshold values time increases, and cache-time corresponding to these data of resetting.
When client 12 needs downloading data, client 12 sends the first data download instruction to server 10, and wherein, the first data download instruction is carried the mark of the data of required download.Because the first data download instruction need to forward via gateway 11, gateway 11 receives this first data download instruction prior to server 10, and gateway 11 also forwards this first data download instruction to server 10.
Server 10 is according to receiving after the first data download instruction, in the data of storing at server 10, search the data corresponding with this mark, if find corresponding data, calculate a MD5 value of the data that find, and send a MD5 value to gateway 11, wherein, a MD5 value is for storing at described server, and the MD5 value of the data corresponding with described mark.
Gateway 11 is searched the second data according to being identified in buffer unit, and wherein, the second data are institute's buffer memory in buffer unit, and the data corresponding with this mark.If find this second data, gateway obtains the 2nd MD5 value of the second data, and whether compare a MD5 identical with the 2nd MD5, if identical, illustrate that the second data gateway buffer memory, corresponding with this mark are correct, gateway 11 returns to the second data to client.Two data that MD5 value is identical, two data are identical data.
It is not identical with the 2nd MD5 that gateway 11 comparisons obtain a MD5, and gateway 11 sends prompting message to client 12, to point out client 11 first data and the second data inconsistent.Client 11 shows the first data and the inconsistent message of the second data to user, and according to user input instruction, selects to download the first data or the second data.Wherein, the one MD5 with mark corresponding second data that gateway 11 buffer memorys are described not identical with the 2nd MD5, with not identical in the first data that server 10 is that store and mark is corresponding, in brief, the data that gateway is stored in the geodata and services device 10 of 1 buffer memory are inconsistent, wherein, in the said inconsistent data that refer to 11 buffer memorys of gateway, have part or whole herein, in server 10, can not find identical with it data.
When gateway 11 does not find described the second data, send the second data download instruction to server 10, wherein, the second data download instruction sends the first data for request server 10, the first data that gateway 11 reception servers 10 send, and buffer memory the first data, and the first data that send to client 12, its code is as follows:
When server 10 does not find the first data, server 10 sends the message that does not have the data of asking to client 12.Gateway 11, receiving after this message, is forwarded to client 12 by this message.
Tellable: gateway 11 is in the time receiving the first data download instruction, whether gateway also can detect with server 10 and be communicated with, if be not communicated with, gateway 11 is searched and identifies corresponding data at buffer unit, if find and identify corresponding data, return to client 12 data that find, if do not find and identify corresponding data, return to client 12 message that does not find data.
In embodiment of the present invention, by data buffer storage at gateway, in the time of client-requested data, when gateway determines local cache and has the data that client asks, gateway directly returns to the data of described request to client, need not server send the data of described request to client, and server sends the data of described request to client, need to pass through gateway forwards, and in the present invention gateway directly to client return data, reduction data transmission procedure the network path of process, thereby reduce the bandwidth that data take in transmitting procedure, improve data transmission bauds.
The present invention also provides gateway the first execution mode.As shown in Figure 2, gateway 20 comprises the first receiver module 201, the first sending module 202 and the second receiver module 203.
The first receiver module 201 receives the data upload instruction that client 21 sends, and wherein, the mark of the required data of uploading is carried in data upload instruction.In buffer unit 208, there is no buffer memory and data corresponding to mark, and do not store when identifying corresponding data at server 22, the first sending module 202 is sent out 21 to client and is sent data upload grant instruction.The second receiver module 203 receives the data that client 21 is uploaded according to data upload grant instruction, and data cached.
The mark of the required data of uploading of client 21 of carrying in data upload instruction can be the mark of data, for example: the title of data, also can be a MD5 value of these data, the one MD5 is the MD5 value of the required data of uploading of client 21, and the first sending module comprises: acquiring unit 2021, search unit 2022, the first transmitting element 2023, receiving element 2024, the second transmitting element 2025 and the 3rd transmitting element 2026.
Acquiring unit 2021 obtains the first set of the MD5 value of each data that comprise in buffer unit 208.Search unit 2022 and in the first set, search the member who matches with a MD5 value.In the time searching unit 2022 do not find the member who matches with a MD5 value in the first set, the first transmitting element 2023 sends a MD5 to server 22, so that server 22 is searched the member who matches with a MD5 value in the second set, wherein, the second set of gathering the MD5 value for comprising each data of storing in server.In the time that server 22 does not find the member who matches with a MD5 value in the second set, server 22 is sent in the message that does not find the member identical with a MD5 value in the second set to gateway 20.The message that does not find the member identical with a MD5 value in the second set that receiving element 2024 reception servers 22 send to gateway 20.The second sending module 203 is sent out 21 to client and is sent data upload grant instruction.
Further, if when the message that finds the member who matches with a MD5 value in the second set that receiving element 2024 reception servers 22 send to gateway 20, or, in the time searching unit 2022 find the member who matches with a MD5 value in the first set, the 3rd transmitting element 2026 sends data upload success message to client 21.
Gateway 20 also comprises the second sending module 204, acquisition module 205, judge module 206 and removing module 207.
The second sending module 204 sends to server 22 data that client 21 is uploaded, so that server 22 is stored data.
Acquisition module 205 obtains the cache-time of each data in buffer unit 208, and judge module 206 judges whether cache-time exceedes the threshold values time, determines cache-time exceed the threshold values time at judge module, deletes the data that cache-time is corresponding.
In embodiment of the present invention, when user end to server uploading data, the data that gateway cache client is uploaded, so that self client or other clients are in the time downloading these data to server request, gateway can directly return to this data to client, need not send this data to client by server, and server sends this data to client, need to pass through gateway forwards, and gateway directly returns to this data to client in the present invention, reduction data transmission procedure the network path of process, thereby reduce the bandwidth that data take in transmitting procedure, improve data transmission bauds.
The present invention also provides gateway the second execution mode.As shown in Figure 3, gateway 30 comprises the first receiver module 301, the first sending module 302, the second receiver module 303, searches module 305, comparing module 306, the 3rd sending module 307 and buffer unit 304.
The first receiver module 301 receives the first data download instruction that client 32 sends, and wherein, described data download instruction is carried the mark of the data of required download.The first sending module 302 forwards the first data download instruction to server 31.A MD5 value that the second receiver module 303 reception servers 31 return according to mark, wherein, a MD5 value is for storing at server 31, and the MD5 value of the data corresponding with mark.Search module 305 and search the second data according to being identified in buffer unit 304, wherein, the second data are institute's buffer memory in buffer unit 304, and the data corresponding with mark.Acquisition module 305, for searching module 305 while finding the second data, obtains the 2nd MD5 value of the second data.Whether comparing module 306 is compared a MD5 identical with the 2nd MD5.Obtain a MD5 with the 2nd MD5 when identical in comparing module 306 comparison, the second sending module 304 is compared and is obtained a MD5 and when identical, return to second data to client 32 with the 2nd MD5 value in comparing module 306.
Gateway 30 also comprises the 3rd sending module 308, the 4th sending module 309 and the 3rd receiver module 310.
Obtain a MD5 with the 2nd MD5 when not identical in comparing module 306 comparison, the 3rd sending module 308 sends prompting message to client 32, to point out client 32 first data and the second data inconsistent.Searching module 305 while not finding the second data, the 4th sending module 309 sends the second data download instruction to server 30, and wherein, the second data download instruction sends the first data for request server 30.The first data that the 3rd receiver module 310 reception servers 31 send, and buffer memory the first data, and the first data that send to client 32.
In embodiment of the present invention, gateway 30 is in the time receiving client-requested downloading data, detect buffer unit and whether be cached with the data that client is asked, when detecting buffer unit, gateway is cached with this data, and server is while also storing these data, gateway directly returns to this data to client, need not send this data to client by server, and server sends this data to client, need to pass through gateway forwards, and gateway directly returns to this data to client in the present invention, reduction data transmission procedure the network path of process, thereby reduce the bandwidth that data take in transmitting procedure, improve data transmission bauds.
The present invention also provides the method execution mode of uploading data.Refer to Fig. 4, method comprises:
Step S401: receive the data upload instruction that client sends, wherein, the mark of the required data of uploading of client is carried in data upload instruction;
The mark of data can be the mark of data, for example: the title of data, also can be the MD5 value of data.In embodiment of the present invention, data also can be file, and the name of data is called the title of file.
Step S402: in buffer unit, there is no the data that buffer memory is corresponding with mark, and there is no storage data corresponding with mark in server time, to client transmission data upload grant instruction;
In buffer unit, there is no buffer memory and data corresponding to mark, and in server, there is no storage and identify corresponding data, illustrate and in server and buffer unit, do not store the data that client is asked.In embodiment of the present invention, be labeled as a MD5 value of data, the one MD5 is the MD5 value of the required data of uploading of client, can judge in buffer unit, whether to be cached with the data that client is asked according to a MD5 value, and server judges on server, whether to store the data that client is asked according to a MD5 value, as shown in Figure 5, step S402 comprises step S4021, step S4022, step S4023, step S4024 and step S4025
Step S4021: first set of obtaining the MD5 value of each data that comprise in buffer unit;
Step S4022: search the member who matches with a MD5 value in the first set, if find the member who matches with a MD5 value, enter step S4024, otherwise enter step S4023;
Step S4023: send data upload success message to client;
Step S4024: send a MD5 value to server, so that server is searched the member who matches with a MD5 value in the second set, wherein, second gathers the set of the MD5 value for comprising each data of storing in server;
Step S4025: the message that does not find the member who matches with a MD5 value in the second set that reception server returns, and send data upload grant instruction to client;
Data upload grant instruction is used to indicate client upload data.In step S4025, if the message that finds the member who matches with a MD5 value in the second set that gateway reception server returns, client sends data upload success message.
Step S403: receive the data that client is uploaded according to data upload grant instruction, and data are stored in buffer unit;
Gateway also can be updated to the up-to-date MD5 value that stores the data in buffer unit in the first set, so that the first set can synchronously be upgraded.
Further, consistent for the data that ensure to store in the geodata and services device of gateway buffer memory, gateway also sends to server by the data of client upload, also comprises:
Step S404: send the data of client upload to server, so that these data of server stores;
Server also can be updated to the MD5 value of the data of up-to-date storage in the second set, so that the second set can synchronously be upgraded.
Step S405: the cache-time that obtains each data in buffer unit;
Data in buffer unit are provided with the threshold values time, and wherein, the threshold values time refers to that data store the maximum time value of buffer unit into, and gateway is made regular check on the cache-time of data.
Step S406: judge whether cache-time exceedes the threshold values time, if exceed, enter step S408, otherwise enter step S407;
Step S407: stop processing;
Step S408: delete data corresponding to cache-time;
Regularly delete the data that cache-time exceedes the threshold values time, keep the service efficiency of spatial cache.
In embodiment of the present invention, when user end to server uploading data, the data that gateway cache client is uploaded, so that self client or other clients are in the time downloading these data to server request, gateway can directly return to this data to client, need not send this data to client by server, and server sends this data to client, need to pass through gateway forwards, and gateway directly returns to this data to client in the present invention, reduction data transmission procedure the network path of process, thereby reduce the bandwidth that data take in transmitting procedure, improve data transmission bauds.
The method execution mode that the present invention also provides data to download.Refer to Fig. 6, as shown in the figure, method comprises:
Step S501: receive the first data download instruction that client sends, and forward the first data download instruction to server, wherein, the first data download instruction is carried the mark of the data of required download;
The identity marks that is designated data of data, for example: the title of data.The first data download instruction is used for to server request downloading data.Gateway receives the first data download instruction prior to server, and gateway receives after the first data download instruction, forwards this first data data download instruction to server.
At other, in execution mode, whether gateway receives after the first data download instruction of client transmission, also can detect gateway and be communicated with server, if be not communicated with, gateway can directly be searched and identify corresponding data at buffer unit, if find, returns to the data that find to client; If do not find, return to failed download message to client.
Step S502: a MD5 value that reception server returns according to mark, wherein, a MD5 value is for storing at server, and the MD5 value of the data corresponding with mark;
Server receives after the first data download instruction, searches the data corresponding with the mark of carrying in the first data download instruction, and searching after these data on server, obtains a MD5 value of these data, and returns to a MD5 value to gateway.
It should be noted that: when storing if do not have on server and identifying corresponding data, server is sent out gateway transmission and do not found and the message that identifies corresponding data, and gateway receives after this message, direct customer holds and sends failed download message.
Step S503: search the second data according to being identified in buffer unit, wherein, the second data are institute's buffer memory in buffer unit, and the data corresponding with mark, if find the second data, enter step S504, otherwise enter step S508;
Gateway is searched buffer unit according to mark and whether is cached with the data corresponding with this mark.
Step S504: the 2nd MD5 value of obtaining the second data;
For the method for the MD5 value of calculated data, the present invention is not construed as limiting, and can set according to actual conditions.
Step S505: whether the one MD5 is identical with the 2nd MD5 in comparison, if identical, enters step S506, otherwise, step S507 entered;
The one MD5 is identical with the 2nd MD5, the data corresponding with this mark of storing on server and buffer memory in buffer unit be described with data corresponding to this mark be consistent, gateway can directly return to this data to client;
Step S506: return to the second data to client;
Gateway, return to the second data success to client, also can send message to server, so that server record downloading data.
Step S507: send prompting message to client, to point out client the first data and the second data inconsistent;
The one MD5 is not identical with the 2nd MD5, the data corresponding with this mark of storing on server and buffer memory in buffer unit be described with data corresponding to this mark be inconsistent.Send prompting message to client, object can point out user to select corresponding data to download.
Further, method also comprises:
Step S508: send the second data download instruction to server, wherein, the second data download instruction sends the first data for request server;
There is no data corresponding to buffer memory in buffer unit time, the direct request server of gateway sends the first data to client.
Step S509: the first data that reception server sends, and buffer memory the first data, and the first data that send to client;
The first data that server sends, first arrive gateway, and after these first data of gateway buffer memory, then client sends the first data.
In embodiment of the present invention, in the time receiving client-requested downloading data, detect buffer unit and whether be cached with the data that client is asked, when detecting buffer unit, gateway is cached with this data, and server is while also storing these data, gateway directly returns to this data to client, need not send this data to client by server, and server sends this data to client, need to pass through gateway forwards, and gateway directly returns to this data to client in the present invention, reduction data transmission procedure the network path of process, thereby reduce the bandwidth that data take in transmitting procedure, improve data transmission bauds.
The foregoing is only embodiments of the present invention; not thereby limit the scope of the claims of the present invention; every equivalent structure or conversion of equivalent flow process that utilizes specification of the present invention and accompanying drawing content to do; or be directly or indirectly used in other relevant technical fields, be all in like manner included in scope of patent protection of the present invention.

Claims (10)

1. a method for uploading data, is characterized in that, method comprises:
Receive the data upload instruction that client sends, wherein, the mark of the required data of uploading of client is carried in described data upload instruction;
In buffer unit, there is no the data that buffer memory is corresponding with described mark, and in the time that server does not store the data corresponding with described mark, send data upload grant instruction to described client;
Receive the data that described client is uploaded according to described data upload grant instruction, and data described in buffer memory.
2. method according to claim 1, is characterized in that, described in be labeled as a MD5 value, a described MD5 is the MD5 value of the required data of uploading of described client;
Described do not have the data that buffer memory is corresponding with described mark in buffer unit, and in the time that server does not store the data corresponding with described mark, the step that sends data upload grant instruction to described client comprises:
Obtain the first set of the MD5 value of each data that comprise in buffer unit;
In the first set, search the member who matches with a MD5 value;
If do not find described member, send a described MD5 to server, so that described server is searched the member who matches with a MD5 value in the second set, wherein, described second gathers the set of the MD5 value of each data for storing in server;
Receive the message that does not find the member who matches with a MD5 value in the second set that described server returns, and send data upload grant instruction to described client.
3. method according to claim 2, is characterized in that, described method also comprises:
If find the member who matches with a MD5 value in described the first set, or, receive the message that finds the member who matches with a MD5 value in the second set that described server returns, send data upload success message to described client.
4. method according to claim 1, is characterized in that, described method also comprises:
Send the data of described client upload to described server, so that data described in described server stores.
5. method according to claim 4, is characterized in that, described method also comprises:
Obtain the cache-time of each data in described buffer unit;
Judge whether described cache-time exceedes the threshold values time;
If described cache-time exceedes the threshold values time, delete the data that described cache-time is corresponding.
6. a method for downloading data, is characterized in that, described method comprises:
Receive the first data download instruction that client sends, and forward described the first data download instruction to described server, wherein, described the first data download instruction is carried the mark of the data of the required download of client;
Receive the MD5 value that described server returns according to described mark, wherein, a described MD5 value is for storing at described server, and the MD5 value of the data corresponding with described mark;
Search the second data according to described being identified in buffer unit, wherein, described the second data are institute's buffer memory in buffer unit, and the data corresponding with described mark;
If find described the second data, obtain the 2nd MD5 value of described the second data;
Compare a described MD5 whether identical with the 2nd MD5;
If identical, return to described the second data to described client.
7. method according to claim 6, is characterized in that, described method also comprises:
If a described MD5 is not identical with the 2nd MD5, send prompting message to described client, to point out described in described client the first data and the second data inconsistent.
8. method according to claim 6, is characterized in that, described method also comprises:
If while not finding described the second data, send the second data download instruction to described server, wherein, described the second data download instruction sends the first data for request server;
Receive the first data that described server sends, and the first data described in buffer memory, and the first data that send to described client.
9. a gateway, is characterized in that, comprising:
The first receiver module, the data upload instruction sending for receiving client, wherein, the mark of the required data of uploading is carried in described data upload instruction;
The first sending module, for there is no the data that buffer memory is corresponding with described mark at buffer unit, and in the time that server does not store the data corresponding with described mark, sends data upload grant instruction to described client;
The second receiver module, the data of uploading according to described data upload grant instruction for receiving described client, and data described in buffer memory.
10. a gateway, is characterized in that, comprising:
The first receiver module, the first data download instruction sending for receiving client, and forward described the first data download instruction to described server, wherein, described the first data download instruction is carried the mark of the data of required download;
The second receiver module, a MD5 value of returning according to described mark for receiving described server, wherein, a described MD5 value is for storing at described server, and the MD5 value of the data corresponding with described mark;
Search module, search the second data for being marked at buffer unit described in basis, wherein, described the second data are institute's buffer memory in buffer unit, and the data corresponding with described mark;
Acquisition module, for while finding described the second data, obtaining the 2nd MD5 value of described the second data in the described module of searching;
Whether comparing module is identical with the 2nd MD5 for comparing a described MD5;
Sending module, when identical, returns to described second data to described client with the 2nd MD5 value for compare a described MD5 in described comparing module.
CN201410131955.0A 2014-04-02 2014-04-02 Method and gateway for uploading and downloading data Pending CN103944972A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410131955.0A CN103944972A (en) 2014-04-02 2014-04-02 Method and gateway for uploading and downloading data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410131955.0A CN103944972A (en) 2014-04-02 2014-04-02 Method and gateway for uploading and downloading data

Publications (1)

Publication Number Publication Date
CN103944972A true CN103944972A (en) 2014-07-23

Family

ID=51192453

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410131955.0A Pending CN103944972A (en) 2014-04-02 2014-04-02 Method and gateway for uploading and downloading data

Country Status (1)

Country Link
CN (1) CN103944972A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104994074A (en) * 2015-06-01 2015-10-21 浪潮集团有限公司 Implementation method of communication server of physical examination machine
CN105376270A (en) * 2014-08-11 2016-03-02 腾讯科技(深圳)有限公司 Method, device and system for improving uploading efficiency
CN109842905A (en) * 2017-11-28 2019-06-04 中国移动通信有限公司研究院 Dictionary configuration method, network side equipment and user terminal
CN109962965A (en) * 2017-12-26 2019-07-02 深圳联友科技有限公司 A kind of method and device of data buffer storage

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1835482A (en) * 2005-12-29 2006-09-20 上海贝豪通讯电子有限公司 Method of solving radio media stream services
CN101534322A (en) * 2009-04-13 2009-09-16 腾讯科技(深圳)有限公司 File upload system and file upload method
CN101552669A (en) * 2008-04-02 2009-10-07 林兆祥 Method and system of data transmission
CN101699822A (en) * 2009-08-06 2010-04-28 腾讯科技(深圳)有限公司 File uploading method and device, and mass storage system
CN101867607A (en) * 2010-05-21 2010-10-20 北京无限立通通讯技术有限责任公司 Distributed data access method, device and system
CN102026290A (en) * 2010-12-16 2011-04-20 华为终端有限公司 Wireless mobile gateway and method for responding user access by same

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1835482A (en) * 2005-12-29 2006-09-20 上海贝豪通讯电子有限公司 Method of solving radio media stream services
CN101552669A (en) * 2008-04-02 2009-10-07 林兆祥 Method and system of data transmission
CN101534322A (en) * 2009-04-13 2009-09-16 腾讯科技(深圳)有限公司 File upload system and file upload method
CN101699822A (en) * 2009-08-06 2010-04-28 腾讯科技(深圳)有限公司 File uploading method and device, and mass storage system
CN101867607A (en) * 2010-05-21 2010-10-20 北京无限立通通讯技术有限责任公司 Distributed data access method, device and system
CN102026290A (en) * 2010-12-16 2011-04-20 华为终端有限公司 Wireless mobile gateway and method for responding user access by same

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105376270A (en) * 2014-08-11 2016-03-02 腾讯科技(深圳)有限公司 Method, device and system for improving uploading efficiency
CN105376270B (en) * 2014-08-11 2020-04-24 腾讯科技(深圳)有限公司 Method, device and system for improving uploading efficiency
CN104994074A (en) * 2015-06-01 2015-10-21 浪潮集团有限公司 Implementation method of communication server of physical examination machine
CN104994074B (en) * 2015-06-01 2018-04-13 浪潮集团有限公司 A kind of implementation method of the health examination machine communication server
CN109842905A (en) * 2017-11-28 2019-06-04 中国移动通信有限公司研究院 Dictionary configuration method, network side equipment and user terminal
CN109962965A (en) * 2017-12-26 2019-07-02 深圳联友科技有限公司 A kind of method and device of data buffer storage

Similar Documents

Publication Publication Date Title
CN101409706B (en) Method, system and relevant equipment for distributing data of edge network
CN104202360B (en) The method of accessed web page, device and router
US9774642B2 (en) Method and device for pushing multimedia resource and display terminal
US10306007B2 (en) Cache content hit method and communications system
CN105812435B (en) Application upgrading data packet processing method and device, electronic equipment and system
US9590947B2 (en) IP management method, client and server
CN106453460B (en) File distribution method, device and system
KR20140009931A (en) Communication method of contents requester and contents provider for providing contents and real-time streaming contents in a contents centric network based on contents name
US20180278692A1 (en) Communication device, communication system, and communication method
CN102394880B (en) Method and device for processing jump response in content delivery network
CN104410692A (en) Method and system for uploading duplicated files
CN106357539B (en) A kind of data capture method and equipment
US20140025723A1 (en) Cloud storage system and data storage and sharing method based on the system
WO2018054369A1 (en) Method and apparatus for selecting streaming data transmission node
CN103944972A (en) Method and gateway for uploading and downloading data
WO2017054578A1 (en) Message forwarding method, service chain proxy apparatus and proxy device
CN105069011A (en) Webpage favorite management method, device and system
CN101123578A (en) A method and system for improving access speed of network resource
CN104954448A (en) Picture processing method, picture processing system and picture processing server
CN101150593A (en) A method and system for data upload
CN105450682A (en) Method, device, and system for data synchronous storage and synchronizing data to client
CN112417255A (en) Method and device for receiving online state, storage medium and electronic device
CN110460668B (en) File uploading method and device, computer equipment and storage medium
CN106899651B (en) Communication processing method, system and network communication system
CN103957207A (en) Conversation keeping method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20140723

Assignee: Liu Yi

Assignor: Shenzhen Zhongbo Kechuang Information Technology Co., Ltd.

Contract record no.: 2014440020487

Denomination of invention: Method and gateway for uploading and downloading data

License type: Common License

Record date: 20141230

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model
EC01 Cancellation of recordation of patent licensing contract

Assignee: Liu Yi

Assignor: Shenzhen Zhongbo Kechuang Information Technology Co., Ltd.

Contract record no.: 2014440020487

Date of cancellation: 20161025

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140723