The collocation method and device of local resource
Technical field
The present invention relates to the collocation method and device of network technique field, more particularly to a kind of local resource.
Background technology
Existing terminal device, such as mobile phone, tablet computer, all with function of surfing the Net, for example, 2G/3G/4G traffic forms or
WIFI hot spot is connected, or is directly connected by cable with router.Therefore user increasingly gets used to using these ends
End equipment browse network resource, viewing video etc..
But some service terminal devices can only connect charge on traffic network due to being limited be subject to use environment,
Therefore unconfined network service can not be provided to the user.In order to meet the needs of user watches the entertainment resources such as video, at these
The entertainment resources such as some videos caching can will be downloaded in service terminal device in advance and is put in local, user checks local money
During source, corresponding software need to be called just to check, and browsing content is relatively simple, such as can only could be obtained by video-see
The relevant information of video, no image of Buddha website is the same, with regard to that can obtain relevant information before video is watched.Inventor is realizing this hair
Found in bright process, since the store path of local resource, method of calling etc. are too big with Internet resources gap, it is difficult to will be local
Resource is managed collectively with Internet resources, and user is in browse network resource and local resource, using completely different
Browsing mode, makes troubles to user.It is therefore desirable to solve above-mentioned technical problem.
The content of the invention
Technical problems to be solved of the embodiment of the present invention are, in the prior art due to local resource and Internet resources
Storage, method of calling are entirely different, cause the browsing mode of local resource and Internet resources to differ greatly, are brought not to user
Just.
In order to solve the above technical problems, the embodiment of the present invention provides a kind of collocation method of local resource, including following step
Suddenly:
Obtain the master catalogue of local ip address and its binding;
It is that the local resource under master catalogue configures local resource finger URL, the local money according to the local ip address
Source finger URL has identical name form with universal resource locator.
Alternatively, the collocation method of above-mentioned local resource, according to the local ip address, is being the local under master catalogue
Resource distribution local resource finger URL, the local resource finger URL have the step of identical name form with universal resource locator
In rapid, specifically include:
The universal resource locator corresponding with local resource to prestore is obtained, is included in the universal resource locator local
The network storage path of resource and network ip address;
Obtain local resource is locally stored path;
Path is locally stored according to the master catalogue and local resource, obtains the relative path of the local resource;
If the opposite store path of the local resource is identical with the network storage path, using the local IP
The network ip address in the network resource locator is replaced in location, obtains local resource finger URL.
Alternatively, the collocation method of above-mentioned local resource, further includes:
If the opposite store path of local resource is different from the network storage path, replaced using the local ip address
The network ip address in the universal resource locator is changed, obtains local resource finger URL, and stores the local resource positioning
Symbol and the correspondence that path and resource name is locally stored.
Alternatively, the collocation method of above-mentioned local resource, is the local money under master catalogue according to the local ip address
Source configures local resource finger URL, and the local resource finger URL has the step of identical name form with universal resource locator
In, further include:
The universal resource locator corresponding with local resource to prestore is obtained, is included in the universal resource locator local
The network storage path of resource and network ip address;
The network ip address in the universal resource locator is replaced using local ip address, obtains local resource positioning
Symbol, and store the local resource finger URL and the correspondence that path and resource name is locally stored.
Alternatively, the collocation method of above-mentioned local resource, is the local money under master catalogue according to the local ip address
Source configures local resource finger URL, and the local resource finger URL has in identical name form with universal resource locator, tool
Body further includes:
Obtain local resource is locally stored path;
Path is locally stored according to the master catalogue and local resource, obtains the opposite storage road of the local resource
Footpath;
Local resource finger URL is obtained according to opposite store path, the resource name of local ip address and local resource.
Based on same inventive concept, the embodiment of the present invention also provides a kind of configuration device of local resource, including:
Acquiring unit, obtains the master catalogue of local ip address and its binding;
Finger URL dispensing unit, is that the local resource configuration local resource under master catalogue is determined according to the local ip address
Position symbol, the local resource finger URL have identical name form with universal resource locator.
Alternatively, the configuration device of above-mentioned local resource, the finger URL dispensing unit are additionally operable to:
The universal resource locator corresponding with local resource to prestore is obtained, is included in the universal resource locator local
The network storage path of resource and network ip address;
Obtain local resource is locally stored path;
Path is locally stored according to the master catalogue and local resource, obtains the relative path of the local resource;
If the opposite store path of the local resource is identical with the network storage path, using the local IP
The network ip address in the network resource locator is replaced in location, obtains local resource finger URL.
Alternatively, the configuration device of above-mentioned local resource, the finger URL dispensing unit are additionally operable to:
If the opposite store path of local resource is different from the network storage path, replaced using the local ip address
The network ip address in the universal resource locator is changed, obtains local resource finger URL, and stores the local resource positioning
Symbol and the correspondence that path and resource name is locally stored.
Alternatively, the configuration device of above-mentioned local resource, the finger URL dispensing unit are additionally operable to:
The universal resource locator corresponding with local resource to prestore is obtained, is included in the universal resource locator local
The network storage path of resource and network ip address;
The network ip address in the universal resource locator is replaced using local ip address, obtains local resource positioning
Symbol, and store the local resource finger URL and the correspondence that path and resource name is locally stored.
Alternatively, the configuration device of above-mentioned local resource, the finger URL dispensing unit are additionally operable to:
Obtain local resource is locally stored path;
Path is locally stored according to the master catalogue and local resource, obtains the opposite storage road of the local resource
Footpath;
Local resource finger URL is obtained according to opposite store path, the resource name of local ip address and local resource.
The collocation method and device of local resource described in the embodiment of the present invention, by obtaining local ip address and its binding
Master catalogue, and according to local ip address be master catalogue under local resource configure local resource finger URL, the local resource
Finger URL has identical name form with universal resource locator, therefore the mode of browse network resource can be utilized to browse this
Ground resource, and any change need not be done to application program, and the local resource finger URL of local resource can be utilized to substitute
The same Resource Locator of identical network resource can be such that local resource is browsed instead of Internet resources, save due to browsing net
Network resource and the flow expended.
Brief description of the drawings
Fig. 1 is the flow chart of the collocation method of local resource described in the embodiment of the present invention 1.
Fig. 2 is the flow chart for the method that local resource finger URL is configured described in the embodiment of the present invention 2.
Fig. 3 is the flow chart for the method that local resource finger URL is configured described in the embodiment of the present invention 3.
Fig. 4 is the flow chart of the method for another configuration local resource finger URL described in the embodiment of the present invention 3.
Fig. 5 is the functional block diagram of the configuration device of local resource described in the embodiment of the present invention 4.
Fig. 6 is that the electronic equipment hardware configuration for the collocation method for being used to perform local resource described in the embodiment of the present invention 9 shows
It is intended to.
Embodiment
Embodiment 1
The collocation method of local resource described in the present embodiment, applied in terminal device, its flow is as shown in Figure 1, bag
Include step:
S101, obtains the master catalogue of local ip address and its binding.IP address is Internet protocol address, it is internet
On each equipment distribute a unique logical address, corresponding equipment can uniquely be found by IP address, described
Ground IP address is the logical address of this terminal device in a network.The master catalogue is the Yong Hushe before local resource is configured
Fixed local path, and bound with local ip address, i.e., local ip address is directed toward master catalogue.
S102, is that local resource under master catalogue configures local resource finger URL according to the local ip address, described
Ground Resource Locator has identical name form with universal resource locator.The universal resource locator (URL), being pair can be with
The position of the resource obtained from internet and a kind of succinct expression of access method, its Chinese base noun form for pattern (or
Claim agreement), domain name (or IP address), path (store path of the resource in the webserver) and resource name, such as
http:In //item.btime.com/lc05_iscms/201609/29/3624.jpg, http is hypertext transfer protocol,
Item.btime.com is domain name, and lc05_iscms/201609/29 is network storage path, and 3624.jpg is resource name, its
In, in Configuration network server, the IP address binding of domain name and the webserver, i.e., can parse domain name by DNS service
Corresponding IP address, and domain name is also bound with network master catalogue, therefore the network storage path is relative to network master catalogue
Relative path;The local resource finger URL is configured using local IP, name form and the universal resource locator
Name form identical, be in the position and access method being locally stored, such as local IP for characterizing local resource
124.202.216.210, if the master catalogue of local ip address binding is the D1 files of local D disks, and local D disk D1 files
Middle the entitled 123.jpg of its file, i.e. the storage catalogue of this document is identical with master catalogue there are certain local resource, then this is locally provided
The local resource finger URL in source can be configured as http://124.202.216.210/123.jpg.If file 123.jpg is deposited
The path of storage is D:/ D1/D2, this document are stored under master catalogue, then this document with respect to master catalogue opposite store path for/
D2, then its local resource finger URL is http://124.202.216.210/D2/123.jpg.If file 123.jpg is located at C
Disk, then this document can not be configured not under master catalogue.
In general, the network program installed in terminal device, need to connect network and be communicated with the webserver, could be obtained
Service, such as video jukebox software, these network programs will not call local resource in the case of no setting.Based on above-mentioned
Method, network program can call local resource by local resource finger URL, and network program can also be asked to the webserver at the same time
Online resource is sought, such local resource and online resource coexist, and the display side of the display mode of local resource and online resource
Formula is identical, and user can browse local resource as browsing online resource, improves the mode for browsing local resource, and save
Flow.
The collocation method of local resource described in the present embodiment, is matched somebody with somebody by local ip address for the local resource under master catalogue
Local resource finger URL is put, the local resource finger URL has identical name form with universal resource locator, makes local money
Source can be browsed with Internet resources using same way, and save the flow expended due to browse network resource.
Embodiment 2
The method for configuring local resource finger URL for local resource has many kinds, as shown in Fig. 2, to match somebody with somebody described in the present embodiment
The flow chart of the method for local resource finger URL is put, including:
S201, obtains the universal resource locator corresponding with local resource to prestore, is wrapped in the universal resource locator
Network storage path and network ip address containing local resource.The local resource is the resource downloaded from the webserver,
During local resource is downloaded, its corresponding universal resource locator can be stored, is included in the universal resource locator
Network storage path be local resource Relative Network master catalogue in the webserver opposite store path, and the unification
The network ip address included in Resource Locator is the IP address of the webserver, the network ip address and the network argument
Record binding.
S202, obtain local resource is locally stored path.The path that is locally stored is exhausted since local disk
To store path, such as D:/D1/D2.
S203, is locally stored path according to the master catalogue and local resource, obtains the opposite road of the local resource
Footpath.Since the local resource is located under master catalogue, therefore it there will necessarily be the relative path of local resource.Such as master catalogue is
D:/ D1, the storage location of certain local resource is D:/ D1/D2/D3, then the relative position of the resource is /D2/D3.
S204, if the opposite store path of local resource is identical with the network storage path, utilizes the local IP
The network ip address in the universal resource locator is replaced in address, obtains local resource finger URL.When be locally stored path with
When network storage path is identical, it need to only utilize the network ip address in local ip address modification universal resource locator i.e. available
Local resource finger URL.
For example, the corresponding universal resource locator of local resource is http://item.btime.com/123.jpg, wherein
Item.btime.com is domain name, by DNS service, can parse the corresponding IP address of domain name, while domain name is also bundled with network
Master catalogue, i.e. domain name are directed toward network master catalogue, therefore the storage of this document is understood by the universal resource locator of file 123.jpg
Path is master catalogue, and local resource is also master catalogue in local opposite store path, therefore will use local ip address
124.202.216.210 replacing the domain name item.btime.com in universal resource locator, obtaining local resource finger URL is
http://124.202.216.210/123.jpg.For another example the corresponding universal resource locator of local resource is http://
Item.btime.com/D2/D3/123.jpg, its network storage path are /D2/D3, and local resource is in local opposite storage
Path is also /D2/D3, therefore by the network IP replaced with local ip address 124.202.216.210 in universal resource locator
Location item.btime.com, it is http to obtain local resource finger URL://124.202.216.210/D2/D3/123.jpg.
S205, if the opposite store path of local resource is different from the network storage path, utilizes the local IP
The network ip address in the universal resource locator is replaced in address, obtains local resource finger URL, and stores the local money
Source finger URL and the correspondence that path and resource name is locally stored.
In the step, only with local ip address alternative network IP address or domain name, obtained local resource finger URL, its
In store path and the actual opposite store path of local resource differ, in order to ensure according to should be with the local postponed
Resource Locator can call the local resource, can store local resource finger URL and path and resource name is locally stored with described
Correspondence, i.e., when transferring the local resource finger URL, can be found according to correspondence and path is locally stored, so as to adjust
Use local resource.
In the above method, by acquisition universal resource locator corresponding with local resource, the net of local resource is obtained
Network store path and network ip address, network storage path store path opposite with local resource are compared, when both
When identical, then need to replace local ip address into the network ip address in universal resource locator, you can obtain local resource positioning
Symbol.The above method, can obtain local resource finger URL by simple replacement operation.And even if network storage path and local
Store path is different, can also store the correspondence being locally stored between path and local resource finger URL, make the two progress
Association, local resource can be found when calling local resource finger URL according to correspondence.
Embodiment 3
As shown in figure 3, to configure the flow chart of the method for local resource finger URL described in the present embodiment, including:
S301, obtains the universal resource locator corresponding with local resource to prestore, is wrapped in the universal resource locator
Network storage path and network ip address containing local resource.The local resource is the resource downloaded from the webserver,
During local resource is downloaded, its corresponding universal resource locator can be stored, is included in the universal resource locator
Network ip address be the webserver IP address.
S302, replaces the network ip address in the universal resource locator using local ip address, obtains local resource
Finger URL, and store the local resource finger URL and the correspondence that path and resource name is locally stored.
In the above method, only with local ip address alternative network IP address or domain name, obtained local resource finger URL,
Store path therein may be with local resource actual opposite store path differ, it is also possible to it is identical, only need to store this
Ground Resource Locator and the correspondence that path and resource name is locally stored, you can realize by transferring the local resource
Finger URL calls local resource.
As shown in figure 4, be the flow chart of the method for another configuration local resource finger URL described in the present embodiment, including:
S301A, obtain local resource is locally stored path.The path that is locally stored is exhausted since local disk
To store path, such as D:/D1/D2.
S302A, path is locally stored according to the master catalogue and local resource, is obtained the opposite of the local resource and is deposited
Store up path.Since the local resource is located under master catalogue, therefore it there will necessarily be the relative path of local resource.Such as master catalogue
For D:/ D1, the storage location of certain local resource is D:/ D1/D2/D3, then the relative position of the resource is /D2/D3.
S303A, local resource positioning is obtained according to opposite store path, the resource name of local ip address and local resource
Symbol.
Such as local IP is 124.202.216.210, if the master catalogue that local ip address is directed toward is the D1 files of local D disks
Folder, and there are certain local resource in the D disk D1 files of local, the entitled 123.jpg of its file, i.e., this document is under master catalogue, then
The local resource finger URL of the local resource can be configured as http://124.202.216.210/123.jpg.If file
The path of 123.jpg storages is D:/ D1/D2, this document are located under master catalogue, then opposite storage road of this document with respect to master catalogue
Footpath is /D2, then its local resource finger URL is http://124.202.216.210/D2/123.jpg.If file 123.jpg
In C disks, then this document can not configure not under master catalogue.
In the above method, directly pass through the title of local ip address, the opposite store path and local resource of local resource
Local resource finger URL is configured for the local resource under master catalogue, can be directly by calling the local resource obtained by the above method
Finger URL calls corresponding local resource.
Embodiment 4
The present embodiment provides a kind of configuration device of local resource, its structure as shown in figure 5, including
Acquiring unit 401, obtains the master catalogue of local ip address and its binding.IP address is Internet protocol address, it
A unique logical address is distributed for each equipment on internet, corresponding set can uniquely be found by IP address
It is standby.
Finger URL dispensing unit 402, according to the local ip address, local resource finger URL, institute are configured for local resource
State local resource finger URL has identical name form with universal resource locator.By the above method, network journey only need to be changed
Domain name in the request that sequence is sent, i.e., be revised as local ip address by domain name, you can provides local resource, network to network program
Program can also coexist to web server requests online resource, such local resource and online resource at the same time, and local resource
Display mode is identical with the display mode of online resource, and user can browse local resource as browsing online resource, improves
Browse the mode of local resource, and save flow.
The present embodiment described device, the master catalogue of local ip address and its binding, positioning are obtained by IP acquiring units 401
Dispensing unit 402 is accorded with by local ip address, is that the local resource under master catalogue configures local resource finger URL, makes to be stored in this
The network program on ground can directly quote local resource, if the program at the same time citation network resource, it can be achieved that the on-line off-line fusion of line
Purpose, and saved the flow expended due to browse network resource.
Embodiment 5
Being embodied as the method for local resource configuration local resource finger URL has many kinds, therefore is configured by the finger URL single
Member 402 is additionally operable to:
The universal resource locator corresponding with local resource to prestore is obtained, is included in the universal resource locator local
The network storage path of resource and network ip address;
Obtain local resource is locally stored path;
Path is locally stored according to the master catalogue and local resource, obtains the relative path of the local resource;
If the opposite store path of local resource is identical with the network storage path, replaced using the local ip address
The network ip address in the universal resource locator is changed, obtains local resource finger URL;
The opposite store path of local resource is different from the network storage path, then is replaced using the local ip address
Network ip address in the universal resource locator, obtains local resource finger URL, and stores the local resource finger URL
With the correspondence that path and resource name is locally stored.
In the above method, by acquisition universal resource locator corresponding with local resource, the net of local resource is obtained
Network store path and network ip address, network storage path is compared with the relative local store path of local resource, when
When both are identical, then need to replace local ip address into the network ip address in universal resource locator, you can obtain local resource
Finger URL.By the above method, local resource finger URL can be obtained by simple replacement operation.And even if network storage road
Footpath can also store the correspondence being locally stored between path and local resource finger URL, make from being locally stored that path is different
The two is associated, and local resource can be found according to correspondence when calling local resource finger URL.
Embodiment 6
On the basis of embodiment 4, finger URL dispensing unit described in the present embodiment 402 is additionally operable to:
The universal resource locator corresponding with local resource to prestore is obtained, is included in the universal resource locator local
The network storage path of resource and network ip address;
The network ip address in the universal resource locator is replaced using local ip address, obtains local resource positioning
Symbol, and store the local resource finger URL and the correspondence that path and resource name is locally stored.
In the above method, the network that local resource is obtained by the corresponding universal resource locator of the local resource to prestore is deposited
Path and network ip address are stored up, and the network ip address in universal resource locator is replaced using local ip address, obtains local
Resource Locator, while local resource finger URL and the correspondence of local resource store path and its resource name are stored, such as
This can practise, and that calls local resource to pass through the above method by local resource finger URL.
On the basis of embodiment 4, finger URL dispensing unit described in the present embodiment 402 is additionally operable to:
Obtain local resource is locally stored path;
Path is locally stored according to the master catalogue and local resource, obtains the opposite storage road of the local resource
Footpath;
Local resource finger URL is obtained according to opposite store path, the resource name of local ip address and local resource.
In the above method, directly pass through the title of local ip address, the opposite store path and local resource of local resource
Local resource finger URL is configured for the local resource under master catalogue, can be directly by calling the local resource obtained by the above method
Finger URL calls corresponding local resource.
Embodiment 8
The present embodiment provides a kind of nonvolatile computer storage media, the computer-readable storage medium is stored with computer
Executable instruction, the computer executable instructions can perform the collocation method of the local resource in above-mentioned any means embodiment.
Embodiment 9
Fig. 6 is the hardware architecture diagram of the electronic equipment of the collocation method of execution local resource provided in this embodiment,
As shown in fig. 6, the equipment includes:
One or more processors 901 and memory 902, in Fig. 6 by taking a processor 901 as an example.
Performing the equipment of the collocation method of local resource can also include:Input unit 903 and output device 904.
Processor 901, memory 902, input unit 903 and output device 904 can pass through bus or other modes
Connect, in Fig. 6 exemplified by being connected by bus.
Memory 902 is used as a kind of non-volatile computer readable storage medium storing program for executing, available for storage non-volatile software journey
Sequence, non-volatile computer executable program and module, such as the collocation method of the execution local resource in the embodiment of the present application
Corresponding programmed instruction/module (for example, acquiring unit 401 and finger URL dispensing unit 402 shown in attached drawing 5).Processor 901
Non-volatile software program, instruction and the module being stored in by operation in memory 902, so that execute server is various
Application of function and data processing, that is, realize the collocation method of the execution local resource of above method embodiment.
Memory 902 can include storing program area and storage data field, wherein, storing program area can store operation system
System, the required application program of at least one function;Storage data field can store the processing unit of the configuration according to local resource
Use created data etc..In addition, memory 902 can include high-speed random access memory, can also include non-easy
The property lost memory, a for example, at least disk memory, flush memory device or other non-volatile solid state memory parts.One
In a little embodiments, memory 902 is optional including relative to the remotely located memory of processor 901, these remote memories can
To pass through the processing unit of the configuration of network connection to local resource.The example of above-mentioned network includes but not limited to internet, enterprise
Industry in-house network, LAN, mobile radio communication and combinations thereof.
Input unit 903 can receive the numeral or character information of input, and produce the processing with the configuration of local resource
The key signals that the user setting and function control of device are related input.Output device 904 may include the display devices such as display screen.
One or more of modules are stored in the memory 902, when by one or more of processors
During 901 execution, the collocation method of the execution local resource in above-mentioned any means embodiment is performed.
The said goods can perform the method that the embodiment of the present application is provided, and possesses the corresponding function module of execution method and has
Beneficial effect.Not ins and outs of detailed description in the present embodiment, reference can be made to the method that the embodiment of the present application is provided.
The electronic equipment of the embodiment of the present invention exists in a variety of forms, includes but not limited to:
(1) mobile communication equipment:The characteristics of this kind equipment is that possess mobile communication function, and to provide speech, data
Communicate as main target.This Terminal Type includes:Smart mobile phone (such as iPhone), multimedia handset, feature mobile phone, and it is low
Hold mobile phone etc..
(2) super mobile personal computer equipment:This kind equipment belongs to the category of personal computer, there is calculating and processing work(
Can, generally also possess mobile Internet access characteristic.This Terminal Type includes:PDA, MID and UMPC equipment etc., such as iPad.
(3) portable entertainment device:This kind equipment can show and play content of multimedia.The kind equipment includes:Audio,
Video player (such as iPod), handheld device, e-book, and intelligent toy and portable car-mounted navigation equipment.
(4) server:The equipment for providing the service of calculating, the composition of server are total including processor, hard disk, memory, system
Line etc., server is similar with general computer architecture, but due to needing to provide highly reliable service, in processing energy
Power, stability, reliability, security, scalability, manageability etc. are more demanding.
(5) other have the function of the electronic device of data interaction.
Device embodiment described above is only schematical, wherein the unit illustrated as separating component can
To be or may not be physically separate, physics list is may or may not be as the component that unit is shown
Member, you can with positioned at a place, or can also be distributed in multiple network unit.It can be selected according to the actual needs
In some or all of module realize the purpose of this embodiment scheme.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can
Realized by the mode of software plus required general hardware platform, naturally it is also possible to pass through hardware.Based on such understanding, on
The part that technical solution substantially in other words contributes to the prior art is stated to embody in the form of software product, should
Computer software product can store in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD, including some fingers
Order is used so that a computer equipment (can be personal computer, server, or network equipment etc.) performs each implementation
Method described in some parts of example or embodiment.
Finally it should be noted that:The above embodiments are merely illustrative of the technical solutions of the present invention, rather than its limitations;Although
The present invention is described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that:It still may be used
To modify to the technical solution described in foregoing embodiments, or equivalent substitution is carried out to which part technical characteristic;
And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical solution spirit and
Scope.