CN108008984A - A kind of resource file downloading updating method and device - Google Patents

A kind of resource file downloading updating method and device Download PDF

Info

Publication number
CN108008984A
CN108008984A CN201711132054.3A CN201711132054A CN108008984A CN 108008984 A CN108008984 A CN 108008984A CN 201711132054 A CN201711132054 A CN 201711132054A CN 108008984 A CN108008984 A CN 108008984A
Authority
CN
China
Prior art keywords
resource file
file
resource
key
caching
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201711132054.3A
Other languages
Chinese (zh)
Inventor
汪刚
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201711132054.3A priority Critical patent/CN108008984A/en
Publication of CN108008984A publication Critical patent/CN108008984A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44505Configuring for program initiating, e.g. using registry, configuration files
    • G06F9/4451User profiles; Roaming
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Storage Device Security (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The present invention provides a kind of resource file downloading updating method and device, the described method includes:S1, in application program launching, obtains the configuration file of first resource file;S2, if the key of first resource file is not present in the key for the Secondary resource file downloaded in advance in caching in the configuration file, is downloaded the first resource file;S3, the url of the first resource file is encrypted using the key of the first resource file, obtains the storage catalogue of the first resource file, is stored the first resource file of download into the caching according to the storage catalogue.The present invention is only downloaded the first resource file for not having to download in configuration file, and the first resource file preservation downloaded is in the buffer, and next time directly calls from caching, greatly reduces flow consumption, and convenient fast reading is read.

Description

A kind of resource file downloading updating method and device
Technical field
The invention belongs to application and development field, more particularly, to a kind of resource file downloading updating method and device.
Background technology
With the development of network interaction platform, more and more users are exchanged by logging in network interaction platform.Such as Network direct broadcasting is the application being popular in users very much.In live period, user can carry out interactive, such as transmission bullet with main broadcaster Curtain message, to main broadcaster's gifts etc., so as to increase interest interactive between main broadcaster and user.
In the interaction of the network platform, many contents need to load from network, and the benefit downloaded from network is can be with Newest content is obtained in real time, but needs to consume customer flow.In interaction, it is often necessary to resource text is downloaded from network Part, consumption customer flow are more.The resource file includes video, picture etc..Especially user is in the case of mobile The resources such as the picture on network are downloaded, consume the mobile phone rate of user.As given, it is necessary to download user from network during live The picture of main broadcaster's gifts, for some pictures to add the dynamic picture of special efficacy, the flow of consumption is more.Need to obtain picture every time When be required for downloading from network.Even identical picture, it is required for re-downloading from network, consumes a large amount of flows.
Renewal and other reasons with application version, resource file can change needed for interaction, Such as increase new resources file, the part resource file in the original resource file of renewal and removal on the basis of original resource file Part resource file in original resource file etc..In the prior art required institute is re-downloaded when using application program every time There is resource file, consume substantial amounts of flow.
In conclusion when using application program every time in the prior art, required all resources are downloaded from network again File, consumes a large amount of flows.
The content of the invention
To overcome above-mentioned use every time to download required all resource files during application program from network again, consumption is big The problem of measuring flow solves the above problems at least in part, the present invention provides a kind of resource file downloading updating method and Device.
According to the first aspect of the invention, there is provided a kind of resource file downloading updating method, including:
S1, in application program launching, obtains the configuration file of first resource file;
S2, if the key of first resource file is not present in the Secondary resource downloaded in advance in caching in the configuration file In the key of file, then the first resource file is downloaded;
S3, the url of the first resource file is encrypted using the key of the first resource file, described in acquisition The storage catalogue of first resource file, stores the first resource file of download into the caching according to the storage catalogue.
Specifically, the step S2 is further included:
If the Secondary resource file that the key of first resource file is downloaded in advance in the buffer in the configuration file is close Exist in key, judge to whether there is the first resource under the storage catalogue of the first resource file;
If the first resource is not present under the storage catalogue of the first resource file, to the first resource file It is downloaded.
Specifically, the step S2 is further included:
If the key of Secondary resource file is not present in the configuration file in the key of first resource file in caching, Then it is removed from the cache the Secondary resource file.
Specifically, the key of the first resource file is used to the url of the first resource file in the step S3 It is encrypted, the step of storage catalogue for obtaining the first resource file specifically includes:
The url of the first resource file is encrypted using md5 encryption algorithm, obtains the first resource file institute The title of the file of storage;
The name of the file is referred to as to the privately owned catalogue of the first resource file, according to the privately owned catalogue and in advance If public directory generate the storage catalogue of the first resource file.
Specifically, the first resource file of download is stored into caching according to the storage catalogue in the step S3 Step specifically includes:
A cache management class is created, dictionary is created in the cache management class;
Key code to the dictionary is assigned a value of the preset characters string of the first resource file, and the value to the dictionary is assigned It is worth for the array of the first resource file, the corresponding url for being denoted as the first resource file of the dictionary;
According to the storage catalogue of the first resource file, by dictionary storage into caching.
Specifically, further included after the step S3:
If the first resource is obtained there are the first resource file under the storage catalogue of the first resource file The caching that file is stored;
If according to the url of the first resource file, the corresponding dictionaries of the url are got in the caching, then root The first resource file is obtained according to the dictionary.
Specifically, the step S3 further comprises:
If according to the url of the first resource file, the corresponding dictionaries of the url are not got in the caching, The first resource file is then searched according to the storage catalogue of the first resource file in a hard disk;
If there are the first resource file in the hard disk, the first resource file is read, while by described One resource file is stored into caching.
According to the second aspect of the invention, there is provided a kind of resource file downloads updating device, including:
Acquiring unit, in application program launching, obtaining the configuration file of first resource file;
Download unit, the key for the first resource file in the configuration file are not present in downloading in advance in caching Secondary resource file key in when, the first resource file is downloaded;
Updating block, is added for the url to the first resource file using the key of the first resource file It is close, the storage catalogue of the first resource file is obtained, is arrived the first resource file storage of download according to the storage catalogue In the caching.
According to the third aspect of the invention we, there is provided a kind of resource file downloads more new equipment, including:
At least one processor, at least one processor and bus;Wherein,
The processor and memory complete mutual communication by the bus;
The memory storage has the programmed instruction that can be performed by the processor, and the processor calls described program to refer to Order is able to carry out method as described before.
According to the fourth aspect of the invention, there is provided a kind of non-transient computer readable storage medium storing program for executing, for storing such as preceding institute State the computer program of method.
The present invention provides a kind of resource file downloading updating method and device, and this method in application program launching by sentencing In disconnected configuration file in the key for all Secondary resource files that the key of first resource file is downloaded in advance in the buffer whether In the presence of faster knowing which first resource file is not downloaded, the first resource file of no download be downloaded, by making Generation is encrypted to url with key to be used to store the first resource file of download to the storage catalogue in caching, ensure that The uniqueness and stationarity of storage catalogue, the present embodiment only carry out down the first resource file for not having to download in configuration file Carry, and the first resource file downloaded preserves in the buffer, next time directly calls from caching, greatly reduces flow consumption, Fast and easy is read.
Brief description of the drawings
Fig. 1 is resource file downloading updating method overall flow schematic diagram provided in an embodiment of the present invention;
Fig. 2 downloads updating device overall structure diagram for resource file provided in an embodiment of the present invention;
Fig. 3 downloads renewal equipment overall structure schematic diagram for resource file provided in an embodiment of the present invention.
Embodiment
With reference to the accompanying drawings and examples, the embodiment of the present invention is described in further detail.Implement below Example is used to illustrate the present invention, but is not limited to the scope of the present invention.
A kind of resource file downloading updating method is provided in one embodiment of the invention, and Fig. 1 is the embodiment of the present invention The resource file downloading updating method overall flow schematic diagram of offer, this method include:S1, in application program launching, obtains The configuration file of first resource file;S2, if the key of first resource file is not present in caching in advance in the configuration file In the key for the Secondary resource file first downloaded, then the first resource file is downloaded;S3, to first resource text The url of part is encrypted using the key of the first resource file, obtains the storage catalogue of the first resource file, according to The storage catalogue stores the first resource file of download into the caching.
Specifically, in S1, a configuration file can be all read when application program starts every time, the configuration file is one A list, the content of the inside storage can be array or dictionary.The configuration file is used to represent the application program by needs The resource file used.The resource file includes video, picture etc..The first resource file is what is represented in configuration file Need resource file to be used.Url (the uniform resource of the first resource file are included in the configuration file Locator, universal resource locator) corresponding key.In S2, the Secondary resource file is the resource downloaded before in caching File.The configuration file is read, the corresponding keys of url of each first resource file in the configuration file is obtained, obtains at the same time Take the key for all Secondary resource files downloaded in advance in caching.For each first resource file in configuration file, if The key of the first resource file is not present in the key of all Secondary resource files in the buffer, then is not present in explanation caching The first resource file is, it is necessary to be downloaded the first resource file.In S3, the url of the first resource file is used The key of the first resource file is encrypted, and obtains the storage catalogue of the first resource file.It will be downloaded according to storage catalogue First resource file store into caching.The key of each first resource file and the key of Secondary resource file are all unique 's.
The present embodiment is by judging the key of first resource file in configuration file in application program launching in the buffer It whether there is in the key for all Secondary resource files downloaded in advance, faster know which first resource file is not downloaded, The first resource file of no download is downloaded, generation is encrypted to url by using key and is used for the of download One resource file is stored to the storage catalogue in caching, ensure that the uniqueness and stationarity of storage catalogue, the present embodiment is only right The first resource file for not having to download in configuration file is downloaded, and the first resource file downloaded preserves in the buffer, under It is secondary directly to be called from caching, flow consumption is greatly reduced, fast and easy is read.
On the basis of above-described embodiment, step S2 described in the present embodiment further includes:If first in the configuration file Exist in the key for the Secondary resource file that the key of resource file is downloaded in advance in the buffer, judge the first resource file Storage catalogue under whether there is the first resource;If described first is not present under the storage catalogue of the first resource file Resource, then be downloaded the first resource file.
Specifically, if the Secondary resource text that the key of first resource file is downloaded in advance in the buffer in the configuration file Exist in the key of part, then illustrate the first resource file download mistake.Judge whether the first resource file is downloaded at this time Success, that is, whether there is the first resource under the storage catalogue for continuing to judge the first resource file.If first money The first resource is not present under the storage catalogue of source file, then illustrates that the first resource file does not download success, again The first resource file is downloaded.Specific to obtain resource file management device fm, the resource file management device is by obtaining Take the function defaultManager of the singleton of resource file management to obtain, while obtain do not have to download in configuration file first The storage catalogue topath of resource file.The resource file management device passes through resource file catalog function FileExistsAtPath judges to whether there is the first resource file under the storage catalogue of the first resource file, if not In the presence of then illustrating that the first resource file is not downloaded, the first resource file be downloaded.
On the basis of above-described embodiment, step S2 described in the present embodiment further includes:If Secondary resource file in caching Key be not present in the configuration file in the key of first resource file, then be removed from the cache Secondary resource text Part.
Specifically, for each Secondary resource file in caching, if the key of the Secondary resource file is described It is not present in configuration file in the key of all first resource files, then it is no longer application program institute to illustrate the Secondary resource file The resource file needed, deletes the Secondary resource file, so as to reduce saving memory space.
On the basis of above-described embodiment, the url of the first resource file is made in step S3 described in the present embodiment It is encrypted with the key of the first resource file, the step of storage catalogue for obtaining the first resource file specifically wraps Include:The url of the first resource file is encrypted using md5 encryption algorithm, the first resource file is obtained and is stored File title;The name of the file is referred to as to the privately owned catalogue of the first resource file, according to described privately owned Catalogue and default public directory generate the storage catalogue of the first resource file.
Specifically, if knowing, the first resource file in the configuration file is not downloaded in caching, to described One resource file is downloaded.It is typically all compressed package after being finished due to the first resource file download.Getting After the compressed package for stating first resource file, the compressed package is decompressed.Specially use file management class NSFileManager obtains the singleton object of a resource file management, and the first resource is obtained in the singleton object The storage catalogue of file.The storage catalogue is made of two parts, and first half is public directory, and latter half is privately owned mesh Record.The privately owned catalogue is the individualized section of the resource file of each download.By making to the url of the first resource file It is encrypted with md5 encryption algorithm, obtains the title for the file that the first resource file is stored.It is described so as to ensure that The uniqueness for the folder name that first resource file is stored, avoids unchartered coding.By the title of the file Privately owned catalogue as the first resource file.Since url generally compares fixation, by the first resource file Url is encrypted using md5 encryption algorithm, ensure that the corresponding storage catalogues of url of the first resource file are relatively more fixed, So as to improve the loading velocity of resource file.
On the basis of above-described embodiment, according to the storage catalogue by the of download in step S3 described in the present embodiment The storage of one resource file is specifically included to the step in caching:A cache management class is created, is created in the cache management class Build dictionary;Key code to the dictionary is assigned a value of the preset characters string of the first resource file, and the value to the dictionary is assigned It is worth for the array of the first resource file, the corresponding url for being denoted as the first resource file of the dictionary;According to described The storage catalogue of first resource file, by dictionary storage into caching.
Specifically, a cache management class DYZipGiftAnimationCache is created, is made in the cache management class Dictionary is created with the function NSMutableDictionary of dictionary class, using being that the method for dictionary assignment is in the dictionary The dictionary assignment, the key code to the dictionary is assigned a value of the preset characters string of the first resource file, to the dictionary Value be assigned a value of the array of the first resource file, the corresponding url for being denoted as the first resource file of the dictionary.Root According to the storage catalogue of the first resource file, by dictionary storage into caching.
On the basis of any of the above-described embodiment, further included after step S3 described in the present embodiment:If first money There are the first resource file under the storage catalogue of source file, then the caching that the first resource file is stored is obtained;If According to the url of the first resource file, the corresponding dictionaries of the url are got in the caching, then according to the dictionary Obtain the first resource file.
Specifically, when loading the first resource file, if there are institute under the storage catalogue of the first resource file First resource file is stated, then memory management class DYZipGiftAnimationCache passes through store function sharedCache in acquisition Get caching cache.After the caching cach is got, using the link url for downloading the first resource file, obtain Take the corresponding dictionaries of the url.If the dictionary exists, illustrate to have downloaded the first resource file and store Into caching.Key code in the dictionary takes out corresponding first resource file.
On the basis of above-described embodiment, step S3 described in the present embodiment further comprises:If according to described first The url of resource file, does not get the corresponding dictionaries of the url in the caching, then according to the first resource file Storage catalogue search the first resource file in a hard disk;If read in the hard disk there are the first resource file The first resource file is taken, while by first resource file storage into caching.
Specifically, if according to the url of the first resource file, the url is not got in the caching and is corresponded to Dictionary, then the first resource file is searched according to the storage catalogue of the first resource file in a hard disk.It is specifically defined One weak reference self, using one asynchronous task of dispatch_async function creations, obtains the Global Queue of reference program Dispatch_get_global_queue, while the priority of the Global Queue is set, use the default priority of Global Queue Level, i.e. DISPATCH_QUEUE_PRIORITY_DEFAULT.Management object file is obtained using defaultManager functions Fm, while obtain the storage catalogue topath of the first resource file.Use the method from storage catalogue load document ContentsOfDirectoryAtPath reads the content content under the storage catalogue topath of the first resource file, The first resource file for needing to load is obtained by the content, while by first resource file storage into caching, Easy to next quick reading.
In the present embodiment in the buffer no resource file when go in hard disk to read, if the money can be read from hard disk Source file, it is not required that re-download, so as to avoid repeated downloads, save flow, and meanwhile the resource read from hard disk is literary Part is stored into memory, convenient next time quick reading.
A kind of resource file is provided in another embodiment of the present invention and downloads updating device, Fig. 2 is implemented for the present invention The resource file that example provides downloads updating device overall structure diagram, which includes acquiring unit 1, download unit 2 and more New unit 3, wherein:
The acquiring unit 1 is used in application program launching, obtains the configuration file of first resource file;The download Unit 2 is used for the Secondary resource text that the key of first resource file in the configuration file is not present in downloading in advance in caching When in the key of part, the first resource file is downloaded;The updating block 3 is used for the first resource file Url is encrypted using the key of the first resource file, the storage catalogue of the first resource file is obtained, according to described Storage catalogue stores the first resource file of download into the caching.
Specifically, when application program starts every time, the acquiring unit 1 can all read a configuration file, the configuration File is a list, and the content of the inside storage can be array or dictionary.The configuration file applies journey for representing described Sequence will need resource file to be used.The resource file includes video, picture etc..The first resource file is configuration file The need resource file to be used of middle expression.Url (the uniform of the first resource file are included in the configuration file Resource locator, universal resource locator) corresponding key.The Secondary resource file is download before in caching Resource file.The download unit 2 reads the configuration file, obtains the url of each first resource file in the configuration file Corresponding key, while obtain the key for all Secondary resource files downloaded in advance in caching.For every in configuration file A first resource file, if the key of the first resource file is not present in the key of all Secondary resource files in the buffer, Then there is no the first resource file, it is necessary to be downloaded to the first resource file in explanation caching.The updating block 3 The url of the first resource file is encrypted using the key of the first resource file, obtains depositing for the first resource file Store up catalogue.The first resource file of download is stored into caching according to storage catalogue.The key of each first resource file and The key of two resource files is all unique.
The present embodiment is by judging the key of first resource file in configuration file in application program launching in the buffer It whether there is in the key for all Secondary resource files downloaded in advance, faster know which first resource file is not downloaded, The first resource file of no download is downloaded, generation is encrypted to url by using key and is used for the of download One resource file is stored to the storage catalogue in caching, ensure that the uniqueness and stationarity of storage catalogue, the present embodiment is only right The first resource file for not having to download in configuration file is downloaded, and the first resource file downloaded preserves in the buffer, under It is secondary directly to be called from caching, flow consumption is greatly reduced, fast and easy is read.
On the basis of above-described embodiment, download unit is additionally operable to described in the present embodiment:In the configuration file In the presence of in the key for the Secondary resource file that the key of one resource file is downloaded in advance in the caching, then described is judged It whether there is the first resource under the storage catalogue of one resource file;Do not deposited under the storage catalogue of the first resource file In the first resource, the first resource file is downloaded.
On the basis of the various embodiments described above, download unit is additionally operable to described in the present embodiment:Second in the caching When the key of resource file is not present in the configuration file in the key of first resource file, institute is deleted from the caching State Secondary resource file.
On the basis of the various embodiments described above, updating block is specifically used for described in the present embodiment:To the first resource The url of file is encrypted using md5 encryption algorithm, obtains the title for the file that the first resource file is stored;Will The name of the file is referred to as the privately owned catalogue of the first resource file, according to the privately owned catalogue and default public mesh Record generates the storage catalogue of the first resource file.
On the basis of the various embodiments described above, updating block is specifically used for described in the present embodiment:Create a caching pipe Class is managed, dictionary is created in the cache management class;Key code to the dictionary is assigned a value of the pre- of the first resource file If character string, the value to the dictionary is assigned a value of the array of the first resource file, the dictionary is corresponding be denoted as it is described The url of first resource file;According to the storage catalogue of the first resource file, by dictionary storage into the caching.
On the basis of the various embodiments described above, device further includes loading unit described in the present embodiment, for described It is slow there are during the first resource file, obtain that the first resource file stored under the storage catalogue of one resource file Deposit;When according to the url of the first resource file, the corresponding dictionaries of the url are got in the caching, then according to institute State dictionary and obtain the first resource file.
On the basis of above-described embodiment, loading unit is additionally operable to described in the present embodiment:According to the first resource The url of file, when the corresponding dictionaries of the url are not got in the caching, according to depositing for the first resource file Storage catalogue searches the first resource file in a hard disk;There are during the first resource file in the hard disk, institute is read First resource file is stated, while by first resource file storage into caching.
The present embodiment provides a kind of resource file to download more new equipment, and Fig. 3 is resource file provided in an embodiment of the present invention Renewal equipment overall structure schematic diagram is downloaded, which includes:At least one processor 31, at least one processor 32 and bus 33;Wherein,
The processor 31 and memory 32 complete mutual communication by the bus 33;
The memory 32 is stored with the programmed instruction that can be performed by the processor 31, and the processor calls the journey Sequence instruction is able to carry out the method that above-mentioned each method embodiment is provided, such as including:S1, in application program launching, obtains The configuration file of first resource file;S2, if the key of first resource file is not present in caching in advance in the configuration file In the key for the Secondary resource file first downloaded, then the first resource file is downloaded;S3, to first resource text The url of part is encrypted using the key of the first resource file, obtains the storage catalogue of the first resource file, according to The storage catalogue stores the first resource file of download into the caching.
The present embodiment provides a kind of non-transient computer readable storage medium storing program for executing, the non-transient computer readable storage medium storing program for executing Computer instruction is stored, the computer instruction makes the computer perform the method that above-mentioned each method embodiment is provided, example Such as include:S1, in application program launching, obtains the configuration file of first resource file;S2, if first in the configuration file The key of resource file is not present in the key for the Secondary resource file downloaded in advance in caching, then to first resource text Part is downloaded;S3, the url of the first resource file is encrypted using the key of the first resource file, obtains The storage catalogue of the first resource file, stores the first resource file of download to the caching according to the storage catalogue In.
One of ordinary skill in the art will appreciate that:Realizing all or part of step of above method embodiment can pass through The relevant hardware of programmed instruction is completed, and foregoing program can be stored in a computer read/write memory medium, the program Upon execution, the step of execution includes above method embodiment;And foregoing storage medium includes:ROM, RAM, magnetic disc or light Disk etc. is various can be with the medium of store program codes.
Resource file download renewal apparatus embodiments described above are only schematical, wherein described as separation The unit of part description may or may not be it is physically separate, can be as the component that unit is shown or It can not be physical location, you can with positioned at a place, or can also be distributed in multiple network unit.Can be according to reality Border needs to select some or all of module therein to realize the purpose of this embodiment scheme.Those of ordinary skill in the art In the case where not paying performing creative labour, you can to understand and implement.
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, the present processes are only preferable embodiment, are not intended to limit the scope of the present invention.It is all Within the spirit and principles in the present invention, any modification, equivalent replacement, improvement and so on, should be included in the protection of the present invention Within the scope of.

Claims (10)

  1. A kind of 1. resource file downloading updating method, it is characterised in that including:
    S1, in application program launching, obtains the configuration file of first resource file;
    S2, if the key of first resource file is not present in the Secondary resource file downloaded in advance in caching in the configuration file Key in, then the first resource file is downloaded;
    S3, the url of the first resource file is encrypted using the key of the first resource file, obtains described first The storage catalogue of resource file, stores the first resource file of download into the caching according to the storage catalogue.
  2. 2. according to the method described in claim 1, it is characterized in that, the step S2 is further included:
    If in the configuration file key of first resource file be present in caching in download in advance Secondary resource file it is close In key, then judge to whether there is the first resource under the storage catalogue of the first resource file;
    If the first resource is not present under the storage catalogue of the first resource file, the first resource file is carried out Download.
  3. 3. according to the method described in claim 1, it is characterized in that, the step S2 is further included:
    If the key of Secondary resource file is not present in the configuration file in the key of first resource file in the caching, The Secondary resource file is then deleted from the caching.
  4. 4. according to the method described in claim 1, it is characterized in that, to the url of the first resource file in the step S3 It is encrypted using the key of the first resource file, the step of storage catalogue for obtaining the first resource file specifically wraps Include:
    The url of the first resource file is encrypted using md5 encryption algorithm, the first resource file is obtained and is stored File title;
    The name of the file is referred to as to the privately owned catalogue of the first resource file, according to the privately owned catalogue and default Public directory generates the storage catalogue of the first resource file.
  5. 5. according to the method described in claim 1, it is characterized in that, according to the storage catalogue by download in the step S3 The storage of first resource file is specifically included to the step in caching:
    A cache management class is created, dictionary is created in the cache management class;
    Key code to the dictionary is assigned a value of the preset characters string of the first resource file, and the value to the dictionary is assigned a value of The array of the first resource file, the corresponding url for being denoted as the first resource file of the dictionary;
    According to the storage catalogue of the first resource file, by dictionary storage into caching.
  6. 6. according to any methods of claim 1-5, it is characterised in that further included after the step S3:
    If the first resource file is obtained there are the first resource file under the storage catalogue of the first resource file The caching stored;
    If according to the url of the first resource file, the corresponding dictionaries of the url are got in the caching, then according to institute State dictionary and obtain the first resource file.
  7. 7. according to the method described in claim 6, it is characterized in that, the step S3 further comprises:
    If according to the url of the first resource file, the corresponding dictionaries of the url are not got in the caching, then root The first resource file is searched in a hard disk according to the storage catalogue of the first resource file;
    If the first resource file is read, while described first is provided there are the first resource file in the hard disk Source file is stored into the caching.
  8. 8. a kind of resource file downloads updating device, it is characterised in that including:
    Acquiring unit, in application program launching, obtaining the configuration file of first resource file;
    Download unit, the key for the first resource file in the configuration file are not present in the downloaded in advance in caching When in the key of two resource files, the first resource file is downloaded;
    Updating block, is encrypted using the key of the first resource file for the url to the first resource file, obtained The storage catalogue of the first resource file is taken, is delayed the first resource file storage of download to described according to the storage catalogue In depositing.
  9. 9. a kind of resource file downloads more new equipment, it is characterised in that including:
    At least one processor, at least one processor and bus;Wherein,
    The processor and memory complete mutual communication by the bus;
    The memory storage has the programmed instruction that can be performed by the processor, and the processor calls described program instruction energy Enough perform the method as described in claim 1 to 7 is any.
  10. 10. a kind of non-transient computer readable storage medium storing program for executing, it is characterised in that the non-transient computer readable storage medium storing program for executing is deposited Computer instruction is stored up, the computer instruction makes the computer perform the method as described in claim 1 to 7 is any.
CN201711132054.3A 2017-11-15 2017-11-15 A kind of resource file downloading updating method and device Pending CN108008984A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711132054.3A CN108008984A (en) 2017-11-15 2017-11-15 A kind of resource file downloading updating method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711132054.3A CN108008984A (en) 2017-11-15 2017-11-15 A kind of resource file downloading updating method and device

Publications (1)

Publication Number Publication Date
CN108008984A true CN108008984A (en) 2018-05-08

Family

ID=62052426

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711132054.3A Pending CN108008984A (en) 2017-11-15 2017-11-15 A kind of resource file downloading updating method and device

Country Status (1)

Country Link
CN (1) CN108008984A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114286195A (en) * 2021-12-23 2022-04-05 广州津虹网络传媒有限公司 Live broadcast gift resource updating method and device, equipment, medium and product thereof
CN116339817A (en) * 2023-05-31 2023-06-27 天翼云科技有限公司 Universal m3u8 file rewriting method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870470A (en) * 2012-12-11 2014-06-18 腾讯科技(深圳)有限公司 Method for loading resource files of application and loading device
CN105701153A (en) * 2015-12-29 2016-06-22 北京金山安全软件有限公司 Method and device for reading webpage resources and electronic equipment
CN106569859A (en) * 2016-10-28 2017-04-19 搜游网络科技(北京)有限公司 Method and device for loading object file
KR20170053279A (en) * 2015-11-06 2017-05-16 주식회사 엘지유플러스 Apparatus and Method for executing Application installed in Cloud Storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103870470A (en) * 2012-12-11 2014-06-18 腾讯科技(深圳)有限公司 Method for loading resource files of application and loading device
KR20170053279A (en) * 2015-11-06 2017-05-16 주식회사 엘지유플러스 Apparatus and Method for executing Application installed in Cloud Storage
CN105701153A (en) * 2015-12-29 2016-06-22 北京金山安全软件有限公司 Method and device for reading webpage resources and electronic equipment
CN106569859A (en) * 2016-10-28 2017-04-19 搜游网络科技(北京)有限公司 Method and device for loading object file

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114286195A (en) * 2021-12-23 2022-04-05 广州津虹网络传媒有限公司 Live broadcast gift resource updating method and device, equipment, medium and product thereof
CN114286195B (en) * 2021-12-23 2023-10-13 广州津虹网络传媒有限公司 Live gift resource updating method and device, equipment, medium and product thereof
CN116339817A (en) * 2023-05-31 2023-06-27 天翼云科技有限公司 Universal m3u8 file rewriting method and system
CN116339817B (en) * 2023-05-31 2023-07-28 天翼云科技有限公司 Universal m3u8 file rewriting method and system

Similar Documents

Publication Publication Date Title
CN105677250B (en) The update method and updating device of object data in object storage system
CN104461504B (en) A kind of management method of end application
US9251187B2 (en) Metadata-driven version management service in pervasive environment
CN109391509A (en) A kind of method, system and the application server of more new application
CN104488248B (en) A kind of file synchronisation method, server and terminal
CN105045631A (en) Method and device for upgrading client-side applications
CN103067466B (en) A kind of client and method realizing file synchronization storage
CN112114849B (en) Resource updating method and device
CN103988200A (en) Lightweight framework for web applications
KR100974160B1 (en) Method, system and program product for preserving mobile device user settings
CN110362338B (en) Game resource packaging and resource quick access method under mobile platform
CN104461505B (en) A kind of terminal
CN103716346A (en) Management method and device of application on android handset client
CN105049514A (en) File downloading method and file downloading device
CN104038520A (en) Multi-version distributed resource management method and multi-version distributed resource management system
CN105320577B (en) A kind of data backup and resume method, system and device
CN105653209A (en) Object storage data transmitting method and device
CN103634393A (en) IVR (interactive voice response) and realization method thereof
US20160092206A1 (en) Managing executable files
CN104182532B (en) Terminal file cleaning method and device and terminal
CN110532016B (en) Version management method, version updating method and version management system
CN108008984A (en) A kind of resource file downloading updating method and device
CN106844763B (en) A kind of method showed to the Internet media file formula of modifying and its device
CN105653566B (en) A kind of method and device for realizing database write access
CN111767417A (en) Application picture management method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180508