The method and device of synchronous local resource and Internet resources
Technical field
The present invention relates to technical field of information processing, and in particular to it is a kind of synchronization local resource and Internet resources method and
Device.
Background technology
In existing terminal device, in order to save local flow, often some available resources are downloaded beforehand through network and delayed
Deposit to local, such as music, video, picture.But the renewal speed of Internet resources is very fast, local resource very likely with
Internet resources cannot be synchronous.For example, for a certain TV play, titbit fragment has been increased newly outside related collection of drama in Internet resources,
And only related collection of drama in local resource.And in the prior art when being synchronized to local resource, even only need portion
Point resource is updated download, can also be downloaded relevant all resources in network, influence synchronous efficiency.
The content of the invention
The embodiment of the present invention will solve to perform local resource and Internet resources efficiency low technology when synchronous in the prior art
Problem.
In order to solve the above technical problems, the embodiment of the present invention provides a kind of method of synchronous local resource and Internet resources,
Include the following steps:
The local the Resources list to be synchronized of generation, the Resources list record to be synchronized prestore corresponding with resource to be synchronized
Network characterization identifies;
Send described the Resources list to be synchronized;
Receive the Internet resources list returned in response to described the Resources list to be synchronized, the Internet resources list records net
The network characterization mark of network resource;
According to described the Resources list to be synchronized and the difference of the Internet resources list, the network characterization of definite more new resources
Mark;The download path of more new resources according to obtaining the network characterization of more new resources mark;
The more new resources according to being downloaded the download path, after more new resources are associated with its network characterization mark by described in
Cache to local.
Alternatively, in the method for above-mentioned synchronous local resource and Internet resources, the local the Resources list to be synchronized of generation, institute
In the step of stating network characterization corresponding with the resource to be synchronized mark that the Resources list record to be synchronized prestores:
Obtain the synchronization time of each local resource the last time;
Network characterization mark of the interval of the synchronization time and current time more than the local resource of predetermined threshold value is added
Enter described the Resources list to be synchronized.
Alternatively, in the method for above-mentioned synchronous local resource and Internet resources, the local the Resources list to be synchronized of generation, institute
In the step of stating network characterization corresponding with the resource to be synchronized mark that the Resources list record to be synchronized prestores:
Instructed in response to user's selection operation, determine selected local resource;
The network characterization mark of the selected local resource is added into described the Resources list to be synchronized.
Alternatively, in the method for above-mentioned synchronous local resource and Internet resources, according to being downloaded the download path
More new resources, caching is specifically included into local step after the more new resources are associated with its network characterization mark:
The download path of the more new resources is preserved to list to be downloaded;
Detect network environment;
When detecting available WiFi, more new resources are downloaded according to download path.
Alternatively, in the method for above-mentioned synchronous local resource and Internet resources, described the Resources list to be synchronized is sent
In step:
According to default synchronizing cycle, described the Resources list to be synchronized is periodically sent;Or refer in response to user's simultaneously operating
Order, sends described the Resources list to be synchronized.
Alternatively, in the method for above-mentioned synchronous local resource and Internet resources, following steps are further included:
According to described the Resources list to be synchronized and the difference of the Internet resources list, determine have and network in local resource
The resource not having in resource, it is deleted from local resource.
Alternatively, in the method for above-mentioned synchronous local resource and Internet resources, the network characterization mark includes corresponding to
The URL information of resource.
The embodiment of the present invention also provides a kind of device of synchronous local resource and Internet resources, including:
List Generating Module to be synchronized, the local the Resources list to be synchronized of generation, the Resources list record to be synchronized prestore
Network characterization corresponding with resource to be synchronized mark;
Sending module, sends described the Resources list to be synchronized;
Internet resources list reception module, receives the Internet resources list returned in response to described the Resources list to be synchronized,
The network characterization mark of the Internet resources list records Internet resources;
Resource determination module is updated, according to described the Resources list to be synchronized and the difference of the Internet resources list, is determined
The network characterization mark of more new resources;The download road of more new resources according to obtaining the network characterization of more new resources mark
Footpath;
Download module, the more new resources according to being downloaded the download path, more new resources and its network characterization by described in
Cached after mark association to local.
Alternatively, in the device of above-mentioned synchronous local resource and Internet resources, the List Generating Module tool to be synchronized
Body is used for:
Obtain the synchronization time of each local resource the last time;
Network characterization mark of the interval of the synchronization time and current time more than the local resource of predetermined threshold value is added
Enter described the Resources list to be synchronized.
Alternatively, in the device of above-mentioned synchronous local resource and Internet resources, the List Generating Module tool to be synchronized
Body is used for:
Instructed in response to user's selection operation, determine selected local resource;
The network characterization mark of the selected local resource is added into described the Resources list to be synchronized.
Alternatively, in the device of above-mentioned synchronous local resource and Internet resources, the download module is specifically used for:
The download path of the more new resources is preserved to list to be downloaded;
Detect network environment;
When detecting available WiFi, more new resources are downloaded according to download path.
Alternatively, in the device of above-mentioned synchronous local resource and Internet resources, the sending module is specifically used for:
According to default synchronizing cycle, described the Resources list to be synchronized is periodically sent;Or refer in response to user's simultaneously operating
Order, sends described the Resources list to be synchronized.
Alternatively, in the device of above-mentioned synchronous local resource and Internet resources, further include:
Removing module, according to described the Resources list to be synchronized and the difference of the Internet resources list, determines local resource
In the resource that has and do not have in Internet resources, it is deleted from local resource.
Alternatively, in the device of above-mentioned synchronous local resource and Internet resources, the network characterization mark includes corresponding to
The URL information of resource.
Compared with prior art, above-mentioned technical proposal provided in an embodiment of the present invention at least has the advantages that:
The method and device of synchronization local resource and Internet resources provided in an embodiment of the present invention, the local money to be synchronized of generation
Source list, network characterization corresponding with the resource to be synchronized mark that the Resources list record to be synchronized prestores;Receive Internet resources row
Table, the network characterization mark of Internet resources list records Internet resources;Treat same using network characterization mark as basis, judgement is compared
Difference of the Resources list with corresponding Internet resources list is walked, the network characterization mark of more new resources is determined, further determines that more
The download path of new resources, is downloaded more new resources according to download path, and more new resources are closed with its network characterization mark
Cached after connection to local.Identifying judgement by resource network can automatically and accurately determine Internet resources compared with resource to be synchronized
With which more new content, the repeated downloads to same asset are avoided, effectively improve synchronous efficiency.
Brief description of the drawings
Fig. 1 is the flow chart of the method for synchronous local resource and Internet resources described in one embodiment of the invention;
Fig. 2 is the implementation method flow chart of step S101 in Fig. 1 provided by one embodiment of the present invention;
Fig. 3 is another implementation method flow chart of step S101 in Fig. 1 provided by one embodiment of the present invention;
Fig. 4 is the implementation method flow chart of step S105 in Fig. 1 provided by one embodiment of the present invention;
Fig. 5 is the functional block diagram of the device of synchronous local resource and Internet resources described in one embodiment of the invention;
Fig. 6 is the functional block diagram of the device of synchronous local resource and Internet resources described in another embodiment of the present invention;
Fig. 7 is the electronic equipment for the method that synchronous local resource and Internet resources are performed described in one embodiment of the invention
Hardware configuration connection relationship diagram.
Embodiment
Embodiment 1
The present embodiment provides a kind of method of synchronous local resource and Internet resources, applied in terminal device, such as Fig. 1 institutes
Show, include the following steps:
S101:The local the Resources list to be synchronized of generation, the Resources list record to be synchronized are prestoring with resource to be synchronized
Corresponding network characterization mark;Under normal circumstances, local resource is downloaded from network, is downloading a certain Internet resources
When, it can know network characterization mark corresponding with the resource, such as network storage path, the network name of resource, resource
Download path etc., a part of this category information as local resource attribute information, together stores with local resource.This step
In, determine to need the resource to be synchronized synchronized, generation cache resources are identified according to the network characterization of each resource to be synchronized
List.Preferably, the network characterization mark includes URL (the Uniform Resource Locator of corresponding resource:Unified money
Source finger URL) information.
S102:Send described the Resources list to be synchronized;I.e. terminal device sends synchronization request, network clothes to the webserver
After business device gets the request, to the newest Internet resources row corresponding with described the Resources list to be synchronized of terminal device feedback
Table.For the synchronization time of local resource, can be realized by way of the pre-determined synchronization cycle, such as setting synchronization in one week is once,
Then often once described the Resources list to be synchronized is sent by week age.Synchronization time can also be voluntarily selected by user, such as
User determines that the resource of a certain TV play is updated on every Wendesdays, then the simultaneously operating for the TV play resource may be set to often
Wednesday carries out automatically, or user voluntarily triggers the simultaneously operating of the TV play resource in Wednesday.
S103:Receive the Internet resources list returned in response to described the Resources list to be synchronized, the Internet resources list
Record the network characterization mark of Internet resources;Such as step S101, network characterization mark may include network storage path, the net of resource
Network title, the information such as download path of resource.
S104:According to described the Resources list to be synchronized and the difference of the Internet resources list, the net of definite more new resources
Network signature identification;The download path of more new resources according to obtaining the network characterization of more new resources mark;According to network
Whether signature identification is identical, judges whether the Internet resources in the Internet resources list are buffered to local.If network
The a certain network characterization mark included in the Resources list, is searched less than then can determine that the network characterization in cache resources list
It is more new resources to identify corresponding Internet resources.
S105:The more new resources according to being downloaded the download path, more new resources are identified with its network characterization by described in
Cached after association to local.In this step, more new resources are associated with its network characterization mark and may be selected the network by described in
A part of the signature identification as the attribute information of resource.Interrelational form can be configured according to actual needs, it is preferable that
All local cache resources are identical with the interrelational form that map network identifies.
In above-mentioned steps, Internet resources list and the Resources list to be synchronized, can use same form, such as be form shape
Formula, the information such as resource name, store path, network characterization mark are recorded in form.Or be all tree figure, setting
In shape structure chart, a resource is characterized with each node, the phases such as the node and resource name, store path, network characterization identify
Close.By taking video resource as an example, according to different criteria for classifications under a video website, resource is divided into different special topics, Mei Yizhuan
Topic is lower to include multiple special editions again, includes multiple videos again under each special edition., can be very if list is arranged to tree
Clearly the special edition resource where definite each video resource, each video resource and the special topic money where each special edition resource
Source, facilitates comparing to handle, and can improve comparison efficiency.
The such scheme of the present embodiment, identifying judgement by resource network can automatically and accurately determine Internet resources with treating
Isochronous resources avoid the repeated downloads to same asset, effectively improve synchronous efficiency compared to having which more new content.
Embodiment 2
In the present embodiment, on the basis of embodiment 1, as shown in Fig. 2, step S101 can be realized in the following way:
S201:Obtain the synchronization time of each local resource the last time.
S202:By network characterization mark of the interval of the synchronization time and current time more than the local resource of predetermined threshold value
Know and add described the Resources list to be synchronized.
Determining the mode of resource to be synchronized has a variety of, can synchronize all resources of local cache, that is, judge
Each resource of local cache resource whether corresponding with network is consistent.A certain specific resources can also artificially be selected
Synchronize.Either it is divided into several groups to local resource to synchronize for one of which or several groups of resources every time.Therefore it is all
Local resource, may have different synchronization times, at this time can use Fig. 2 shown in scheme, for synchronization time earlier
Some resource priorities synchronize processing.Such as given threshold selected as 3 days, then for synchronizing processing within those 3 days
Local resource, can wouldn't synchronize operation.
This implementation also provides another method and realizes step S101, as shown in Figure 3:
S301:Instructed in response to user's selection operation, determine selected local resource;
S302:The network characterization mark of the selected local resource is added into described the Resources list to be synchronized.
I.e. user voluntarily selects resource to be synchronized, such as user to have selected TV play A, star's atlas according to the demand of oneself
B is synchronized, remaining local resource wouldn't be synchronous, can better meet the demand and preference of user.
Embodiment 3
For mobile phone, tablet computer, vehicular amusement apparatus etc., it can not access the WiFi for disregarding flow in real time, into
If carrying out resource downloading using local flow during row resource updates, higher expense will certainly be produced, to avoid the above problem,
As shown in figure 4, S105 can be realized in the following way:
S401:The download path of the more new resources is preserved to list to be downloaded.
S402:Detect network environment.
S403:Whether available WiFi is detected, if then entering step S404, otherwise return to step S402.
S404:More new resources are downloaded according to download path.
The download path of more new resources is preserved first, down operation is triggered again when detecting available WiFi, avoids wasting
Local flow.
Embodiment 4
On the basis of any of the above-described embodiment, the present embodiment further includes following steps:Arranged according to the resource to be synchronized
The difference of table and the Internet resources list, determines the resource for having and not having in Internet resources in local resource, by it from local
Deleted in resource.
Identify judgement by resource network and can automatically and accurately determine to have deleted in Internet resources still has and local
The resource of caching, these resources are deleted from local resource, make related resource synchronous with Internet resources but also can be effective
Discharge local cache space.
Embodiment 5
As shown in figure 5, the present embodiment provides a kind of synchronous local resource and the device of Internet resources, including:
List Generating Module 501 to be synchronized, the local the Resources list to be synchronized of generation, the Resources list record to be synchronized are pre-
Network characterization corresponding with the resource to be synchronized mark deposited;Under normal circumstances, local resource is downloaded from network, under
When carrying a certain Internet resources, it can know corresponding with resource network characterization mark, such as network storage path, resource
The download path etc. of network name, resource, this category information can be as a part for local resource attribute information.This step
In, determine to need the resource to be synchronized synchronized, generation cache resources are identified according to the network characterization of each resource to be synchronized
List.Preferably, the network characterization mark includes URL (the Uniform Resource Locator of corresponding resource:Unified money
Source finger URL) information.
Sending module 502, sends described the Resources list to be synchronized;I.e. terminal device sends synchronous ask to the webserver
Ask, after the webserver gets the request, fed back to terminal device newest corresponding with described the Resources list to be synchronized
Internet resources list.It for the synchronization time of local resource, can be realized, such as set one week by way of the pre-determined synchronization cycle
Synchronously once, then often once described the Resources list to be synchronized is sent by week age.Synchronization can also voluntarily be selected by user
Time, such as user determine that the resource of a certain TV play is updated on every Wendesdays, then for the simultaneously operating of the TV play resource
It may be set to carry out on every Wendesdays.Or user voluntarily triggers the simultaneously operating of the TV play resource in Wednesday.
Internet resources list reception module 503, receives the Internet resources returned in response to described the Resources list to be synchronized and arranges
Table, the network characterization mark of the Internet resources list records Internet resources;Network characterization mark may include network storage path,
The information such as the network name of resource, the download path of resource.
Resource determination module 504 is updated, according to the difference of described the Resources list to be synchronized and the Internet resources list, really
The network characterization mark of fixed more new resources;The download of more new resources according to obtaining the network characterization of more new resources mark
Path;Identified whether according to network characterization identical, judge whether the Internet resources in the Internet resources list are buffered extremely
It is local.If a certain network characterization mark included in Internet resources list, is searched less than then can be true in cache resources list
It is more new resources that the fixed network characterization, which identifies corresponding Internet resources,.
Download module 505, the more new resources according to being downloaded the download path, more new resources and its network are special by described in
Cached after sign mark association to local.More new resources are associated with its network characterization mark and may be selected the network characterization by described in
Identify a part for the attribute information as resource.Interrelational form can be configured according to actual needs, it is preferable that all
Local cache resource is identical with the interrelational form that map network identifies.
In such scheme, Internet resources list and the Resources list to be synchronized, can use same form, such as be form shape
Formula, the information such as resource name, store path, network characterization mark are recorded in form.Or be all tree figure, setting
In shape structure chart, a resource is characterized with each node, the phases such as the node and resource name, store path, network characterization identify
Close.By taking video resource as an example, according to different criteria for classifications under a video website, resource is divided into different special topics, Mei Yizhuan
Topic is lower to include multiple special editions again, includes multiple videos again under each special edition., can be very if list is arranged to tree
Clearly the special edition resource where definite each video resource, each video resource and the special topic money where each special edition resource
Source, facilitates comparing to handle, and can improve comparison efficiency.
The such scheme of the present embodiment, identifying judgement by resource network can automatically and accurately determine Internet resources with treating
Isochronous resources avoid the repeated downloads to same asset, effectively improve synchronous efficiency compared to having which more new content.
As a kind of optional implementation, the List Generating Module 501 to be synchronized is specifically used for:
Obtain the synchronization time of each local resource the last time;
Network characterization mark of the interval of the synchronization time and current time more than the local resource of predetermined threshold value is added
Enter described the Resources list to be synchronized.
Determining the mode of resource to be synchronized has a variety of, can synchronize all resources of local cache, that is, judge
Each resource of local cache resource whether corresponding with network is consistent.A certain specific resources can also artificially be selected
Synchronize.Either it is divided into several groups to local resource to synchronize for one of which or several groups of resources every time.Therefore it is all
Local resource, may have different synchronization times, at this time can use Fig. 2 shown in scheme, for synchronization time earlier
Some resource priorities synchronize processing.Such as given threshold selected as 3 days, then for synchronizing processing within those 3 days
Local resource, can wouldn't synchronize operation.
As another optional implementation, the List Generating Module 501 to be synchronized is specifically used for:
Instructed in response to user's selection operation, determine selected local resource;
The network characterization mark of the selected local resource is added into described the Resources list to be synchronized.
I.e. user voluntarily selects resource to be synchronized, such as user to have selected TV play A, star's atlas according to the demand of oneself
B is synchronized, remaining local resource wouldn't be synchronous, can better meet the demand and preference of user.
The present embodiment also provides a kind of downloading mode for having saved flow, and the download module 505 is specifically used for:
The download path of the more new resources is preserved to list to be downloaded;
Detect network environment;
When detecting available WiFi, more new resources are downloaded according to download path.
For mobile phone, tablet computer, vehicular amusement apparatus etc., it can not access the WiFi for disregarding flow in real time, into
If carrying out resource downloading using local flow during row resource updates, higher expense will certainly be produced, such scheme is protected first
The download path of more new resources is deposited, down operation is triggered again when detecting available WiFi, avoids wasting local flow.
As a preferred embodiment, as shown in fig. 6, described device further includes removing module 506, according to the money to be synchronized
The difference of source list and the Internet resources list, determines the resource for having and not having in Internet resources in local resource, by its from
Deleted in local resource.Identifying judgement by resource network can automatically and accurately determine to have deleted in Internet resources and local
Still there is the resource of caching, these resources are deleted from local resource, make related resource synchronous with Internet resources and can also
Enough effectively release local cache spaces.
Embodiment 6
The embodiment of the present application provides a kind of nonvolatile computer storage media, and the computer-readable storage medium is stored with
Computer executable instructions, the computer executable instructions can perform synchronous local resource in above-mentioned any means embodiment with
The method of Internet resources.
Embodiment 7
Fig. 6 is the hardware knot of the electronic equipment of the method provided in this embodiment for performing synchronous local resource and Internet resources
Structure schematic diagram, the equipment include:
One or more processors 601 and memory 602, in Fig. 6 by taking a processor 601 as an example.
Performing the equipment of the method for synchronous local resource and Internet resources can also include:Input unit 603 and output fill
Put 604.
Processor 601, memory 602, input unit 603 and output device 604 can pass through bus or other modes
Connect, in Fig. 6 exemplified by being connected by bus.
Memory 602 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 synchronous local resource and Internet resources in the embodiment of the present application
The corresponding programmed instruction/module of method (for example, List Generating Module to be synchronized 501, sending module 502 shown in attached drawing 5,
Internet resources list reception module 503, renewal resource determination module 504, download module 505).Processor 601 is deposited by operation
Storage non-volatile software program, instruction and module in the memory 602, thus the various function application of execute server with
And data processing, that is, the method for realizing the synchronous local resource and Internet resources of above method embodiment.
Memory 602 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 be stored according to synchronous local resource and Internet resources
Device uses created data etc..In addition, memory 602 can include high-speed random access memory, can also include
Nonvolatile memory, for example, at least a disk memory, flush memory device or other non-volatile solid state memory parts.
In certain embodiments, memory 602 is optional including relative to the remotely located memory of processor 601, these long-range storages
Device can pass through network connection to synchronous local resource and the device of Internet resources.The example of above-mentioned network is including but not limited to mutual
Networking, intranet, LAN, mobile radio communication and combinations thereof.
Input unit 603 can receive the numeral or character information of input, and produce and provided with synchronous local resource and network
The key signals that the user setting and function control of the device in source are related input.Output device 604 may include that display screen etc. is shown
Equipment.
One or more of modules are stored in the memory 602, when by one or more of processors
601 when performing, the method that performs the synchronous local resource and Internet resources in above-mentioned any means embodiment.
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.