Document down loading method, device based on NDN network, node, terminal
Technical field
The present embodiments relate to electronic communication technology fields, and in particular to a kind of file download side based on NDN network
Method, device, node, terminal.
Background technique
In the prior art, when from downloading file, connection first usually is established with server, under server
Published article part, the intermediate network equipment only carry out network message forwarding to the file of downloading, i.e., all downloading needs require to collect
Chinese style server provides download service.
Now downloading mode in the art brings very big service pressure to centralized server.That especially downloads is super
To the more demanding of centralized server when big file.
It names data network (Named Data Networking, NDN) for a kind of framework based on data, is made with data
Unique identification for the entity in network, using " name " as data.NDN defines the data of two kinds of formats, one is with
In the data for sending request, " interest packet (Interest packet) " can be described as;Another kind is the data comprising content, can be claimed
For " data packet (data packet) ".The data of every kind of format all use name as unique identification, such as: the name of interest packet
Word obtains the request of content for the unique identification interest packet, and the name of data packet is for the interior of the unique identification packet load
Hold.
Summary of the invention
For this purpose, the embodiment of the present invention provides a kind of document down loading method based on NDN network, device, node, terminal and deposits
Storage media, with solve in the prior art as download every time require access centralized server and caused by server stress it is big
The problem of.
To achieve the goals above, embodiments of the present invention provide the following technical solutions:
In the first aspect of embodiments of the present invention, a kind of document down loading method based on NDN network is provided, is wrapped
Include: the first NDN node receives file fragmentation downloading request, the file fragmentation downloading from the 2nd NDN node or requester terminal
Request includes that file fragmentation identifies;When the first NDN node, which stores the file fragmentation, identifies corresponding file fragmentation,
The first NDN node sends the file fragmentation to the 2nd NDN node or the requester terminal and identifies corresponding text
Part fragment;When the first NDN node, which does not store the file fragmentation, identifies corresponding file fragmentation, the first NDN
Node sends the file fragmentation downloading request to the 3rd NDN node or file server;When the first NDN node is from described
When 2nd NDN node receives file fragmentation downloading request, the file fragmentation downloading request be the 2nd NDN node from
The information that the requester terminal receives, the 2nd NDN node do not store the file fragmentation and identify corresponding file
Fragment.
In one embodiment of the invention, it is corresponded to when the first NDN node does not store the file fragmentation mark
File fragmentation when, send the file fragmentation to the 3rd NDN node or file server in the first NDN node and identify it
Afterwards, the document down loading method further include: the first NDN node connects from the 3rd NDN node or the file server
It receives the file fragmentation and identifies corresponding file fragmentation;The first NDN node is to the 2nd NDN node or the requestor
Terminal sends the file fragmentation and identifies corresponding file fragmentation.
In another embodiment of the invention, the file fragmentation is identified as the requester terminal from the file service
The received information of device;It is the file that the file server fragment is handled that the file fragmentation, which identifies corresponding file fragmentation,
Fragment.
In the second aspect of embodiments of the present invention, a kind of document down loading method based on NDN network is provided, is wrapped
Include: requester terminal sends file fragmentation downloading request, the file fragmentation downloading to the first NDN node or the 2nd NDN node
Request includes that file fragmentation identifies;When the requester terminal sends file fragmentation downloading request to the 2nd NDN node, and work as
When the 2nd NDN node does not store the file fragmentation and identifies corresponding file fragmentation, the 2nd NDN node be used for
First NDN node sends the file fragmentation downloading request;When the first NDN node stores the file fragmentation mark pair
When the file fragmentation answered, the requester terminal receives the file fragmentation from the first NDN node and identifies corresponding file
Fragment;When the first NDN node, which does not store the file fragmentation, identifies corresponding file fragmentation, the first NDN section
Point is for sending the file fragmentation downloading request to the 3rd NDN node or file server.
In one embodiment of the invention, it is corresponded to when the first NDN node does not store the file fragmentation mark
File fragmentation, and the requester terminal to the first NDN node send file fragmentation downloading request when, the requester terminal
The corresponding file fragmentation of the file identification is received from the first NDN node, and the corresponding file fragmentation of the file identification is
The information that the first NDN node is received from the 3rd NDN node or the file server;As the first NDN
When node does not store the file fragmentation mark corresponding file fragmentation, and the requester terminal is sent out to the 2nd NDN node
Send file fragmentation downloading request, and when the 2nd NDN node does not store the file fragmentation and identifies corresponding file fragmentation,
The requester terminal receives the corresponding file fragmentation of the file identification, the file identification pair from the 2nd NDN node
The file fragmentation answered is that the first NDN node receives to obtain by described from the 3rd NDN node or the file server
First NDN node is transmitted to the information of the 2nd NDN node.
In the third aspect of embodiments of the present invention, a kind of file downloading device based on NDN network is provided, is wrapped
It includes: the first receiving unit, for receiving file fragmentation downloading request, the file point from the 2nd NDN node or requester terminal
Piece downloading request includes that file fragmentation identifies;First transmission unit, for storing the file fragmentation mark when the first NDN node
When knowing corresponding file fragmentation, the 2nd NDN node of Xiang Suoshu or the requester terminal send the file fragmentation mark and correspond to
File fragmentation;First transmission unit is also used to when not store file fragmentation mark corresponding for the first NDN node
When file fragmentation, the file fragmentation downloading request is sent to the 3rd NDN node or file server;When first reception is single
When member receives the file fragmentation downloading request from the 2nd NDN node, the file fragmentation downloading request is described second
The information that NDN node is received from the requester terminal, the 2nd NDN node do not store the file fragmentation mark pair
The file fragmentation answered.
In the fourth aspect of embodiments of the present invention, a kind of file downloading device based on NDN network is provided, is wrapped
It includes: the second transmission unit, for sending file fragmentation downloading request, the file point to the first NDN node or the 2nd NDN node
Piece downloading request includes that file fragmentation identifies;It is asked when second transmission unit sends file fragmentation downloading to the 2nd NDN node
When asking, and when the 2nd NDN node does not store the file fragmentation and identifies corresponding file fragmentation, the 2nd NDN
Node is used to send the file fragmentation downloading request to the first NDN node;Second receiving unit, for working as the first NDN
When node stores the file fragmentation mark corresponding file fragmentation, the file fragmentation is received from the first NDN node
Identify corresponding file fragmentation;When the first NDN node, which does not store the file fragmentation, identifies corresponding file fragmentation,
The first NDN node is used to send the file fragmentation downloading request to the 3rd NDN node or file server.
In the 5th aspect of embodiments of the present invention, a kind of NDN node, including first processor and first are provided
Memory;Wherein, the first memory store code;The first processor executes the code, for executing first party
Document down loading method described in face.
In the 6th aspect of embodiments of the present invention, a kind of terminal is provided, including second processor and second is deposited
Reservoir;Wherein, the second memory store code;The second processor executes the code, for executing second aspect
The document down loading method.
In the 7th aspect of embodiments of the present invention, a kind of computer-readable storage medium for storing program is provided
Matter, described program includes instruction, when described instruction is computer-executed, the computer is made to execute file described in first aspect
Document down loading method described in method for down loading or second aspect.
Embodiment according to the present invention, the method for down loading provided in an embodiment of the present invention based on NDN network, device, section
Point, terminal and storage medium, which have the advantages that, first to be attempted to download file fragmentation from a NDN node, when the NDN node does not have
When storage file fragment, reattempts from other NDN nodes and download file fragmentation, without downloading every time all by file server
It is handled, alleviates the service pressure of file server.
Detailed description of the invention
It, below will be to embodiment party in order to illustrate more clearly of embodiments of the present invention or technical solution in the prior art
Formula or attached drawing needed to be used in the description of the prior art are briefly described.It should be evident that the accompanying drawings in the following description is only
It is merely exemplary, it for those of ordinary skill in the art, without creative efforts, can also basis
The attached drawing of offer, which is extended, obtains other implementation attached drawings.
Fig. 1 is a kind of document down loading method flow chart based on NDN network that one embodiment of the invention provides;
Fig. 2 is the file downloading device structural schematic diagram based on NDN network that another embodiment of the present invention provides;
Fig. 3 is the file downloading device structural schematic diagram based on NDN network that another embodiment of the present invention provides;
Fig. 4 is a kind of NDN node structure schematic diagram that another embodiment of the present invention provides;
Fig. 5 is a kind of terminal structure schematic diagram that another embodiment of the present invention provides.
In figure: 21. first receiving units, 22. first transmission units, 31. second transmission units, 32. second receiving units,
41. first processor, 42. first memories, 51. second processors, 52. second memories.
Specific embodiment
Embodiments of the present invention are illustrated by particular specific embodiment below, those skilled in the art can be by this explanation
Content disclosed by book is understood other advantages and efficacy of the present invention easily, it is clear that described embodiment is the present invention one
Section Example, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not doing
Every other embodiment obtained under the premise of creative work out, shall fall within the protection scope of the present invention.
It include that multiple NDN are saved in the applicable framework of document down loading method provided in an embodiment of the present invention based on NDN network
Point, at least one node in multiple NDN nodes can be file server.One or more nodes in multiple NDN nodes
It can be requester terminal.Requester terminal is the terminal that user is used to download file.
Next it is specifically introduced in the scheme of the embodiment of the present invention.
Embodiment 1
A kind of document down loading method based on NDN network is present embodiments provided, the executing subject of this method is NDN network
In a NDN node.With reference to Fig. 1, this document method for down loading includes the following steps.
Step 11, the first NDN node receive file fragmentation downloading request from the 2nd NDN node or requester terminal, described
File fragmentation downloading request includes that file fragmentation identifies.
One file fragmentation downloading request includes a file fragmentation mark, and a file fragmentation mark is for identifying one
File fragmentation, i.e., a file fragmentation downloading request is for requesting one file fragmentation of downloading.
The file fragmentation is identified as the requester terminal from the received information of the file server;The file point
It is the file fragmentation that the file server fragment is handled that piece, which identifies corresponding file fragmentation,.
The file of publication can be carried out fragment and encryption by file server.Fragment processing can be according to preset point
Piece algorithm carries out fragment, which can be slicing algorithm in the prior art, for example, the file of a 100MB, it can
To be divided into 10 file fragmentations, each file fragmentation is 10MB.File server is that each file fragmentation generates one entire
Unique file identification in NDN network.
File server can (title of a file be uniquely, to be used in entire NDN network by the title of file
Identify a unique file) and/or file fragmentation mark be sent to requester terminal.When file server is only by the name of file
When title is sent to requester terminal, requester terminal can be corresponding to file server requests this document according to the title of file
The file fragmentation of file fragmentation identifies.
Specifically, file server can send interest packet solicited message, and the interest packet solicited message includes file
Information, subscriber identity.The corresponding subscriber of the subscriber identity can be used as the requestor of request downloading file.Interest packet is asked
Seeking information is the information that interest packet is sent for the person of pulling subscription that file server is sent.The information of file may include file
Title and/or file file fragmentation file fragmentation mark.
Subscriber identity is a unique identification code in NDN network, is used for unique identification subscriber.
Before the transmission interest packet solicited message, file server obtains the information of the file, Subscriber Information;
The subscriber identity is generated according to the information of the file, Subscriber Information.In this example, some or certain several subscribers
The content in terms of certain is had subscribed, file server obtains the information of the file of publication and the information of subscriber in file publishing,
So as to obtain the subscriber for having subscribed this document, or the subscriber interesting to this document, and then can be with these subscription
The subscriber identity of person.
It is described that generate the subscriber identity according to the information of the file, Subscriber Information include according to the file
Information, Subscriber Information and reference information generate the subscriber identity, the reference information include distributor information and/or with
Machine value;The information of the file can also include following any one or more: the filename of the file, md5 value, storage road
Diameter, URL, publisher, issuing time.Filename, md5 value, store path, URL, publisher, issuing time of the file etc.
It is determined for the file of publication.
After the transmission interest packet solicited message, when the preset time after transmission interest packet solicited message
When being inside not received by confirmation message, the interest packet solicited message is sent.In the example, received in the terminal of subscriber emerging
When interesting packet solicited message, to file server feedback acknowledgment information, to indicate to have received interest packet solicited message.If default
In time, file server is not received by confirmation message, it may be considered that subscriber is not received by interest packet solicited message,
I.e. interest packet solicited message sends failure, and then sends interest packet solicited message again.Preset time can be preparatory for manager
The time of setting, or file server assesses NDN Network status, the time being arranged according to assessment result.It is right
The assessment of NDN Network status is also referred to network estimation method in the prior art, and details are not described herein again.
When the file information in interest packet solicited message only includes the title of file, interest packet solicited message is being had sent
Later, file server can receive interest packet from subscriber's used terminal, and the interest packet is corresponding for the subscriber identity
The information that is sent according to the information of the file of subscriber.Interest packet is used for the corresponding file fragmentation of title of demand file
File fragmentation mark.
That is, in the present embodiment, when being not received by interest packet solicited message, not sending interest packet, only receiving
When to interest packet solicited message, interest packet is just sent.
It include subscriber identity in interest packet solicited message, therefore, interest packet solicited message can be forwarded in NDN network
To terminal used in subscriber.
After file server receives interest packet, Xiang Suoshu subscriber sends data packet, and the data packet includes file point
Piece mark.
After subscriber obtains the All Files segmental identification an of file, if it is desired to lower file, it can be to NDN node
File fragmentation downloading request is sent, is identified including file fragmentation.At this point, above-mentioned subscriber can become requestor, make
Terminal is known as requester terminal.
When file is downloaded in request, requester terminal needs the NDN node into NDN network to send all texts of this document
The file fragmentation of part fragment downloads request.
The file fragmentation downloading that requester terminal can send the All Files fragment of this document to a NDN node is asked
It asks.
The file fragmentation of the All Files fragment of this document can also be downloaded request and issue different NDN by requester terminal
Node, and the quantity of the received file fragmentation downloading request of a NDN node is unrestricted.For example, a file has 10
A file fragmentation, needs to send accordingly the downloading request of 10 file fragmentations, and requester terminal can will be under 10 file fragmentations
It carries request and is sent to 10 NDN nodes, i.e., each NDN node receives 1 file fragmentation downloading request.For another example a file
With 10 file fragmentations, need to send 10 file fragmentation downloading requests accordingly, requester terminal can be by 10 files
Fragment downloading request is sent to 5 NDN nodes, i.e., each NDN node receives 2 file fragmentation downloading requests.For another example one
File has 10 file fragmentations, needs to send 10 file fragmentation downloading requests accordingly, requester terminal can be by 10
File fragmentation downloading request is sent to 5 NDN nodes, wherein a NDN node receives 6 file fragmentation downloading requests, in addition
Four NDN nodes receive a file fragmentation downloading request respectively.
Step 12, when the first NDN node stores the file fragmentation and identifies corresponding file fragmentation, described the
One NDN node sends the file fragmentation to the 2nd NDN node or the requester terminal and identifies corresponding file fragmentation;
When the first NDN node, which does not store the file fragmentation, identifies corresponding file fragmentation, the first NDN node is to the
Three NDN nodes or file server send the file fragmentation downloading request.
When the first NDN node receives the file fragmentation downloading request from the 2nd NDN node, the file
Fragment downloading request is the information that the 2nd NDN node is received from the requester terminal, and the 2nd NDN node does not have
It stores the file fragmentation and identifies corresponding file fragmentation.
When the first NDN node, which does not store the file fragmentation, identifies corresponding file fragmentation, described first
After NDN node sends the file fragmentation mark to the 3rd NDN node or file server, the document down loading method is also wrapped
Include: the first NDN node is corresponding from the 3rd NDN node or the file server reception file fragmentation mark
File fragmentation;The first NDN node sends the file fragmentation mark to the 2nd NDN node or the requester terminal
Corresponding file fragmentation.
For example, file fragmentation downloading request is received from requester terminal such as the 2nd NDN node, and according to text therein
Part segmental identification searches whether itself has cached this file fragmentation, if having cached this file fragmentation, this file fragmentation is sent out
Requester terminal is given, if not caching this file fragmentation, file fragmentation downloading request is forwarded the request into other NDN section
Point is such as transmitted to the first NDN node, and the first NDN node repeats the operation of the 2nd NDN node, if the first NDN node does not have yet
Time file fragmentation is cached, file fragmentation downloading request is transmitted to the 3rd NDN node or file server by the first NDN node.
When file fragmentation downloading request is transmitted to file server by the first NDN node, file server must include
The All Files fragment of the file of file server publication, so file server can respond the file of the first NDN node forwarding
Fragment downloading request and corresponding document fragment is sent to the first NDN node (the first NDN node is the file point of file server
Piece requestor), this file fragmentation can be sent to the 2nd NDN node (the 2nd NDN after obtaining file fragmentation by the first NDN node
Node is the file fragmentation requestor of the first NDN node) (each NDN node, which has, records whom to oneself what requested file
Fragment), file fragmentation is sent to requester terminal by the 2nd NDN node.
When file fragmentation downloading request is transmitted to the 3rd NDN node by the first NDN node, the 3rd NDN node repeats the
The operation of one node.When file fragmentation is arrived in request, the transmission path of file fragmentation is also as described above.
All NDN nodes in file fragmentation transmission path can all cache this file fragmentation, when requester terminal again to
When any NDN node requests this file fragmentation, which can be sent out this file fragmentation directly in response to requester terminal
Give requester terminal.
It should be noted that in the present embodiment, file cache is a kind of document storage mode.
Method for down loading provided in an embodiment of the present invention based on NDN network, which has the advantages that, first to be attempted to save from a NDN
Point downloading file fragmentation reattempts from other NDN nodes when the NDN node does not have storage file fragment and downloads file fragmentation,
It is all handled by file server without downloading every time, alleviates the service pressure of file server.
Embodiment 2
Present embodiments provide a kind of document down loading method based on NDN network, the executing subject of this document method for down loading
For requester terminal.This document method for down loading, which includes: requester terminal, sends file to the first NDN node or the 2nd NDN node
Fragment downloading request, the file fragmentation downloading request include that file fragmentation identifies;When the requester terminal is saved to the 2nd NDN
When point sends file fragmentation downloading request, and corresponding text is identified when the 2nd NDN node does not store the file fragmentation
When part fragment, the 2nd NDN node is used to send the file fragmentation downloading request to the first NDN node;When described first
When NDN node stores the file fragmentation and identifies corresponding file fragmentation, the requester terminal is from the first NDN node
It receives the file fragmentation and identifies corresponding file fragmentation;When the first NDN node does not store the file fragmentation mark
When corresponding file fragmentation, the first NDN node is used to send the file fragmentation to the 3rd NDN node or file server
Downloading request.
In one example, corresponding file fragmentation is identified when the first NDN node does not store the file fragmentation,
And the requester terminal, when sending file fragmentation downloading request to the first NDN node, the requester terminal is from described first
NDN node receives the corresponding file fragmentation of the file identification, and the corresponding file fragmentation of the file identification is the first NDN
The information that node is received from the 3rd NDN node or the file server;When the first NDN node does not store
When the file fragmentation identifies corresponding file fragmentation, and the requester terminal is sent under file fragmentation to the 2nd NDN node
Carry request, and when the 2nd NDN node does not store the file fragmentation and identifies corresponding file fragmentation, the requestor is whole
End receives the corresponding file fragmentation of the file identification from the 2nd NDN node, the corresponding file fragmentation of the file identification
It receives to obtain from the 3rd NDN node or the file server for the first NDN node and be turned by the first NDN node
Issue the information of the 2nd NDN node.
The content that document down loading method provided in this embodiment can be recorded with reference implementation example 1 realizes that details are not described herein again.
Document down loading method provided in this embodiment based on NDN network has the following advantages: first attempting from a NDN node
File fragmentation is downloaded, when the NDN node does not have storage file fragment, reattempts from other NDN nodes and downloads file fragmentation, from
It is all handled by file server without downloading every time, alleviates the service pressure of file server.
Embodiment 3
A kind of file downloading device based on NDN network is present embodiments provided, as shown in Figure 2, comprising:
First receiving unit 21, it is described for receiving file fragmentation downloading request from the 2nd NDN node or requester terminal
File fragmentation downloading request includes that file fragmentation identifies;
First transmission unit 22, for identifying corresponding file fragmentation when the first NDN node stores the file fragmentation
When, the 2nd NDN node of Xiang Suoshu or the requester terminal send the file fragmentation and identify corresponding file fragmentation;
First transmission unit 22 is also used to identify corresponding text when the first NDN node does not store the file fragmentation
When part fragment, the file fragmentation downloading request is sent to the 3rd NDN node or file server;
It is described when first receiving unit 21 receives the file fragmentation downloading request from the 2nd NDN node
File fragmentation downloading request is the information that the 2nd NDN node is received from the requester terminal, the 2nd NDN node
It does not store the file fragmentation and identifies corresponding file fragmentation.
The function of each functional unit of file downloading device provided in this embodiment based on NDN network can be with reference implementation example
1 content recorded realizes that details are not described herein again.
File downloading device provided in this embodiment based on NDN network has the following advantages: first attempting from a NDN node
File fragmentation is downloaded, when the NDN node does not have storage file fragment, reattempts from other NDN nodes and downloads file fragmentation, from
It is all handled by file server without downloading every time, alleviates the service pressure of file server.
Embodiment 4
A kind of file downloading device based on NDN network is present embodiments provided, as shown in Figure 3, comprising:
Second transmission unit 31, for sending file fragmentation downloading request, institute to the first NDN node or the 2nd NDN node
Stating file fragmentation downloading request includes that file fragmentation identifies;
When second transmission unit 31 sends file fragmentation downloading request to the 2nd NDN node, and work as described second
When NDN node does not store the file fragmentation mark corresponding file fragmentation, the 2nd NDN node is used for the first NDN
Node sends the file fragmentation downloading request;
Second receiving unit 32, for identifying corresponding file when the first NDN node stores the file fragmentation
When fragment, the file fragmentation is received from the first NDN node and identifies corresponding file fragmentation;
When the first NDN node, which does not store the file fragmentation, identifies corresponding file fragmentation, the first NDN
Node is used to send the file fragmentation downloading request to the 3rd NDN node or file server.
The function of each functional unit of file downloading device provided in this embodiment based on NDN network can be with reference implementation example
1 and embodiment 2 record content realize, details are not described herein again.
File downloading device provided in this embodiment based on NDN network has the following advantages: first attempting from a NDN node
File fragmentation is downloaded, when the NDN node does not have storage file fragment, reattempts from other NDN nodes and downloads file fragmentation, from
It is all handled by file server without downloading every time, alleviates the service pressure of file server.
Embodiment 5
A kind of NDN node is present embodiments provided, as shown in figure 4, including first processor 41 and first memory 42;Its
In,
42 store code of first memory;
The first processor 41 executes the code, for executing document down loading method described in embodiment 1.
NDN node provided in this embodiment has the following advantages: first attempting to download file fragmentation from a NDN node, when this
When NDN node does not have storage file fragment, reattempts from other NDN nodes and download file fragmentation, without downloading every time all
It is handled by file server, alleviates the service pressure of file server.
Embodiment 6
A kind of terminal is present embodiments provided, as shown in figure 5, including second processor 51 and second memory 52;Wherein,
52 store code of second memory;
The second processor 51 executes the code, for executing document down loading method described in embodiment 1.
Terminal provided in this embodiment has the following advantages: first attempting to download file fragmentation from a NDN node, as the NDN
When node does not have storage file fragment, reattempts from other NDN nodes and download file fragmentation, without downloading every time all by text
Part server is handled, and the service pressure of file server is alleviated.
Embodiment 7
A kind of computer readable storage medium for storing program is present embodiments provided, described program includes instruction, described
When instruction is computer-executed, the computer is made to execute document down loading method described in embodiment 1 or text as described in example 2
Part method for down loading.
The computer readable storage medium of storage program provided in this embodiment has the following advantages: first attempting from a NDN
Node downloads file fragmentation, when the NDN node does not have storage file fragment, reattempts from other NDN nodes downloading file point
Piece is all handled by file server without downloading every time, alleviates the service pressure of file server.
Although above having used general explanation and specific embodiment, the present invention is described in detail, at this
On the basis of invention, it can be made some modifications or improvements, this will be apparent to those skilled in the art.Therefore,
These modifications or improvements without departing from theon the basis of the spirit of the present invention are fallen within the scope of the claimed invention.